【文件属性】:
文件名称:elixir-curry:Elixir的一个简单的currying宏
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-20 01:13:32
Elixir
咖喱
如何
Curry允许您定义咖喱函数:
defmodule Curry . Example do
# 1. Use the Curry module
use Curry
# 2. use 'curry' instead of 'def' to define functions
curry add (a,b), do: a + b
# also, use 'curryp' instead of 'defp'
curryp secret (replaced, by, sentence) do
sentence |> String . replace (replaced, by)
end
def test do
# 3. The first call is not 'dotted'
increment = add ( 1 )
【文件预览】:
elixir-curry-master
----mix.exs(478B)
----priv()
--------Example.ex(511B)
----test()
--------curry_test.exs(334B)
--------test_helper.exs(15B)
----LICENSE(1KB)
----.gitignore(34B)
----lib()
--------curry.ex(1KB)
----README.md(2KB)