witchcrafters / quark

Common combinators for Elixir
https://hex.pm/packages/quark
MIT License
324 stars 15 forks source link

partial application is not working #35

Open 21it opened 4 years ago

21it commented 4 years ago

partial application is not working

Interactive Elixir (1.10.2) - press Ctrl+C to exit (typ
iex(1)> use Quark
Quark.Pointfree
iex(2)> constant(1)
** (CompileError) iex:2: undefined function constant/1
OvermindDL1 commented 4 years ago

Things like constant and first and others are arity 2 only. I'm unsure if that's intended but using Quark.SKI.k directly is partially applied.

21it commented 4 years ago

Thanks! I think without currying those combinators are pretty useless, because usually they are used in places like this (just dummy example)

some_either 
|> bimap(const(false), const(true))
OvermindDL1 commented 4 years ago

I do agree. It's a simple case of adding a few defdelegates in two different modules (both Quark and Quark.SKI), you should PR it? :-)

21it commented 4 years ago

Thanks for suggestion, but I leave this job to someone else :) I'm doing my own functional library instead 😀