Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cjen07/prefix

the world is your playground, ∀ Q, ∃h, ∀ f, g ∈ Q, s.t h(f, g) "then" f ≡ g + f
https://github.com/cjen07/prefix

Last synced: 10 days ago
JSON representation

the world is your playground, ∀ Q, ∃h, ∀ f, g ∈ Q, s.t h(f, g) "then" f ≡ g + f

Awesome Lists containing this project

README

        

# Prefix

## "add" g to f

```elixir
defmodule Q do

def i() do
:ok
end

def f() do
IO.puts "world"
end

def g() do
IO.puts "hello"
end

def f(a) do
IO.puts a
end

def ff() do
f()
f()
end

end
```

```elixir
iex -S mix
Q.f
# => world
# => :ok
Q.f "cjen07"
# => cjen07
# => :ok
Q.ff
# => world
# => world
# => :ok
Z.h :f, :g
# => :ok
Q.f
# => hello
# => world
# => :ok
Q.f "cjen07"
# => hello
# => cjen07
# => :ok
Q.ff
# => hello
# => world
# => hello
# => world
# => :ok
Z.h :f, :i
# => :ok
Q.f
# => world
# => :ok
Q.f "cjen07"
# => cjen07
# => :ok
Q.ff
# => world
# => world
# => :ok
```

## remark

* Z.h: without code change, reversible

* Z.i: with code change, irreversible