[Haskell-cafe] type checking that I can't figure out ...

Vasili I. Galchin vigalchin at gmail.com
Wed Jun 3 13:18:28 EDT 2009


Hi Andrew (Bromage),

       I reversed the  parameter order to Data.Map.lookup and calling
fromJust to pull out value from Maybe wrapper ... all as you suggested:

> remLookupFwd :: (ReVars m t) => SimplRe t -> ReM m t (ReInfo t)
> remLookupFwd re
>   = do fwd <- gets resFwdMap
>        let { Just reinfo = fromJust(M.lookup re fwd) }
-- PROBLEM
>        return reinfo


I am still getting a type mismatch:


Swish\HaskellRDF\Dfa\Dfa.lhs:162:29:
    Couldn't match expected type `Maybe t'
           against inferred type `ReInfo t1'
    In the expression: fromJust (M.lookup re fwd)
    In a pattern binding: Just reinfo = fromJust (M.lookup re fwd)
    In the expression:
        do fwd <- gets resFwdMap
           let Just reinfo = fromJust (M.lookup re fwd)
           return reinfo

Vasili
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090603/f37a6534/attachment.html


More information about the Haskell-Cafe mailing list