All Questions
6 questions
7
votes
3
answers
3k
views
Should databases be viewed as Monads?
Because any kind of persistence updates/inserts/deletes represents in some sense a kind of state change in a database, it makes me wonder whether databases can be considered monads. We say the same ...
103
votes
2
answers
26k
views
What is the "Free Monad + Interpreter" pattern?
I've seen people talking about Free Monad with Interpreter, particularly in the context of data-access. What is this pattern? When might I want to use it? How does it work, and how would I implement ...
1
vote
1
answer
603
views
Picking a card from a shuffled deck
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'...
9
votes
1
answer
1k
views
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 | ...
47
votes
5
answers
7k
views
Critique of the IO monad being viewed as a state monad operating on the world
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 ...
30
votes
3
answers
7k
views
Different ways to see a monad
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 meaning....