And for things like pattern matching, I've played around with doing similar things in Ruby, too. For example, in Elixir you might write a method that should only ever return `:ok`, and a pattern match like this...
# if :ok, nothing special happens
# if not :ok, "MatchError" is raised
:ok = Fooer.foo(foo)
So in Ruby, I played around a watered down equivalent like this def ok!(obj)
raise "match error" unless obj == :ok
end
# if :ok, nothing special happens
# if not :ok, "match error" is raised
ok! fooer.foo
One day I wrote a bunch of Ruby code of 'ok! <arg>` all over the app, and it made getting the program to run correctly a lot easier (at a time my brain was acclimated to Elixir). I don't know if I'd ever try getting developers on a Ruby project to embrace Erlang/Elixir's "let it crash" mentality, which might not be a great idea for a number of reasons, but it was interesting to me that I had even considered it as an option. Before writing Elixir code, writing a program that crashed on purpose was an alien concept to me.