I'm pretty new to Haskell although I did some ML many moons ago. I'm trying to set up a deck of playing cards, shuffle them and then deal them. I have the deck and shuffle sorted (of a fashion) but ...
I have a function returning an Either such as GetUserFromDb(int id). If the database is offline, should I catch the error in the function and wrap it in a failure / Left case or should I let it ...
I'm looking for examples of interesting methods that take an arbitrary monad and do something useful with it. Monads are extremely general, so methods that operate on monads are widely applicable. On ...
Better to use error monad with validation in your monadic functions, or implement your own monad with validation directly in your bind?
I'm wondering what's better design wise for usability/maintainability, and what's better as far as fitting with the community. Given the data model: type Name = String data Amount = Out | Some | ...
The IO monad in Haskell is often explained as a state monad where the state is the world. So a value of type IO a monad is viewed as something like worldState -> (a, worldState). Some time ago I ...
While learning Haskell I have faced a lot of tutorials trying to explain what are monads and why monads are important in Haskell. Each of them used analogies so it would be easier to catch the ...
I was doing a presentation on F# and was discussing the Option type when someone in the audience asked me if the Option type is F#'s implementation of the maybe monad. I know that's not the case but ...
I wonder what are the advantages of Maybe monad over exceptions? It looks like Maybe is just explicit (and rather space-consuming) way of try..catch syntax. update Please note that I'm intentionally ...