maybe-hugs
maybe-hugs copied to clipboard
Maybe pattern matching?
While checking how the maybe hugs problem has been approached in Erlang and Elixir – languages that I'm in the middle of a learning process – I realised that the Elixir one is not implementing pattern matching and decided to try it out.
iex(1)> c "cutie.ex"
[Cutie]
iex(2)> c "maybe_hug.ex"
John accepts hug!
Mary prefers empathy!
[]
iex(3)>
User switch command
--> q