DEV Community

loading...

Discussion on: Functors Compose, Monads Do Not

Collapse
antonrich profile image
Anton
map :: forall a b. (a -> b) -> f a -> f b

What is "forall a b.". When I check map in the ghci it just gives me



map :: (a -> b) -> f a -> f b
Collapse
riccardoodone profile image
Riccardo Odone Author

The snippets in this posts are written in PureScript. My bad for not making it clear, sorry!

If you are curious you can find the answer to your question in the "Differences from Haskell" docs in the PureScript docs repo. The punch line is the one that follows:

Polymorphic functions in PureScript require an explicit forall to declare type variables before using them.

Forem Open with the Forem app