summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/typecheck/should_compile/T2799.hs
blob: 38beabdd483f4ebaba5dc38c0a35cb36a2d99da2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# OPTIONS -XGADTs #-}

module RepAux (
  toSpineRl
) where

data MTup l where
    P :: MTup l -> MTup (a,l)

data Spine a where
    S :: Spine (a -> b) -> Spine b

toSpineRl :: MTup l -> l -> (l -> a) -> Spine a 
toSpineRl (P rs) (a, l) into = S (toSpineRl rs l into')
  where 
    into' tl1 x1 = into (x1,tl1)