generics - Derive a record datatype without template haskell -


so, i've been toying around little bit ghc.generics, great, seem limited/focused on generating instances.

what do, if possible, derive new data type another.

let's you've got following type:

data xpto = xpto {     fstt :: first int     lstt :: last string } 

i obtain following data type 'for free':

data xpto' = xpto' {    fstt' :: int    lstt' :: string } 

one possibility i've considered use type families, new data have same kind xpto:

class xptos newtyped    type unnewtyped un :: (same kind newtyped) 

i'm starting think none of possible, , i'm sure there reasons that.

note 1: know feasible template haskell... wondering if there other way.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -