Skip to content

GHCi does not support some TH elements, while those elemenst are working in hs files

Hello. Below is a code, which works when using runhaskell, but does not work in GHCi.

In GHCi we get following error: runQ [d| instance ( y ~ (t->t) ) => Member Vector y where member v = test |] <interactive>:19:6:

Exotic predicate type not (yet) handled by Template Haskell

y ~ (t -> t)

code:

{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} module Main where

import Language.Haskell.TH

class a ~ b => HEq a b

test :: a -> a test x = x

data Vector class Member a b where member :: a -> b

main :: IO () main = print =<< runQ [d| instance y ~ (t->t) => Member Vector y where member v = test |]

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information