Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / boxy / Compose.hs
1 {-# OPTIONS_GHC -XImpredicativeTypes -fno-warn-deprecated-flags -XEmptyDataDecls -XGADTs #-}
2
3 -- #1118
4
5 module Compose where
6
7 data Z
8 data S n
9
10 data List n a where
11 Nil :: List Z a
12 (:-) :: a -> List n a -> List (S n) a
13
14 data Hold a = Hold (forall m . a m -> a (S m))
15
16 compose' :: List n (Hold a) -> a (S Z) -> a (S n)
17 compose' Nil x = x
18 compose' ((Hold f) :- fs) x = f (compose' fs x)
19
20 compose :: List n (forall m . a m -> a (S m)) -> a (S Z) -> a (S n)
21 compose Nil x = x
22 compose (f :- fs) x = f (compose fs x)
23
24 composeS :: [forall m . a m -> a m] -> a n -> a n
25 composeS [] x = x
26 composeS (f:fs) x = f (composeS fs x)