Show sources of cost centers in .prof
[ghc.git] / testsuite / tests / generics / T5462Yes1.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE DeriveGeneric #-}
4 {-# LANGUAGE DeriveFunctor #-}
5 {-# LANGUAGE DefaultSignatures #-}
6 {-# LANGUAGE StandaloneDeriving #-}
7 {-# LANGUAGE UndecidableInstances #-}
8 {-# LANGUAGE DeriveAnyClass #-}
9
10 module Main where
11
12 import GHC.Generics hiding (C, C1, D)
13 import GEq1A
14 import Enum
15 import GFunctor
16
17 data A = A1
18 deriving (Show, Generic, GEq, GEnum)
19
20 data B a = B1 | B2 a (B a)
21 deriving (Show, Generic, Generic1, GEq, GEnum, GFunctor)
22
23 data C phantom a = C1 | C2 a (C phantom a)
24 deriving (Show, Generic, Generic1, GEq, GEnum, GFunctor)
25
26 data D f a = D1 (f a) (f (D f a)) deriving (Generic, Generic1)
27 deriving instance (Show (f a), Show (f (D f a))) => Show (D f a)
28 deriving instance (GEq (f a), GEq (f (D f a))) => GEq (D f a)
29
30 data E f a = E1 (f a)
31 deriving (Show, Eq, Generic, Generic1, GFunctor)
32
33
34 main = print (
35 geq A1 A1
36 , take 10 (genum :: [A])
37
38 , geq (B2 A1 B1) B1
39 , gmap (++ "lo") (B2 "hel" B1)
40 , take 3 (genum :: [B A])
41
42 , geq (C2 A1 C1) C1
43 , gmap (++ "lo") (C2 "hel" C1)
44
45 , geq (D1 "a" []) (D1 "a" [])
46
47 , gmap (++ "lo") (E1 ["hel"])
48 )