3 ms·
[...] where the impure side of things was as easy to write as the pure computations, that would be great. From your post, I'm going to assume that you haven't
by anon_d 16y ago
[...] where the impure side of things was as easy to write as the pure
computations, that would be great.
From your post, I'm going to assume that you haven't used the languages
I'm talking about; sorry if I misread that. SML/Ocaml/F# are not purely
functional languages, so side effects work just like you'd expect coming from C/Python/etc. The language
encourages functional programming (for example, variables are immutable by default),
but imperative code is far from difficult to write. I highly recommend
you try one of these languages. They may just be what your looking for.
- Chris_Newton 16y agoI have some experience with both SML and OCaml, though it is quite limited. Perhaps it's either my background writing a lot of fairly mathematical code or simply my own ignorance, but I always found little things like having to distinguish * and *. operators in OCaml rather awkward. Granted, it beats M.times(a).plus(b), but it's the sort of slightly clunky blemish that puts me off, and it betrays a certain lack of power in the underlying model. (Haskell almost has the opposite problem, with a type system that seems able to do almost anything, but also having all the complexity that inherently comes with that.)
- eru 16y agoType classes may come to OCaml one day. That would solve it.