DEV Community

loading...

Discussion on: Functional program boundaries

Collapse
swizzard profile image
sam

the boundary in haskell is main, not do, although that has as much to do with laziness as fp.

Collapse
drbearhands profile image
DrBearhands Author

I wasn't as accurate as I should have been in my post.

You're right in that main crosses the border of your program. do blocks are just syntactic sugar for effectfull monads.

However, if you're using monads as effects you are essentially doing imperative programming. A single, isolated, effectfull monad, such as Maybe used as the result division by 0, I would not consider imperative yet, but large do blocks full of them I would definitely consider part of the functional border.