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? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -