3 ms·
Yes! Consider jq. jq is almost a 100% pure functional programming language [0], and it's a lot like using the list monad in Haskell. Various monads basically
by cryptonector 3y ago
Yes! Consider jq. jq is almost a 100% pure functional programming language [0], and it's a lot like using the list monad in Haskell.
Various monads basically help you manage things like configuration parameters that affect your computations. Your code can all be deterministic, and yet using a monad can help you write cleaner code.
Just because the IO monad is used for impure actions doesn't mean that monads in general are used for impure actions.
[0] There are a few builtins that have side-effects: `input` and `inputs` (which consume inputs), and then there's `stderr` and `debug` (which emit output to `stderr`). Other than this, every jq program represents a pure transformation of its input.