Copyright | (c) 2018-2021 Iris Ward |
---|---|
License | BSD3 |
Maintainer | aditu.venyhandottir@gmail.com |
Stability | experimental |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Type level rational numbers expressed as a ratio between a type-level integer
and a type-level natural. For example
.Neg
3 :% 2
See also: Data.TypeInts
Construction
Type constructor for a rational
Linking type and value level
This class gives the (value-level) rational associated with a type-level rational. There are instances of this class for every combination of a concrete integer and concrete natural.
ratSing
Instances
KnownInt n => KnownRat (n :: k) Source # | |
Defined in Data.TypeNums.Rats ratSing :: SRat n | |
(KnownInt n, KnownNat d, d /= 0) => KnownRat (n :% d :: Rat) Source # | |
Defined in Data.TypeNums.Rats | |
(TypeError ('Text "Denominator must not equal 0") :: Constraint) => KnownRat (n :% 0 :: Rat) Source # | |
Defined in Data.TypeNums.Rats |
ratVal :: forall proxy r. KnownRat r => proxy r -> Rational Source #
Get the value associated with a type-level rational
This type represents unknown type-level integers.
Since: 0.1.1
someRatVal :: Rational -> SomeRat Source #
Convert a rational into an unknown type-level rational.
Since: 0.1.1