Evaluating type expressions in GHCi
Sean Leather
leather at cs.uu.nl
Fri Sep 23 11:11:07 CEST 2011
Hi Simon,
On Fri, Sep 23, 2011 at 10:04, Simon Peyton-Jones wrote:
> I did this. ****
>
> ** **
>
> *TF> :kind F Int****
>
> F Int :: *****
>
> *TF> :kind! F Int****
>
> F Int :: *****
>
> = Bool****
>
> ** **
>
> In the end I just made an eager version of :kind as the command: in
> addition to displaying the kind of the type, it normalises it and shows the
> result.****
>
> ** **
>
> It’s in HEAD. Documentation to come when I get home.
>
That's great! Much appreciated.
I’m not wedded to this command name. If everyone wants “:normalise” it
> would only take a 1-line change.
>
I'm also not picky about the name. But I do think fewer keystrokes are
better. I guess with ":kind!" you have have to type at least ':', 'k', '\t',
and '!', whereas with a unique first character such as 'n', you only have to
type ':', 'n' [1]. But that's the only real "concern" I would have about the
name.
Safe travels!
Regards,
Sean
[1] This presupposes that people actually want to use such a command. It
does make working with type families easier. And, now that I think about it,
I needed something like that this several years ago.
http://splonderzoek.blogspot.com/2009/06/rfc-extensible-typed-scanf-and-printf.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20110923/730ead05/attachment-0001.htm>
More information about the Glasgow-haskell-users
mailing list