2008/5/5 Sai Hemanth K <[EMAIL PROTECTED]>: > Hi, > > I declared a multi param type class as below: > class MyString m c where > zIndex :: m -> Int -> c > zLength :: m -> Int > zPack :: [c] -> m > zEquals :: c ->c -> Bool > zWrap :: [c] -> (m,AnExistingDataType)
I infer from your questions that you probably missed setting a functional dependency, that is > class MyString m c | m -> c where > zIndex :: m -> Int -> c > zLength :: m -> Int > zPack :: [c] -> m > zEquals :: c ->c -> Bool > zWrap :: [c] -> (m,AnExistingDataType) which means, "c is univocaly determined by m". You'll need -XFunctionalDependencies to make it work in GHC. _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
