Ticket #7701: bug2.hs

File bug2.hs, 508 bytes (added by erantapaa, 14 months ago)

example code

Line 
1{-# LANGUAGE UndecidableInstances #-}
2{-# LANGUAGE NoImplicitPrelude #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE TypeOperators #-}
6{-# LANGUAGE FunctionalDependencies #-}
7
8data Nil
9data Cons x xs
10
11data x ::: xs
12infixr 5 :::
13
14class ListConcat l1 l2 l | l1 l2 -> l where
15  listConcat :: l1 -> l2 -> l
16
17instance ListConcat Nil l l
18  where listConcat = undefined
19instance (ListConcat xs ys zs) -> ListConcat (x ::: xs) ys (x ::: zs)
20  where listConcat = undefined
21