Skip to content

:sprint should print WHNF functions differently

ghci :sprint currently prints closures the same as thunks.

ghci> let f () = ()
ghci> :sprint f
f = _

A common puzzle for beginners where this comes up is to figure out why "overloaded values" do not seem to get evaluated.

ghci> let x = 3
ghci> x
3
ghci> :sprint x
x = _

x gets compiled to a function expecting a Num dictionary, so it does get evaluated, to a function.

It seems helpful to print functions differently, say f = <fun>. (Credit to Andres Loh for the idea.)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information