Posts in the “haskell” category

How to determine the type of an object in a Haskell program

There may be other ways to do this, but if you need to determine the type (type signature) of an object in a Haskell program, the following approach worked for me.

First, add this import statement to your program:

import Data.Typeable

What that does is give you access to a function named typeOf, which you can then use like this: