summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail188.hs
blob: fef1676e50116d806146dbb35de0e4e6988577f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE RankNTypes, KindSignatures #-}
{-# OPTIONS_GHC -Werror #-}

-- #959

module ShouldFail where

import Data.Kind (Type)

data D (f :: (Type -> Type) -> Type -> Type)
       (af :: Type -> Type)
       (ax :: Type) =
  D (af (f af ax))

data CList (f :: (Type -> Type) -> Type -> Type) (a :: Type) =
  RCons a (CList (D f) a)

type CycleList a = forall f. CList f a

chead :: CycleList a -> a
chead ys = case ys of (RCons x xs) -> x