pyCthon
pyCthon

Reputation: 12361

Print function type to console without ghci

Is there a way of printing the function or expression type to the command line in a compiled Haskell program, much like how ghci has :t which prints out the type?

Upvotes: 5

Views: 694

Answers (1)

sclv
sclv

Reputation: 38901

With a Typeable constraint (from Data.Typeable), you can use show . typeOf.

Upvotes: 10

Related Questions