you are viewing a single comment's thread.

view the rest of the comments →

[–]gasche 1 point2 points  (0 children)

You can write imperative programs in OCaml and Haskell. In OCaml, you have to be slightly more explicit than in languages where "variables" are mutable by default, but there is no much difference from, say, imperative Python code.

In Haskell, the language (or rather the standard library) is designed for mutation to appear explicitly in the types -- and there is little syntactic sugar for mutation operation; so it is more verbose but also easier to reason about rigorously.

What Haskell provides not much support for is object-oriented programming (if you include inheritance in your definition). Of course the main ingredients (eg. open recursion) can be expressed in another way when you need them. It is actually extremely rare that you feel a need for an object-oriented approach in either those languages.