[Haskell] Help in understanding a type error involving forall and class constraints

MR K P SCHUPKE k.schupke at imperial.ac.uk
Tue Jun 29 18:38:15 EDT 2004


Try this:

distString :: String -> String -> Int
distString s0 s1 = let a = runST (difST s0 s1)
   in a!(1,1)

difST :: MArray (STUArray s) Int (ST s) => String -> String -> ST s (UArray (Int,Int) Int)
difST s0 s1 = do
   b@(_,br) <- return $ (\x1 y1 -> ((0,0),(x1,y1))) (length s0) (length s1)
   d <- newArray b 0 :: ST s (STUArray s (Int,Int) Int)
   mdiff d s0 s1
   -- readArray d br
   unsafeFreeze d


Keean.


More information about the Haskell mailing list