You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tiny syntax sugar around Elixir's with special form.
Why ?
Because I'm happy on how Elixir's with special form works,
and can get used to the <- arrow but I still dont like to
place commas between all the with expressions.
Back then before elixir 1.2 release, I implemented happy using case
expressions, it leaked variables as normal case expressions would do, and overriding the standard
= operator turned out to have some unexpectedissues. Also, after using standard with a bit, I
really got to like it, except for the fact of having to place commas after expressions, so I wrote
happy_with which is a very tiny macro that just rewrites to Elixir's standard with special form.
This package implements the tags feature originally found in happy_path.
You can also use tags a feature from the happy project.
iex>importHappyWithiex>happy_withdo...>@something{:ok,name}whenis_binary(name)andlength(name)>3<-{:error,:nobody}...>_never_reached=String.downcase(name)...>else...>{:something,{:error,_}}->"could not fetch name"...>end"could not fetch name"