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 joe. | |
-export [test/0, perms/1]. | |
test() -> | |
[[]] = joe:perms(""), | |
["a"] = joe:perms("a"), | |
["ab", "ba"] = joe:perms("ab"), | |
["ba", "ab"] = joe:perms("ba"), | |
["123","132","213","231","312","321"] = joe:perms("123"), |
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 joe. | |
-export [test/0, perms/1]. | |
test() -> | |
[[]] = joe:perms(""), | |
["a"] = joe:perms("a"), | |
["ab", "ba"] = joe:perms("ab"), | |
["ba", "ab"] = joe:perms("ba"), | |
["123","132","213","231","312","321"] = joe:perms("123"), |
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 joe. | |
-export [test/0]. | |
test() -> | |
[[]] = joe:perms(""), | |
["a"] = joe:perms("a"), | |
["ab", "ba"] = joe:perms("ab"), | |
["ba", "ab"] = joe:perms("ba"), | |
["123","132","213","231","312","321"] = joe:perms("123"), |
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
defmodule MyODT do | |
@opaque t() :: %{required(:f1) => boolean, required(:f2) => atom} | |
@spec new(boolean, atom) :: t | |
def new(f1, f2), do: %{f1: f1, f2: f2} | |
@spec f1(t) :: boolean | |
def f1(%{f1: f1}), do: f1 | |
def f2(%{f2: f2}), do: f2 |
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
This is just a file. |
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
1> A = [ [1,2,3],[4,5,6]]. | |
[[1,2,3],[4,5,6]] | |
2> B = [ [a,b,c],[d,e,f]]. | |
[[a,b,c],[d,e,f]] | |
3> [lists:zip(X, Y)|| X <- A, Y <- B]. | |
[[{1,a},{2,b},{3,c}], | |
[{1,d},{2,e},{3,f}], | |
[{4,a},{5,b},{6,c}], | |
[{4,d},{5,e},{6,f}]] |
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 crazy_shorties. | |
-author(joan_manuel). | |
-export [new/0, teach/1, direct/1]. | |
new() -> | |
Child = spawn_link(fun live/0), | |
timer:send_interval(1000, Child, tick), | |
Child. |
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(in). | |
-author(john). | |
-author(paul). | |
-author(george). | |
-author(ringo). | |
-export([my_life/1]). | |
my_life(NewPlaces) -> |
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(plusplus). | |
-export([first/0, second/0, third/0]). | |
-spec first() -> 'something'. | |
first() -> [] ++ something. | |
-spec second() -> none(). | |
second() -> something ++ []. |
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(plusplus). | |
-export([first/0, second/0]). | |
first() -> [] ++ something. | |
second() -> something ++ []. |