Safe Haskell | None |
---|
- newtype T m t a = Cons (Const a (m () t))
- cons :: a -> T m t a
- decons :: T m t a -> a
- relative :: (Ord a, Monoid a) => String -> a -> T m Relative a
- data Absolute = Absolute
- data Relative = Relative
- newtype Seconds = Seconds {}
- newtype Ticks = Ticks {}
- class RelativeC t
- class (Ord a, Monoid a) => Split a where
- class C m => Timed m where
- ticksFromSeconds :: Frameworks s => T m t Seconds -> m s (T m t Ticks)
- class Quantity a where
- ticksFromAny :: (Timed m, Frameworks s) => T m t a -> m s (T m t Ticks)
- consRel :: String -> Rational -> T m Relative Seconds
- inc :: Monoid a => T m Relative a -> T m t a -> T m t a
- subSat :: Split a => T m t a -> T m t a -> T m Relative a
- scale :: Double -> T m Relative Ticks -> T m Relative Ticks
- scaleCeiling :: Double -> T m Relative Ticks -> T m Relative Ticks
- scaleInt :: Integral i => i -> T m Relative Ticks -> T m Relative Ticks
- div :: T m Relative Ticks -> T m Relative Ticks -> Double
- getTicks :: Num a => T m Relative Ticks -> a
Documentation
The T
types are used instead of floating point types,
because the latter ones caused unpredictable 'negative number' errors.
There should be a common denominator to all involved numbers.
This way we can prevent unlimited growth of denominators.
class (Ord a, Monoid a) => Split a whereSource
Technically identical to NonNeg.C but without connotation of non-negativity.
class C m => Timed m whereSource
ticksFromSeconds :: Frameworks s => T m t Seconds -> m s (T m t Ticks)Source
ticksFromAny :: (Timed m, Frameworks s) => T m t a -> m s (T m t Ticks)Source