Current section

Files

Jump to
glitch src glitch@extended@function_ext.erl
Raw

src/glitch@extended@function_ext.erl

-module(glitch@extended@function_ext).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([compose/2, constant/1, ignore/1]).
-spec compose(fun((USL) -> USM), fun((USM) -> USN)) -> fun((USL) -> USN).
compose(Fun1, Fun2) ->
fun(A) -> Fun2(Fun1(A)) end.
-spec constant(USO) -> fun((any()) -> USO).
constant(Value) ->
fun(_) -> Value end.
-spec ignore(any()) -> nil.
ignore(_) ->
nil.