module Stdlib.Data.Int;
import Stdlib.Data.Int.Base open hiding {module Int; +; -; *; div; mod} public;
module Int;
open Stdlib.Data.Int.Base.Int public;
import Stdlib.Data.Int.Base open public;
import Stdlib.Data.Int.Ord open public;
end;
import Stdlib.Data.String open;
import Stdlib.Data.Bool open;
import Stdlib.Trait.Eq open;
import Stdlib.Trait.Ord open;
import Stdlib.Trait.Show open;
import Stdlib.Trait.Natural open;
import Stdlib.Trait.FromNatural open;
import Stdlib.Trait.Integral open;
import Stdlib.Trait.DivMod open;
--- Converts an ;Int; into ;String;.
builtin int-to-string
axiom intToString : Int -> String;
instance
eqIntI : Eq Int := mkEq (Int.==);
instance
ordIntI : Ord Int := mkOrd Int.compare;
instance
showIntI : Show Int := mkShow intToString;
instance
fromNaturalIntI : FromNatural Int :=
mkFromNatural@{
fromNat := ofNat;
};
instance
naturalIntI : Natural Int :=
mkNatural@{
+ := (Int.+);
* := (Int.*);
};
instance
integralIntI : Integral Int :=
mkIntegral@{
naturalI := naturalIntI;
- := (Int.-);
fromInt (x : Int) : Int := x;
};
instance
divModIntI : DivMod Int :=
mkDivMod@{
div := Int.div;
mod := Int.mod;
};