algebra-simple-0.1: An alternative mathematical interface to Num.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.Literal.Rational

Description

Provides the FromRational typeclass.

Since: 0.1

Synopsis

Documentation

class FromRational a where Source #

Replaces base's fromRational functionality for when we do not have a Fractional instance.

5.5 :: Fractional a => a

-- becomes

afromRational 5.5 :: FromRational a => a

Note that fromRational's deficiencies are inherited e.g. Natural is partial, bounded types have over/underflow issues.

Since: 0.1

Methods

afromRational :: HasCallStack => Rational -> a Source #

Since: 0.1

Instances

Instances details
FromRational Double Source #

Since: 0.1

Instance details

Defined in Numeric.Literal.Rational

FromRational Float Source #

Since: 0.1

Instance details

Defined in Numeric.Literal.Rational

RealFloat a => FromRational (Complex a) Source #

Since: 0.1

Instance details

Defined in Numeric.Literal.Rational

FromRational (Ratio Integer) Source #

Since: 0.1

Instance details

Defined in Numeric.Literal.Rational

FromRational (Ratio Natural) Source #

WARNING: Partial

Since: 0.1

Instance details

Defined in Numeric.Literal.Rational