blob: f2dd040bdcd83b0d1d0c6ba7d5eb8c19fd6a7305 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE RoleAnnotations #-}
module Bug where
import Data.Typeable
import GHC.Generics
import Data.Data
data Condition v = Condition
deriving (Functor, Foldable)
-- We don't want the phantom optimization to kick
-- in here and confuse the test.
type role Condition representational
data CondTree v c a = CondNode
{ condTreeData :: a
, condTreeConstraints :: c
, condTreeComponents :: [CondBranch v c a]
}
deriving (Functor, Foldable)
data CondBranch v c a = CondBranch
{ condBranchCondition :: Condition v
, condBranchIfTrue :: CondTree v c a
, condBranchIfFalse :: Maybe (CondTree v c a)
}
deriving (Functor, Foldable)
|