haskell - Prefix lenses for a type -


i have following data declared:

data =   { self              :: string   , id                :: string   , description       :: maybe string   , name              :: string   } deriving (generic, show)  instance fromjson  makelensesfor   [ ("self", "somethingself")   , ("id", "somethingid")   , ("description", "somethingdescription")   , ("name", "somethingname")   ]   ''something 

is possible automate lenses creation naming convention following simple rules.

after peek @ source code, can see there's lensrules instance, called abbreviatedfields, but, sadly, using makelenseswith abbreviatedfields ''something generates no lenses @ all. doing wrong?

here's source code: https://hackage.haskell.org/package/lens-4.14/docs/src/control.lens.th.html#abbreviatedfields


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -