3 ms·
The Haskell list is implemented as a monad. A list in general isn't a monad. You can use Monads to implement lists, but that doesn't make them Monads anymore th
by sudosysgen 4y ago
The Haskell list is implemented as a monad. A list in general isn't a monad. You can use Monads to implement lists, but that doesn't make them Monads anymore than saying that lists are generic container classes.
- nightski 4y agoDo you have an example of a list, which meets the mathematical definition, which would not be able satisfy the requirements of a monad? Meaning one could not write a bind or lift operation for that list?
- sudosysgen 4y agoNo, you deeply misunderstand what a monad is. Monad doesn't mean you can write the bind and lift operations, a monad contains the bind and lift operation. The bind and lift operation is a component of the monad. You could probably shoehorn some kind of bind and lift into any conceivable generic type.
- pyrale 4y ago> You could probably shoehorn some kind of bind and lift into any conceivable generic type. You actually can't implement Monad for most contravariant functors.