[Haskell-cafe] On to applicative
ajs at 2piix.com
Thu Sep 2 14:46:28 EDT 2010
On Sep 2, 2010, at 11:30 AM, michael rice wrote:
> In each case, what does the notation
> show:: ...
> undefined:: ...
They're type annotations. show is a function in "many" types:
Prelude> :t show
show :: (Show a) => a -> String
If you want to see the type of a "specific" show function, you need to
find a way to "determine" its type. This is a slightly different
function, but it's equivalent in types and semantics:
Prelude> :t \x -> show x
\x -> show x :: (Show a) => a -> String
Now we have a named argument, and we can constraint its type with an
Prelude> :t \x -> show (x :: Int)
\x -> show (x :: Int) :: Int -> String
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe