T14547.hs 313 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE TypeFamilies #-}

module T14547 where

class Foo f where
        type It f
        foo :: [It f] -> f

data List a = Empty | a :! List a deriving Show

instance Foo (List a) where
        type It (List a) = a
        foo [] = Empty
        foo (x : xs) = x :! foo xs