I think it's quite misleading to list Haskell in the title: the only common thing between Loop and Haskell that I've found is pattern matching, and that's not even exclusive to Haskell -- other languages have it. Besides, it's not clear from the intro that Loop's pattern matching is as powerful as Haskell's (especially with all the extensions). Finally, pattern matching is really a syntactic sugar over the case/switc…
Pattern-matching means that the branching primitive not only dispatches to different code based on an input tag, but also that it places different values of different types in scope according to the branch.
Most languages only branch on booleans, without gaining any type information at all. This is actually a big problem and relates to the nullability problem, explained at: http://existentialtype.wordpress.com/2011/03/15/boolean-blin...
For example, in C:
switch(ptr) {
case NULL: ... handle null case ...
default: ... use ptr as if it weren't NULL ...
}
This is unsafe -- because nothing prevents you from using ptr in the "NULL" case, and the compiler does not give you anything in the non-NULL case.In Haskell:
case ptr of
Nothing -> ... can't use ptr as a value here,
it's wrapped with Maybe ...
Just x -> ... pattern-matching gave us "x" of
the correct type.
We can now safely use it.