UserPreferences

ThomasJaeger/MoinEditorBackup


Near end of article, there's

reflect :: m a -> (<m> => a)
reify   :: Monad m => (<m> => a) -> m a

foo :: <[]> => Int
foo = reflect [0,2] + reflect [0,1]

bar :: [Int]
bar = reflect foo

Shouldn't the definition of bar read

bar :: [Int]
bar = reify foo

?

-- StefanLjungstrand

Thank you very much, this was indeed a typo. It's fixed now. -- ThomasJaeger

In the section entitled "Monadic Reflection" there is a snippet...

> reify (reflect [0,1] + reflect [0,2]) :: [Int]
and
> liftM2 (+) [0,1] [0,2]

both yield the same result, namely [0,1,2,3] 

but "liftM2 (+) [0,1] [0,2]" will really yield [0,2,1,3]

Thanks, fixed. -- ThomasJaeger