View Source
Formulae
Nifty precompiled formulae handling
Installation
def deps do
[{:formulae, "~> 0.11"}]
endUsing
iex|1 ▸ f = Formulae.compile("rem(a, 5) - b == 0")
#ℱ<[
sigil: "~F[rem(a, 5) - b == 0]",
eval: &:"Elixir.Formulae.rem(a, 5) - b == 0".eval/1,
formula: "rem(a, 5) - b == 0",
guard: nil,
module: :"Elixir.Formulae.rem(a, 5) - b == 0",
variables: [:a, :b]
]>
iex|2 ▸ f.eval.(a: 11, b: 1)
true
iex|3 ▸ f.variables
[:a, :b]
iex|4 ▸ f.module
:"Elixir.Formulae.rem(a, 5) - b == 0"Changelog
0.17.0[UPD] Allow explicit black list for what is imported fromKernelviaunimports:0.16.0[FIX] Allow formulas longer than 255 bytes (module name becomes a hash)0.14.0[UPD] Fully optionalFinitomata, configurable throughconfig :formulae, compiler: :finitomata0.13.0[UPD] Elixir v1.16, modern libs0.12.0[ENH]Formulae.Compilerto avoid compilation glitches in highly concurrent environment0.11.7make dialyzer happy with new:importsformats0.11.6improve syntax for imports with arguments, accept{:math, only: [pi: 0]}0.11.5[FIX] elixir nested aliases + [FEAT] acceptexcept:andonly:for imports0.11.4[FIX] reattempt to create module if not existing oneval/3call0.11.2[FIX] restrictapply/3,spawn/3, andimport/20.11.1[FIX]Formulae.formulas/1+ aliases are handled more naturally0.11.0v1.0.0pre-releaseoptionsin a call toFormulae.compile/2- accurate validation of module existence
- default arguments
- aliases
- imports
0.10.0InspectandString.Charsprotocols implementationFormulae.Sigils.sigil_F/2aka~F[x > y]
0.9.0options: [eval: :guard, alias: SomeModName]- fixes for modern Elixir
- optimizations in module generation
- benchmarks
0.8.0— generate combinators functions inFormulaemodule