[Haskell-cafe] A newbie question ?

Ivan Miljenovic ivan.miljenovic at gmail.com
Tue Apr 27 20:26:16 EDT 2010


On 28 April 2010 10:17, zaxis <z_axis at 163.com> wrote:
>
> newtype TypeMap = TypeMap (Map.Map TypeRep Dynamic)
>
> lookup :: Typeable a => TypeMap -> Maybe a
> lookup (TypeMap mp) = res
>    where res = liftM (fromJust . fromDynamic) $ Map.lookup (typeOf $
> fromJust res) mp
>
> It seems that the `res` in  `fromJust res`  has not been defined ?

http://www.haskell.org/haskellwiki/Tying_the_Knot


-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list