summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T10134.hs
blob: 0b64625f28a61d5458c989f0c2f54c714096b540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE DataKinds, TypeOperators, ConstraintKinds, TypeFamilies, NoMonoLocalBinds, NoMonomorphismRestriction #-}
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}

module T10134 where

import GHC.TypeLits
import T10134a
import Prelude

type Positive n = ((n-1)+1)~n

data Dummy n d = Dummy { vec :: Vec n (Vec d Bool) }

nextDummy :: Positive (2*(n+d)) => Dummy n d -> Dummy n d
nextDummy d = Dummy { vec = vec dFst }
   where (dFst,dSnd) = nextDummy' d

nextDummy' :: Positive (2*(n+d)) => Dummy n d -> ( Dummy n d, Bool )
nextDummy' _ = undefined