[Haskell-cafe] Reader monad
Albert Y. C. Lai
trebla at vex.net
Wed Dec 29 21:27:44 CET 2010
On 10-12-29 12:50 PM, michael rice wrote:
> I think of (r -> m a) as a type signature and Int or Bool by themselves
> as types. So, all type signatures are themselves types?
http://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-620004
In particular
gendecl → vars :: [context =>] type (type signature)
Therefore I think of
n :: Int
f :: r -> m a
as type signatures, and their right-hand sides alone,
Int
r -> m a
as types.
I also include the "context =>" part in my types, for example
m :: Num a => a
I take the type to be
Num a => a
The grammar splits out the "context =>" part just for the sake of reuse
in other places such as
topdecl → ...
| data [context =>] simpletype [= constrs] [deriving]
More information about the Haskell-Cafe
mailing list