[Haskell-beginners] Show a function?

Tony Morris tonymorris at gmail.com
Fri Nov 11 00:23:20 CET 2011


On 11/11/2011 09:18 AM, Costello, Roger L. wrote:
> Hi Folks,
>
> Consider this function:
>
>       true = (\x y -> x)
>
> When I type this at WinGHCi:
>
>     true
>
> I would like WinGHCi to show this string:
>
>    TRUE
>
> Is there a way to "show" a function?
>
> /Roger
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
You can do it easily if you wrap your function up in a newtype:

http://paste.pocoo.org/show/506051/

-- 
Tony Morris
http://tmorris.net/





More information about the Beginners mailing list