haskell-generate icon indicating copy to clipboard operation
haskell-generate copied to clipboard

haskell-generate-0.2.4 does not compile

Open louisch opened this issue 8 years ago • 1 comments

Not sure why this is happening, but I'm getting

haskell-generate\src\Language\Haskell\Generate\TH.hs:28:5: error:
    * The constructor `VarI' should have 3 arguments, but has been given 4
    * In the pattern: VarI _ t _ _
      In a case alternative: VarI _ t _ _ -> return t
      In a stmt of a 'do' block:
        typ <- case info of {
                 VarI _ t _ _ -> return t
                 ClassOpI _ t _ _ -> return t
                 DataConI _ t _ _ -> return t
                 _ -> fail $ "Not a function: " ++ nameBase thing }

If I remove one of the underscores, then ClassOpI, followed by DataConI have the same problem, and after doing the same thing with those as well, I get this while compiling PreludeDef:

haskell-generate\src\Language\Haskell\Generate\PreludeDef.hs:15:1: error:
    Can't represent implicit parameters in Template Haskell: GHC.Stack.Types.HasCallStack

Any ideas?

louisch avatar Nov 01 '16 12:11 louisch

I ran across this, which seems to be related. Reifying the value error or undefined causes this error. This is because those are bound to declarations using the "implicit parameter" feature, which is not supported in template-haskell.

$(lookupValueName "error" >>= \(Just name) -> reify name >>= lift . show)
<interactive>:256:3: error:
    • Can't represent implicit parameters in Template Haskell: GHC.Stack.Types.HasCallStack
    • In the untyped splice:
        $(lookupValueName "error"
          >>= \ (Just name) -> reify name >>= lift . show)

ddssff avatar May 12 '18 20:05 ddssff