lue-bird/elm-morph/1.1.0

NOTE: the latest version is 3.0.1

Integer

Arbitrary-precision whole number. See also Integer.Morph

type Integer
= N0
| Signed Signed

Arbitrary-precision integer, constructable from bits

type alias Signed =
RecordWithoutConstructorFunction
{ sign : Sign
, absolute : AtLeast1
}

Arbitrary-precision signed Integer, constructable from a Sign and Natural.AtLeast1 bits

create

fromInt : Int -> Integer

Convert from an Int

alter

Remove its Sign

Flip its Sign

transform

toInt : Integer -> Int

Convert to an Int

Keep in mind that this can overflow since Int is fixed in bit size while Integer is not.

The type is rarely useful in its current state, as the only thing you can do is convert from and to other types.

This is enough for my use-cases but feel free to PR or open an issue if you'd like to see support for arbitrary-precision arithmetic like addition, multiplication, ...