Code Monkey home page Code Monkey logo

formulae's Introduction

Formulae    Kantox ❤ OSS  Test  Dialyzer

Nifty precompiled formulae handling

Installation

def deps do
  [{:formulae, "~> 0.11"}]
end

Using

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.14.0 [UPD] Fully optional Finitomata, configurable through config :formulae, compiler: :finitomata
  • 0.13.0 [UPD] Elixir v1.16, modern libs
  • 0.12.0 [ENH] Formulae.Compiler to avoid compilation glitches in highly concurrent environment
  • 0.11.7 make dialyzer happy with new :imports formats
  • 0.11.6 improve syntax for imports with arguments, accept {:math, only: [pi: 0]}
  • 0.11.5 [FIX] elixir nested aliases + [FEAT] accept except: and only: for imports
  • 0.11.4 [FIX] reattempt to create module if not existing on eval/3 call
  • 0.11.2 [FIX] restrict apply/3, spawn/3, and import/2
  • 0.11.1 [FIX] Formulae.formulas/1 + aliases are handled more naturally
  • 0.11.0 v1.0.0 pre-release
    • options in a call to Formulae.compile/2
    • accurate validation of module existence
    • default arguments
    • aliases
    • imports
  • 0.10.0
    • Inspect and String.Chars protocols implementation
    • Formulae.Sigils.sigil_F/2 aka ~F[x > y]
  • 0.9.0
    • options: [eval: :guard, alias: SomeModName]
    • fixes for modern Elixir
    • optimizations in module generation
    • benchmarks
  • 0.8.0 — generate combinators functions in Formulae module

formulae's People

Contributors

am-kantox avatar

Stargazers

Henricus Louwhoff avatar Thaddeus avatar  avatar Andrey Shevkalyuk avatar Dimitar Panayotov avatar Medson Oliveira avatar Austin Ziegler avatar Steve avatar Martin Karrer avatar Sam Gaw avatar Shozo Fukuda avatar AdamT avatar  avatar Ben Smith avatar  avatar

Watchers

James Cloos avatar Kiyo avatar  avatar  avatar

Forkers

madatsci

formulae's Issues

Would using atoms as variable bindings cause an issue in memory?

Hello there,

I am thinking of using this package in my project which allow user to enter the formula on their own. This includes using the user's naming of the variable. Given that the variable bindings is in atom, and atom is not garbage collected, would this cause a memory leak issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.