Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- castNFixedToFixed :: (NFixed p ': s) :-> (Fixed p ': s)
- castFixedToNFixed :: (Fixed p ': s) :-> (Maybe (NFixed p) ': s)
- unsafeCastFixedToNFixed :: (Fixed p ': s) :-> (NFixed p ': s)
- class LorentzFixedCast a where
- newtype Fixed (a :: k) = MkFixed Integer
- newtype NFixed p = MkNFixed Natural
- data DecBase p where
- data BinBase p where
- resolution_ :: forall a. HasResolution a => Natural
Lorentz instructions
Typeclasses
class LorentzFixedCast a where Source #
Class that allows casting Fixed
values to Integer in vice versa
Instances
KnownNat a => LorentzFixedCast (Fixed (BinBase a)) Source # | |
KnownNat a => LorentzFixedCast (Fixed (DecBase a)) Source # | |
LorentzFixedCast (Fixed a) => LorentzFixedCast (NFixed a) Source # | |
The type parameter should be an instance of HasResolution
.
Instances
r ~ Fixed p => ArithOpHs Add Integer (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Add Natural (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Mul Integer (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Mul Natural (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Sub Integer (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Sub Natural (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
UnaryArithOpHs Neg (Fixed p) Source # | |
Defined in Lorentz.CustomArith.FixedArith type UnaryArithResHs Neg (Fixed p) Source # evalUnaryArithOpHs :: forall (s :: [Type]). (Fixed p ': s) :-> (UnaryArithResHs Neg (Fixed p) ': s) Source # | |
r ~ Fixed p => ArithOpHs Add (Fixed p) Integer r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Add (Fixed p) Natural r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
(r ~ Maybe (Integer, NFixed (BinBase a)), KnownNat a) => ArithOpHs EDiv (Fixed (BinBase a)) Integer r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
(r ~ Maybe (Integer, NFixed (BinBase a)), KnownNat a) => ArithOpHs EDiv (Fixed (BinBase a)) Natural r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
(r ~ Maybe (Integer, NFixed (DecBase a)), KnownNat a) => ArithOpHs EDiv (Fixed (DecBase a)) Integer r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
(r ~ Maybe (Integer, NFixed (DecBase a)), KnownNat a) => ArithOpHs EDiv (Fixed (DecBase a)) Natural r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Mul (Fixed p) Integer r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Mul (Fixed p) Natural r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Sub (Fixed p) Integer r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Sub (Fixed p) Natural r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Add (Fixed p) (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Add (Fixed p) (NFixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Add (NFixed p) (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Sub (Fixed p) (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Sub (Fixed p) (NFixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
r ~ Fixed p => ArithOpHs Sub (NFixed p) (Fixed p) r Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
(KnownNat a, KnownNat b, KnownNat r) => ArithOpHs Div (Fixed (BinBase a)) (Fixed (BinBase b)) (Maybe (Fixed (BinBase r))) Source # | |
(KnownNat a, KnownNat b, KnownNat r) => ArithOpHs Div (Fixed (DecBase a)) (Fixed (DecBase b)) (Maybe (Fixed (DecBase r))) Source # | |
r ~ (a + b) => ArithOpHs Mul (Fixed (BinBase a)) (Fixed (BinBase b)) (Fixed (BinBase r)) Source # | |
r ~ (a + b) => ArithOpHs Mul (Fixed (BinBase a)) (NFixed (BinBase b)) (Fixed (BinBase r)) Source # | |
r ~ (a + b) => ArithOpHs Mul (Fixed (DecBase a)) (Fixed (DecBase b)) (Fixed (DecBase r)) Source # | |
r ~ (a + b) => ArithOpHs Mul (Fixed (DecBase a)) (NFixed (DecBase b)) (Fixed (DecBase r)) Source # | |
r ~ (a + b) => ArithOpHs Mul (NFixed (BinBase a)) (Fixed (BinBase b)) (Fixed (BinBase r)) Source # | |
r ~ (a + b) => ArithOpHs Mul (NFixed (DecBase a)) (Fixed (DecBase b)) (Fixed (DecBase r)) Source # | |
NFData1 (Fixed :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
Hashable1 (Fixed :: Type -> Type) | |
Defined in Data.Hashable.Class | |
HasResolution a => ToJSON (Fixed a) | |
Defined in Data.Aeson.Types.ToJSON | |
HasResolution a => ToJSONKey (Fixed a) | |
Defined in Data.Aeson.Types.ToJSON toJSONKey :: ToJSONKeyFunction (Fixed a) # toJSONKeyList :: ToJSONKeyFunction [Fixed a] # | |
(Typeable k, Typeable a) => Data (Fixed a) | Since: base-4.1.0.0 |
Defined in Data.Fixed gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixed a -> c (Fixed a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Fixed a) # toConstr :: Fixed a -> Constr # dataTypeOf :: Fixed a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Fixed a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Fixed a)) # gmapT :: (forall b. Data b => b -> b) -> Fixed a -> Fixed a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixed a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixed a -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixed a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixed a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixed a -> m (Fixed a) # | |
Enum (Fixed a) | Recall that, for numeric types, succ (0.000 :: Milli) == 1.001 and likewise pred (0.000 :: Milli) == -0.001 In other words, succ (0.000000000000 :: Pico) == 0.000000000001 and similarly pred (0.000000000000 :: Pico) == -0.000000000001 This is worth bearing in mind when defining [1..10] :: [Pico] evaluates to However, this is not true. On the contrary, similarly to the above
implementations of [1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000] and contains Since: base-2.1 |
HasResolution a => Num (Fixed a) | Since: base-2.1 |
HasResolution a => Read (Fixed a) | Since: base-4.3.0.0 |
HasResolution a => Fractional (Fixed a) | Since: base-2.1 |
HasResolution a => Real (Fixed a) | Since: base-2.1 |
Defined in Data.Fixed toRational :: Fixed a -> Rational # | |
HasResolution a => RealFrac (Fixed a) | Since: base-2.1 |
HasResolution a => Show (Fixed a) | Since: base-2.1 |
NFData (Fixed a) | Since: deepseq-1.3.0.0 |
Defined in Control.DeepSeq | |
HasResolution a => Buildable (Fixed a) | |
Defined in Formatting.Buildable | |
Eq (Fixed a) | Since: base-2.1 |
Ord (Fixed a) | Since: base-2.1 |
Hashable (Fixed a) | |
Defined in Data.Hashable.Class | |
KnownNat a => LorentzFixedCast (Fixed (BinBase a)) Source # | |
KnownNat a => LorentzFixedCast (Fixed (DecBase a)) Source # | |
Unwrappable (Fixed a) Source # | |
Defined in Lorentz.Wrappable type Unwrappabled (Fixed a) Source # | |
IsoValue (Fixed p) | |
HasResolution a => Ring (Fixed a) | |
Defined in Data.Semiring | |
HasResolution a => Semiring (Fixed a) | |
(KnownNat a, KnownNat b) => LorentzRounding (Fixed (BinBase a)) (Fixed (BinBase b)) Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
(KnownNat a, KnownNat b) => LorentzRounding (Fixed (DecBase a)) (Fixed (DecBase b)) Source # | Round is implemented using "banker's rounding" strategy, rounding half-way values towards nearest even value |
Defined in Lorentz.CustomArith.FixedArith | |
type UnaryArithResHs Neg (Fixed p) Source # | |
Defined in Lorentz.CustomArith.FixedArith | |
type Unwrappabled (Fixed a) Source # | |
Defined in Lorentz.Wrappable | |
type ToT (Fixed p) | |
Defined in Morley.Michelson.Typed.Haskell.Value | |
type PrettyShow (Fixed _1) | |
Defined in Morley.Prelude.Show type PrettyShow (Fixed _1) = () |
Like Fixed
but with a Natural
value inside constructor
Instances
Support types and functions
Datatypes, representing base of the fixed-point values
Instances
Instances
resolution_ :: forall a. HasResolution a => Natural Source #
Special function to get resolution without argument