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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

android - How to prevent keyboard from closing when bottom dialog is open? -