This file contains 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
import java.util.List; | |
class SumType { | |
public static void main(String[] args) { | |
Status p = new Pending("outstanding"); | |
Status c = new Completed("123"); | |
Status e = new Errored("io_exception"); | |
List.of(p, c, e) | |
.stream() | |
.peek(a -> { |
This file contains 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(test). | |
-include_lib("eunit/include/eunit.hrl"). | |
succeed_test() -> | |
ct:print("Hi"), | |
io:format(user, "Hi", []), | |
ok. |
This file contains 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
T = ets:new(t, [set]). | |
ets:insert(T, {c, 0}), | |
ets:update_counter(T, c, [{2,1}]), | |
ets:lookup(T, c). |