3 ms·
Why do you want to code one? Monads are a class of solutions to certain problems. Look at your problem and solve it using regular haskell. Now look at your solu
by tinco 14y ago
Why do you want to code one? Monads are a class of solutions to certain problems. Look at your problem and solve it using regular haskell. Now look at your solution, it might be that the set of functions that define your solution describe a monad. Is this relevant? Usually not, unless you are developing a highly reusable library.
An example: almost every FP course has the students define the Maybe datatype with its accompanying functions. In Haskell Maybe is an instance of Monad, but you don't need to know that to use or make Maybe, it just turns out that the Maybe solution is in that class of Monads.