------------------------------------------------------------------------
module M where

class Seq s a | s -> a where
    m :: Seq s b => (a -> b) -> s a -> s b

data PS a = PS String

instance Seq PS Char where
    m f (PS s) = PS (map f s)
------------------------------------------------------------------------

This is not accepted by Hugs:

ERROR "M.hs" (line 9): Inferred type is not general enough
*** Expression    : m
*** Expected type : (Seq PS Char, Seq PS a) => (Char -> a) -> PS Char -> PS a
*** Inferred type : (Seq PS Char, Seq PS Char) => (Char -> Char) -> PS Char -> PS Char

Is that right? After all, the dependency plus the instance say that
(Seq PS a) implies (a == Char).


BTW. I really miss working functional dependencies in GHC.

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/            GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to