[Haskell-beginners] applicative default structure
Ovidiu Deac
ovidiudeac at gmail.com
Thu Dec 22 15:06:48 UTC 2016
This code is using Applicative Maybe. The structure is provided by Maybe
and the value 1 is wrapped in this structure. No surprises here.
Prelude> pure 1 :: Maybe Int
Just 1
Prelude> :t (pure 1 :: Maybe Int)
(pure 1 :: Maybe Int) :: Maybe Int
...but can somebody explain the type of x below?
Prelude> x = pure 1
Prelude> x
1
Prelude> :t x
x :: (Applicative f, Num a) => f a
What is f here?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20161222/cff0b753/attachment.html>
More information about the Beginners
mailing list