hafar alternatives and similar packages
Based on the "Numeric" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of hafar or a related project?
Hafar is an implementation of affine arithmetic in haskell.
To build the library, simply run
# stack build
or if using cabal
# cabal install --only-dependencies # cabal build
All operations with affine forms must be done inside the AFM monad.
import Numeric.Interval hiding (interval) x1 = do a <- newFromInterval $ 4...6 b <- newFromInterval $ 4...6 return . interval $ a - b evalAFM x1 -- evaluates to approximately -2 ... 2 x2 = do a <- newFromInterval $ 4...6 return . interval $ a - a evalAFM x2 -- evaluates to approximately 0 ... 0