[Haskell-cafe] newbie "concatenating" monad question

Leandro Penz lpenz at terra.com.br
Sat Mar 24 15:09:13 EDT 2007


Hi

I'm new here and this is my first mail to the list, so be gentle :)

I have some functions that build big strings by calling other functions and
appending the result, like

buildStuff =
  func1 ++ func2 ++ func3 ++ func4

My idea is to have a monad with a concatenating >>, so that I can:

bulidStuff = do
  func1
  func2
  func3
  func4

I am thinking about using the writer monad, but I would still have to use
"tell". The list monad is not an option either, as it does not concatenate.

Is there a proper way of doing something like this (efficiently) ?

Leandro Penz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070324/7b22e32d/attachment.htm


More information about the Haskell-Cafe mailing list