So let’s say you have a variable n.
You want to check if its an integer, or even better yet check what type it is.
I know there is a function in haskell, isDigit that checks if it is a char.
However is there a function that checks if n is in integer, or even better, gives the type of n?
If you are using an interactive Haskell prompt (like GHCi) you can type
:t <expression>and that will give you the type of an expression.e.g.
gives
or e.g.
gives