T3965.hs 454 Bytes
Newer Older
Simon Peyton Jones's avatar
Simon Peyton Jones committed
1 2 3 4 5
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, StandaloneDeriving, TypeOperators, UndecidableInstances #-}
module T3965 where

import Data.Data

6
data T f e = Inl (f e) deriving (Data, Typeable, Eq)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
7

8
newtype Expr f = In (f (Expr f)) deriving Typeable
Simon Peyton Jones's avatar
Simon Peyton Jones committed
9

10
deriving instance (Typeable a, Data (a (Expr a))) => Data (Expr a)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
11 12 13 14 15 16 17 18

data Var e = Var String deriving (Data, Eq, Typeable)

data Domain e g = Domain
    (Expr (T Var))
    deriving (Data, Typeable)