Many functions in Haskell made up of special characters in Haskell are infix functions. These include *
, +
, ==
, /
, etc. To get the type signatures of such functions you put the function in parentheses and execute :t
, like so:
GHCi> :t (==)
(==) :: Eq a => a -> a -> Bool
I wanted to try and get the type signature of the range function, [a..a]
, but it seems that this function is infix, but can only be used within a list []
. I tried all the following, but none worked:
GHCi> :t (..)
<interactive>:1:2: parse error on input `..'
GHCi> :t ([..])
<interactive>:1:3: parse error on input `..'
GHCi> :t [..]
<interactive>:1:2: parse error on input `..'
GHCi> :t ..
<interactive>:1:1: parse error on input `..'
Does anyone know how to get the type signature of the range function?