{"body":"mkInstanceDeclaration :: String -> Name -> [VarBangType] -> Q [Dec]\nmkInstanceDeclaration tagName typeConstr fields = do\n  fieldsExps <- fmap ListE $\n    forM fields $ \\(fieldName, _, _) ->\n      [e|($(stringE $ nameBase fieldName), $(varE fieldName) el & $(appTypeE $(varE $ mkName \"field\") $(strTyLit $ nameBase fieldName)) %~ (fmap) (pack . show))|]\n  [d|\n    instance Applicative f => Component2 f $(conT typeConstr) where\n      tag2 = $(stringE tagName)\n      attributes2 $(varP $ mkName \"el\") = $(pure fieldsExps)\n    |]\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/415esCiO","modified":1612544599,"id":"415esCiO","size":527,"lines":10,"own_paste":false,"theme":"","date":1612544599}