@hackage yap0.2
yet another prelude - a simplistic refactoring with algebraic classes
Categories
License
BSD-3-Clause
Maintainer
Ross Paterson <ross@soi.city.ac.uk>
Links
- Documentation
- No source repository
- Security
Versions
Installation
Dependencies (1)
Dependents (2)
@hackage/acme-everything, @hackage/knots
A simple refactoring of the Prelude numeric classes, attempting backwards compatibility for clients by defining a few algebraic classes as superclasses of the Haskell 98 numeric classes. This yields the following class hierarchy (grey classes are unchanged):
Prelude.YAP
is an almost-compatible replacement
for the standard Haskell Prelude, as long as you're
not defining instances of the numeric classes
(though defaulting will be affected).
When importing it, turn on RebindableSyntax
.
Data.YAP.Algebra
contains just the new classes;
you'll need to import it if you want access to the
new names, including to define instances.
Other modules contain some example instances, including
for the existing types Complex
and Ratio
.
History:
0.0: initial version
0.1: moved
fromRational
back toFractional
, as it isn't well-behaved for all fields. RemovedrealToField
.0.2: removed
Eq
andShow
constraints fromNum
, followingbase-4.5
.