What other languages interest you?

I’m not a Haskell aficionado but I’ve dabbled with it for more than I have with Elixir and so I can say the following:
Haskell is not remotely close to Elixir, barring that they are both function languages.

Haskell is strong, statically typed language. And by strong I mean ironclad: you can’t even add an Int type with a Float type (if you want/need ambiguity about your numeric types your best bet is the Num typeclass (a conceptual equivalent of Java’s interfaces, only way “souped-up”). Also, as the example states, no automatic type casting. No type casting at all.
Ironclad strong typing. :slight_smile:

Haskell is also functional language in that function application has the highest priority and binding: if, for example mySquare squaress its argument (which, as stated before must be declared as a specific numeric type, or the Num typeclass) then mySquare 2 * 7 is 28, not 196 (to that you’d parenthesize: mySquare (2*7), or use the identity operator: mySquare $ 2 * 7).

Haskell is lazy by default. All operations are lazy. No Enum is strict but Stream is lazy.
You want strict, you’re gonna have to go to some lengths to accomplish that.

Syntax itself is very succinct. No parenthesis unless needed to create explicit binding order, for example.
(Can’t come up with more involved examples. It’s much more succinct then Elixir though).

Currying is built in. You define a function myFunc :: a -> a -> a which means it takes two arguments of type a and return an answer of the same type, and you can run myFunc a and it’s perfectly legal. You got yourself a thunk. Want to bind to a variable? Go right ahead: myThunk = myFunc a. Now you can call myThunk with the second argument to get the result.

Haskell’s guard are more complex and allow more fine-tuned control of the branching then Elixir allows.

Haskell is truly pure functional language. If you need state you must use monads. No abstraction like there are in Elixir. Same for I/O.

Due to all the above stated differences between the two languages, Haskell’s testing library can, for certain types of programs, prove that the code is bug-free or buggy. Of course “bug free” is subjective, but if the specs for the tests are defined as such-and-such the code can be proven either bug-free or buggy with respect to the specs.

I’m certain there’s many more changes between the languages I’m not aware of (being a newbie to both).
The way I see it, they are not competing languages, they complement each other: Elixir, being a sort-of wrapper for Erlang is great for “nine-nines” connectivity, for example. Haskell can be better used as an API engine behind the scenes.

And as for the original poster’s question, my interest, other than Elixir that is, lays with Haskell, PureScript (a subset of Haskell that trans-compiles to JS), Clojure and, of course… Elm (which is heavily influenced by Haskell, yes).

3 Likes