I think it's a much more elegant way to handle end conditions and special cases than if statements and it makes the code much easier to reason about.
It is also awesome when used in conjunction with union types.
dataPony=PegasusStringInt|UnicornStringString|EarthPonyStringapplejack=EarthPony"Applejack"twilight=Unicorn"Twilight Sparkle""levitation"rainbow=Pegasus"Rainbow Dash"20f::Pony->Stringf(Pegasusnamespeed)=name<>" flies at "<>(showspeed)<>"mph"f(Unicorn"Twilight Sparkle"_)="Twilight Sparkle is an Alicorn now, get over it!"f(Unicornnamespell)=name<>" casts "<>spellf(EarthPonyname)=name<>" is a nice pony"
If I had ever understood lisp's macros I would probably mention them here too.
Pattern matching as done in ML languages.
I think it's a much more elegant way to handle end conditions and special cases than
if
statements and it makes the code much easier to reason about.It is also awesome when used in conjunction with union types.
If I had ever understood lisp's macros I would probably mention them here too.
Pattern matching, really loved it when I came across it in Erlang. Should brush up on declarative languages