Prefix generic interface names with "gen_"
[hope.git] / src / hope_gen_monad.erl
diff --git a/src/hope_gen_monad.erl b/src/hope_gen_monad.erl
new file mode 100644 (file)
index 0000000..9e02270
--- /dev/null
@@ -0,0 +1,16 @@
+-module(hope_gen_monad).
+
+-type t(_A) ::
+    term().
+
+-callback return(A) ->
+    t(A).
+
+-callback map(t(A), fun((A) -> (B))) ->
+    t(B).
+
+%% @doc "pipe" is equivalent to traditional "bind", in general use-case, but is
+%% arguably more useful for composition in Erlang's syntactic setting.
+%% @end
+-callback pipe([fun((A) -> t(B))], A) ->
+    t(B).
This page took 0.022487 seconds and 4 git commands to generate.