Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Showing Types (Alex Rozenshteyn)
2. Re: Showing Types (Alex Rozenshteyn)
----------------------------------------------------------------------
Message: 1
Date: Tue, 8 Mar 2016 10:09:21 -0500
From: Alex Rozenshteyn <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Showing Types
Message-ID:
<CALm==BUBwH0=edr1zz01nobws-b-btsex9src6dnde9ngab...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
> 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/09175447/attachment-0001.html>
------------------------------
Message: 2
Date: Tue, 8 Mar 2016 10:26:21 -0500
From: Alex Rozenshteyn <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Showing Types
Message-ID:
<CALm==BWHyVZCZKj2QXOATmvSTxPWT1z9JsZAKiVuD=_waat...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
And you also run into trouble with typeOf Nothing.
On Tue, Mar 8, 2016 at 10:09 AM, Alex Rozenshteyn <[email protected]>
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-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 93, Issue 8
****************************************