|
|
|
|
|
by ChadNauseam
905 days ago
|
|
Not to mention you need monadic and nonmonadic versions of every higher order function (or so it feels like) - map / mapM, fold / foldM, etc. This is even worse in Rust, which requires you to have a separate implementation for every effect as well (since it doesn't have higher kinded types) |
|
This is more a weakness of Haskell's standard library (which is despite its reputation not very friendly to category theory) than an inherent problem with monads. A more general `map` would look something like this
but this would require somewhat better type-level programming support for the ergonomics to work out.