Skip to content

Instantly share code, notes, and snippets.

@gnumonik
Created September 21, 2020 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnumonik/51b29cb694a8e19052f3613b8cc3fcfa to your computer and use it in GitHub Desktop.
Save gnumonik/51b29cb694a8e19052f3613b8cc3fcfa to your computer and use it in GitHub Desktop.
mkFieldParsers2 :: Name -> ExpQ
mkFieldParsers2 name = do
TyConI dec <- reify name
case dec of
DataD _c _n _bnd _k dCons _ -> case getSomeParser (ConT _n) of
Just aParser -> [| aParser |] -- No lift instance error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment