Popularity
4.8
Declining
Activity
0.0
Stable
6
5
0

Monthly Downloads: 11
Programming language: Haskell
License: BSD 2-clause "Simplified" License
Tags: Math    
Latest version: v0.2.1

ms alternatives and similar packages

Based on the "Math" category.
Alternatively, view ms alternatives based on common mentions on social networks and blogs.

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

Add another 'Math' Package

README

ms - metric spaces

Build Status

A metric space is a set together with some notion of distance function which obeys four laws. See the haddock for more information.

We implement these not using a typeclass, but using a simple datatype. This avoids needing to create newtypes for every metric implementation over a given type, meaning that we gain more code re-use and an easier-to-use API.

WARNING: The triangle-inequality law does not necessarily hold in the presence of Floating a => a, which we use. This is because Double and Float both don't have arbitrary precision. However, some of our metrics, such as that of euclidean distance, require the use of the sqrt function, which requires a Floating constraint.

Usage

dist levenshtein "foo" "bar"   -- => 3.0
dist euclidean (V.fromList [3,2]) (V.fromList [2,3])  -- => 1.4142135623730951

License

[BSD-2](LICENSE).


*Note that all licence references and agreements mentioned in the ms README section above are relevant to that project's source code only.