From 07edcf47c71cc4552a406a4f7b7d9ae1d7fe8a23 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 5 Aug 2015 22:54:02 +0200 Subject: fixed code example --- provider/posts/beuteltier-2.lhs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/provider/posts/beuteltier-2.lhs b/provider/posts/beuteltier-2.lhs index 4ffd75f..d5e0294 100644 --- a/provider/posts/beuteltier-2.lhs +++ b/provider/posts/beuteltier-2.lhs @@ -69,10 +69,10 @@ Quite often we find ourselves in the position that we want to alter some small p complicated structure. We would therefore like to write the following: ~~~ {.haskell .numberLines} -updateFoo :: Monad m => Foo -> m Foo -updateFoo = alter $ do - bar <~ constructNewBarInM - buz .= makeConstantBuz +updateFoo :: Foo -> Monad Foo +updateFoo x = alter x $ do + bar <~ (constructNewBar :: Monad Bar) + buz .= (makeConstantBuz :: Buz) ~~~ The definitions below allow us not only to do so, but also provide some convenience -- cgit v1.2.3