[Haskell-beginners] Getting a variables type as a string at runtime

Brandon Allbery allbery.b at gmail.com
Sun Jan 12 14:53:03 UTC 2014

On Sun, Jan 12, 2014 at 9:47 AM, Gareth Morgan <gmorgan1984 at gmail.com>wrote:

> Won't show include all the components? I wanted to include only the type
> name.

Types only exist at compile time normally. But if you add a Typeable
constraint (see Data.Typeable and the DeriveDataTypeable extension) you can
get type names at runtime.

brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140112/fefc0fbf/attachment.html>

More information about the Beginners mailing list