Packages

A porting of some parts of fp-ts to Gleam

Current section

Files

Jump to
fp2 src fp2@flist.erl
Raw

src/fp2@flist.erl

-module(fp2@flist).
-compile(no_auto_import).
-export([get_eq/1, sort/1]).
-spec get_eq(fp2@eq:eq(EXM)) -> fp2@eq:eq(list(EXM)).
get_eq(E) ->
{eq,
fun(X, Y) ->
(gleam@list:length(X)
=:= gleam@list:length(Y))
andalso begin
_pipe = gleam@list:zip(X, Y),
gleam@list:all(
_pipe,
fun(T) ->
{X@1, Y@1} = T,
(erlang:element(2, E))(X@1, Y@1)
end
)
end
end}.
-spec sort(fp2@models:ord(EXQ)) -> fun((list(EXQ)) -> list(EXQ)).
sort(O) ->
fun(Lst) ->
_pipe = Lst,
gleam@list:sort(_pipe, erlang:element(2, O))
end.