{-# LANGUAGE
    DeriveDataTypeable,
    TypeOperators
    #-}
module GHCLoop where

newtype Expr f = In (f (Expr f))

class Functor f => FuncEq f where
    funcEq :: FuncEq g => f (Expr g) -> f (Expr g) -> Bool

instance (FuncEq f) => Eq (Expr f) where
    (In x) == (In y) = funcEq x y

data Not e = Not e
instance Functor Not where
    fmap f (Not e) = Not $ f e
instance FuncEq Not where
    funcEq (Not x) (Not y) = x == y

data GoalLit e = GoalLit (Expr Not) deriving (Eq)

