[Haskell-beginners] Showing Types
Alex Rozenshteyn
rpglover64 at gmail.com
Tue Mar 8 15:26:21 UTC 2016
And you also run into trouble with typeOf Nothing.
On Tue, Mar 8, 2016 at 10:09 AM, Alex Rozenshteyn <rpglover64 at gmail.com>
wrote:
> > But it works on concrete types, not functions.
>
> Isn't the problem type variables, not functions?
>
> Prelude Data.Typeable> :set -XScopedTypeVariables
> Prelude Data.Typeable> let fun x = case x of {Just (i::Int) -> i + 1;
> Nothing -> 0}
> Prelude Data.Typeable> :t fun
> fun :: Maybe Int -> Int
> Prelude Data.Typeable> typeOf fun
> Maybe Int -> Int
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160308/895754b1/attachment.html>
More information about the Beginners
mailing list