I'm really inexperienced at this :

-----------
{-# OPTIONS_GHC -fglasgow-exts -funbox-strict-fields
-fallow-undecidable-instances -O2 #-}

class Gadget g where
  fInit  :: g -> a -> g

data FString = FString !Int !String deriving Show

instance Gadget FString where
  fInit (FString n _) s = FString n (take n s)

-------------

I get the error message :
     Couldn't match expected type `String' against inferred type `a'
      `a' is a rigid type variable bound by
    the type signature for `fInit' at Gadget.hs:4:17
    In the second argument of `FString', namely `s'
    In the expression: FString n s
    In the definition of `fInit': fInit (FString n _) s = FString n s
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to