I'm clear about the generic functions and generic data-types.
In the generic type:
data SB = forall x. (show x) => SB x
instance Show SB where
show (SB x) = show x
so for any given type x
, if it has a signature of Show
, and there sure be a show
function corresponds to it.
but when typing in ghci, e.g.
:t 1
outputs
1 :: Num a => a
if binds 1
to a name:
let a=1
:t a
now a
has a true type.
The question is:
What is 1
's form in the run-time system(before it has a type, it has only Num
), since it can only hold some info of what it can be transformed to.
Are there some internal functions for 'packing up' the generic 'information' into real things?
For all that I know now, In haskell there should be 'generic' tags on some real things, but there should not be some 'pure generic things'.
Regards!
possible result:
reference to `1` becomes:
get_const_value_1 :: (Num a) => a
get_const_value_1 = fromIntegral (1 :: Integer)