This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Interactive Elixir (1.5.1) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(1)> defmodule Bangpipe do | |
...(1)> defmacro left <|> right do | |
...(1)> quote do | |
...(1)> unquote(left) | |
...(1)> |> case do | |
...(1)> {:ok, val} -> val | |
...(1)> val -> val | |
...(1)> end | |
...(1)> |> unquote(right) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UnionTypes | |
// Learn more about F# at http://fsharp.org | |
type Shape = | |
| Circle of float | |
| Square of float | |
| Triangle of float * float | |
| Rectangle of float * float |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UnitsOfMeasure | |
[<Measure>] type cm | |
[<Measure>] type inch | |
type Shape<[<Measure>]'u> = | |
| Circle of float<'u> | |
| Square of float<'u> | |
| Triangle of float<'u> * float<'u> | |
| Rectangle of float<'u> * float<'u> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Until StreamData ships in Elixir it needs to be added as a dependency. | |
# https://hexdocs.pm/stream_data/StreamData.html#content | |
# https://hex.pm/packages/stream_data | |
# Add this to your mix.exs deps... | |
# {:stream_data, "~> 0.4.2"} | |
defmodule ColorNameTest do | |
use ExUnit.Case, async: true | |
use ExUnitProperties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Mac ~/Library/Application Support/Code/User/keybindings.json | |
[ | |
{ | |
"key": "alt+enter", | |
"command": "workbench.action.terminal.runSelectedText" | |
}, | |
{ | |
"key": "cmd+h", | |
"command": "editor.action.startFindReplaceAction" | |
}, |
OlderNewer