numhask: numeric classes

[ bsd3, library, math ] [ Propose Tags ]

A numeric class heirarchy.


[Skip to Readme]

Modules

[Last Documentation]

  • NumHask
    • Algebra
      • NumHask.Algebra.Abstract
        • NumHask.Algebra.Abstract.Action
        • NumHask.Algebra.Abstract.Additive
        • NumHask.Algebra.Abstract.Field
        • NumHask.Algebra.Abstract.Group
        • NumHask.Algebra.Abstract.Lattice
        • NumHask.Algebra.Abstract.Module
        • NumHask.Algebra.Abstract.Multiplicative
        • NumHask.Algebra.Abstract.Ring
    • Analysis
      • NumHask.Analysis.Metric
    • Data
      • NumHask.Data.Complex
      • NumHask.Data.Integral
      • NumHask.Data.LogField
      • NumHask.Data.Pair
      • NumHask.Data.Positive
      • NumHask.Data.Rational
      • NumHask.Data.Wrapped
    • NumHask.Exception
    • NumHask.Prelude

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4.0, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.2.3.0, 0.2.3.1, 0.3.0.0, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.6.0.1, 0.6.0.2, 0.7.0.0, 0.7.1.0, 0.8.0.0, 0.8.1.0, 0.9.0.0, 0.10.0.0, 0.10.1.0, 0.10.1.1, 0.11.0.1, 0.11.0.2, 0.11.1.0, 0.12.0.0, 0.12.0.1, 0.12.0.2
Dependencies base (>=4.7 && <5), bifunctors (>=3.2), mmorph (>=1.1), protolude (>=0.3 && <0.4), text (>=1.2), transformers (>=0.5) [details]
License BSD-3-Clause
Copyright Tony Day
Author Tony Day
Maintainer tonyday567@gmail.com
Category mathematics
Home page https://github.com/tonyday567/numhask#readme
Bug tracker https://github.com/tonyday567/numhask/issues
Source repo head: git clone https://github.com/tonyday567/numhask(numhask)
Uploaded by tonyday567 at 2020-07-16T23:43:24Z
Distributions LTSHaskell:0.11.1.0, NixOS:0.11.1.0, Stackage:0.11.1.0
Reverse Dependencies 24 direct, 6 indirect [details]
Downloads 15480 total (118 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2020-07-17 [all 3 reports]

Readme for numhask-0.6.0.1

[back to package description]

numhask

Build Status Gitter chat

A numeric class hierarchy, providing a structure for numbers and functions that combine them.

Field hierarchy

Field Hierarchy

NumHask class structure

NumHask Hierarchy

numhask begins with separately named magma-derived classes for addition and multiplication, and then being symetrical in the treatment of the two heirarchies. A short magma structure is provided with the intention of supplying appropriate classes for operators that are neither addition nor multiplication, but this structure is not hooked up to the main classes.

To be as compatible as practical with the existing haskell ecosystem. Ints, Integers, Floats, Doubles and Complex are taken from base and given numhask class instances, so they are also Num instances. Monoid and Semigroup are not used in numhask to maintain compatability.

numhask replaces all the relevant numeric operators in Prelude, so you're going to get clashes.

QuickCheck tests of numeric laws are included. This also includes tracking where laws are approximate or fail for non-exact numbers.

The usual operators (+) and (*) operators are reserved for commutative relationships, with plus and times being used for non-commutative ones.

In summary, the library doesn't do anything fancy. But if having to define (*) when you just want a (+) offends your sensibilities, it may bring some sanity.

NumHask.Prelude

{-# LANGUAGE NoImplicitPrelude #-}
import NumHask.Prelude

'Numhask.Prelude' is designed as a drop-in replacement for Prelude and 'NoImplicitPrelude' is obligatory. Behind the scenes, the module wraps protolude.