Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Muphrid
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
1.
▲
by
Muphrid
11y ago
That operation is called fmap, and it's characteristic of a functor. In Haskell, it's called liftM for monads, but they're really the same thing (and I think recent proposals are going to iron out this redundancy). fmap is on
2.
▲
by
Muphrid
11y ago
No, plain functors, applicative functors, and monads each deal with a different potential use case. Look at the specific type signatures: plain functor - fmap: (a -> b) -> (F a -> F b) applicative functor - ap: A (a -> b)
3.
▲
by
Muphrid
11y ago
The order of operations here is "right associative". So A -> B -> C -> D is equivalent to any of the following A -> (B -> C -> D) A -> (B -> (C -> D)) A -> B -> (C -> D) They&#
4.
▲
by
Muphrid
11y ago
Whoever told you it has to do with IO and functional purity vastly oversimplified things. That is just one use case. Monads take care of a very common computation pattern: wrapping and unwrapping data from a container to do stuff with it.