summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T10134.hs
blob: 746758ce2f113adc2701340b05a83a048a098cf6 (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 as L
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 L.* (n+d)) => Dummy n d -> Dummy n d
nextDummy d = Dummy { vec = vec dFst }
   where (dFst,dSnd) = nextDummy' d

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