haskell - How can I create a value with a specific TypeRep -
using data.typeable
, can reify type of value -
typeof :: typeable => -> typerep
however, given typerep
, there seems no way "set" value type.
for example -
maybeinttype :: typerep maybeinttype = typeof (just 100 :: maybe int)
but how use maybeinttype
create (nothing :: maybe int)
?
Comments
Post a Comment