Template Haskell - How to lookup type operator name? -
how lookup type operator name? not work:
issueth.hs:
{-# language templatehaskell #-} module issueth import language.haskell.th f :: q [dec] f = n <- lookuptypename "ghc.typelits.*" return []
issue.hs:
{-# language templatehaskell #-} module issue import issueth $f
ghc issue.hs
fails message:
pattern match failure in expression @ issueth.hs
replacing "ghc.typelits.*"
"ghc.typelits.(*)"
or "*"
doesn't work either.
i guess have enough brief answer. alas found reason problem, not how solve it.
my testing shows lookuptypename
does support type operators, if start :
.
originally requirement, in analogy infix data constructors, lifted allow things arithmetical type operators in ghc.typelits
. (the downside can no longer have type operator variables, once popular things arrow
code.)
presumably lookuptypename
not updated take account, , have filed bug report this.
edit: fix has been made, , should in upcoming ghc 8.2.1.
Comments
Post a Comment