-
Notifications
You must be signed in to change notification settings - Fork 15
/
quark.ex
37 lines (29 loc) · 1.02 KB
/
quark.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
defmodule Quark do
@moduledoc ~S"""
Top-level module. Provides a convenient `use` macro for importing the most
commonly used functions and macros.
Due to performance reasons, many of the combinators are given non-combinatory
implementations (ie: not everything is expressed in terms `s` and `k`)
"""
defmacro __using__(_) do
quote do
import unquote(__MODULE__)
import Quark.Curry
import Quark.Partial
import Quark.Pointfree
end
end
defdelegate compose(a), to: Quark.Compose
defdelegate compose(a, b), to: Quark.Compose
defdelegate a <|> b, to: Quark.Compose
defdelegate fix(fun), to: Quark.FixedPoint
defdelegate flip(fun), to: Quark.BCKW
defdelegate constant(a, b), to: Quark.SKI
defdelegate id(a), to: Quark.SKI
defdelegate first(a, b), to: Quark.SKI
defdelegate second(a, b), to: Quark.SKI
defdelegate self_apply(a), to: Quark.M
defdelegate origin(a), to: Quark.Sequence
defdelegate succ(a), to: Quark.Sequence
defdelegate pred(a), to: Quark.Sequence
end