Apply ?= Applicative, Chain ?= Monad
See original GitHub issueI’m a little confused here.
Is there any Functor that doesn’t have a .of
function? Isn’t that just a constructor?
Just.prototype.of = function(x) {
return new Just(x)
}
By this logic, an Apply is an Applicative and a Chain is a Monad.
Are there any good examples of data structures that are particularly only some of these categories, but not all of them?
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (10 by maintainers)
Top Results From Across the Web
Your easy guide to Monads, Applicatives, & Functors - Medium
Monad, applicative functor, and functor are just functional programming patterns you can use to deal with effects like lists/arrays, trees, ...
Read more >Applicative Functors - Monday Morning Haskell
Applicative functors are the second step to understanding monads. They build on our knowledge of normal functors and gives us a little more...
Read more >Control.Applicative - Hackage - Haskell.org
This module describes a structure intermediate between a functor and a monad (technically, a strong lax monoidal functor). Compared with monads ...
Read more >Chapter 10: Applicative Functors - mostly-adequate-guide
We can chain and then map the partially applied add(2) like so: ... If we can define a monad, we can define both...
Read more >Functors, Applicatives, And Monads In Pictures - adit.io
fmap shows us how it's done! But how does fmap know how to apply the function? Just what is a Functor, really? Functor...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just remembered that there’s a blog post with some examples, too: http://blog.functorial.com/posts/2015-12-06-Counterexamples.html
I see. So
.of
can take only a single parameter. And that parameter must be a basic type? Well what is a basic type? For example, what if you passed an array of two items inPair.of(['foo', 7])
?What I’m really struggling with is discriminative examples. I finally understand how all this stuff works in regards to Maybes and Arrays, but thats because they work for just about all of them. But what are some examples that discriminate between these categories well?
whats a semigroup that isn’t also a monoid?
whats a foldable that isn’t also a traversable?
whats an functor that isn’t also an apply?
whats an apply that isn’t also an applicative?
A pair is an Apply (you can bias
map
andap
to the right value), but it is not an Applicative because you can only pass one value (and any value) into.of
and even if its just the right value, it will not pass the interchange law.whats an apply that isn’t also a chain?
whats a chain that isn’t also a monad?
what an applicative that isn’t also a monad?
I’ve been trying to find answers to these all damn week! Any ideas?