From 4b192701b6c9ff1ff49405132e2580438b644d27 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sun, 17 Mar 2019 18:09:11 +0100 Subject: snipets clean --- snip/snip.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/snip/snip.hs b/snip/snip.hs index 532329f..4b7b461 100644 --- a/snip/snip.hs +++ b/snip/snip.hs @@ -1,2 +1,14 @@ +import Control.Monad.Writer +import Control.Monad.State + -- monad transformers in action -Main Control.Monad.Writer Control.Monad.State> runState (runWriterT (get >>= \a -> tell ["foo"] >> put (a*a) >> tell ["bar"] >> tell [show a])) 5 +main = print $ + runState ( + runWriterT ( + get >>= \a -> + tell ["foo"] >> + put (a*a) >> + tell ["bar"] >> + tell [show a] + ) + ) 5 -- cgit v1.2.3