VK
Size: a a a
VK
DS
AH
[<SuppressMessage("*", "TypeNames")>]
type posint = private Posint of int
with
static member OfInt =
Constrain.constrain (fun (n : int) ->
if n > 0
then Success (Posint n)
else failf "Expected positive int, received %d" n)
member this.Value = let (Posint v) = this in v
// posint & int
static member (+) (Posint p1, p2 : int) = p1 + p2
static member (+) (p1 : int, Posint p2) = p1 + p2
static member (*) (Posint p1, p2 : int) = p1 * p2
static member (*) (p1 : int, Posint p2) = p1 * p2
static member (-) (Posint p1, p2 : int) = p1 - p2
static member (-) (p1 : int, Posint p2) = p1 - p2
static member (/) (Posint p1, p2 : int) = p1 / p2
static member (/) (p1 : int, Posint p2) = p1 / p2
// posint & posint
static member (+) (Posint p1, Posint p2) = Posint (p1 + p2)
static member (-) (Posint p1, Posint p2) = p1 - p2
static member (*) (Posint p1, Posint p2) = Posint (p1 * p2)
static member (/) (Posint p1, Posint p2) = Posintz (p1 / p2)
// posint & posintz
static member (+) (Posint p1, Posintz p2) = Posint (p1 + p2)
static member (-) (Posint p1, Posintz p2) = p1 - p2
static member (*) (Posint p1, Posintz p2) = Posintz (p1 * p2)
static member (/) (Posint p1, Posintz p2) = Posintz (p1 / p2)
// posint & negint
static member (+) (Posint p1, Negint p2) = p1 + p2
static member (-) (Posint p1, Negint p2) = Posint (p1 - p2)
static member (*) (Posint p1, Negint p2) = Negint (p1 * p2)
static member (/) (Posint p1, Negint p2) = Negintz (p1 / p2)
// posint & negintz
static member (+) (Posint p1, Negintz p2) = p1 + p2
static member (-) (Posint p1, Negintz p2) = Posint (p1 - p2)
static member (*) (Posint p1, Negintz p2) = Negintz (p1 * p2)
static member (/) (Posint p1, Negintz p2) = Negintz (p1 / p2)
and
[<SuppressMessage("*", "TypeNames")>]
posintz = private Posintz of int
with
static member OfInt =
Constrain.constrain (fun (n : int) ->
if n >= 0
then Success (Posintz n)
else failf "Expected non-negative int, received %d" n)
member this.Value = let (Posintz v) = this in v
// posintz & int
static member (+) (Posintz p1, p2 : int) = p1 + p2
static member (+) (p1 : int, Posintz p2) = p1 + p2
static member (*) (Posintz p1, p2 : int) = p1 * p2
static member (*) (p1 : int, Posintz p2) = p1 * p2
static member (-) (Posintz p1, p2 : int) = p1 - p2
static member (-) (p1 : int, Posintz p2) = p1 - p2
static member (/) (Posintz p1, p2 : int) = p1 / p2
static member (/) (p1 : int, Posintz p2) = p1 / p2
// posintz & posintz
static member (+) (Posintz p1, Posintz p2) = Posintz (p1 + p2)
static member (-) (Posintz p1, Posintz p2) = p1 - p2
static member (*) (Posintz p1, Posintz p2) = Posintz (p1 * p2)
static member (/) (Posintz p1, Posintz p2) = Posintz (p1 / p2)
// posintz & posint
static member (+) (Posintz p1, Posint p2) = Posint (p1 + p2)
static member (-) (Posintz p1, Posint p2) = p1 - p2
static member (*) (Posintz p1, Posint p2) = Posintz (p1 * p2)
static member (/) (Posintz p1, Posint p2) = Posintz (p1 / p2)
// posintz & negint
static member (+) (Posintz p1, Negint p2) = p1 + p2
static member (-) (Posintz p1, Negint p2) = Posint (p1 - p2)
static member (*) (Posintz p1, Negint p2) = Negintz (p1 * p2)
static member (/) (Posintz p1, Negint p2) = Negintz (p1 / p2)
DS
IC
VS
AH
VS
IC
VS
SN
IC
SN
SN
VS
IC
AH
IC
IC
SN