[Haskell-beginners] How do I perform things inside a Monad?

Daniel Trstenjak daniel.trstenjak at gmail.com
Fri Feb 8 12:01:04 CET 2013


Hi Martin,

On Fri, Feb 08, 2013 at 07:18:38AM +0100, Martin Drautzburg wrote:
> The thing is, I tried to split this monster up into several functions. For 
> this, my functions got quite a number of parameters. Passing bar baz to the 
> toplevel function would add even more parameters.

You might use the where clause:


foo bar baz = withFoo doFoo
   where
      doFoo foo = do
         blub
         withOtherThing doOtherThing

      doOtherThing thing = do
         blah
         something bar baz


Greetings,
Daniel



More information about the Beginners mailing list