I have the following code:
{-# LANGUAGE GADTs #-}
data Exp' a where
Float' :: (Num a) => Float -> Exp' a
g = Float' 1.2
If I type the above code directly into ghci
, and check g
's type, I'd get:
GHCI> let g = Float' 1.2
GHCI> :t g
g :: Num a => Exp' a
The above is what I expected.
However, when loading a file with the above code, I'd get this instead:
GHCI> :load <filename>
GHCI> :t g
g :: Exp' Integer
Any idea why the behaviors are different? Thanks in advance.