Skip to content

Instantly share code, notes, and snippets.

@gergoerdi
Last active December 7, 2020 01:01
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 gergoerdi/3a956ec99da5e6ae73d2d15a0300ab2b to your computer and use it in GitHub Desktop.
Save gergoerdi/3a956ec99da5e6ae73d2d15a0300ab2b to your computer and use it in GitHub Desktop.
liftTypeRep :: TypeRep a -> TH.Type
liftTypeRep ty = L.foldl AppT t0 [liftTypeRep ty' | SomeTypeRep ty' <- args]
where
(con, args) = splitApps ty
t0 = ConT $ mkName (tyConModule con <> "." <> tyConName con)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment