Popularity
2.2
Stable
Activity
7.7
Declining
0
2
0

Monthly Downloads: 46
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Numeric    
Latest version: v0.1.0.0

hafar alternatives and similar packages

Based on the "Numeric" category

Do you think we are missing an alternative of hafar or a related project?

Add another 'Numeric' Package

README

Hafar

Hafar is an implementation of affine arithmetic in haskell.

Building

To build the library, simply run

# stack build

or if using cabal

# cabal install --only-dependencies
# cabal build

Example

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