[Haskell-cafe] The difficulty of designing a sequence class

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Aug 1 07:01:50 EDT 2006


Hello Einar,

Tuesday, August 1, 2006, 1:58:30 PM, you wrote:

> class ElementType c a | c -> a
> class Foldable c where
>   fold :: ElementType c a => (a -> b -> b) -> b -> c -> b

i love it! will it be possible to write smth like this:

class Stream m h | h->m

data T h = (Stream m h) => C (m Int)

? currently, i need to pass 'm' parameter to T type constructor too,
because GHC can't guess what 'm' is determined by 'h'


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list