summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T14164.hs
blob: 1cf6f2d78b87e44c532231d6c0658cbebba64b74 (plain)
1
2
3
4
5
6
7
8
9
10
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
module T14164 where

data G (x :: a) = GNil | GCons (G x)

type family F (xs :: [a]) (g :: G (z :: a)) = (res :: [a]) | res -> a where
  F (x:xs) GNil         = x:xs
  F (x:xs) (GCons rest) = x:F xs rest