B2R2


Utils Module

A set of convenient misc. functions.

Functions and values

Function or value Description

arg1 === arg1

Full Usage: arg1 === arg1

Parameters:
    arg0 : 'a
    arg1 : 'a

Returns: bool

Physical equality.

arg0 : 'a
arg1 : 'a
Returns: bool

assertByCond condition arg2

Full Usage: assertByCond condition arg2

Parameters:
    condition : bool
    arg1 : exn

Assert check condition. If not, raise an exception (exn).

condition : bool
arg1 : exn

assertEqual arg1 arg2 arg3

Full Usage: assertEqual arg1 arg2 arg3

Parameters:
    arg0 : 'a
    arg1 : 'a
    arg2 : exn

Assert two values are equal. If not, raise an exception (exn).

arg0 : 'a
arg1 : 'a
arg2 : exn

curry arg1 arg2 arg3

Full Usage: curry arg1 arg2 arg3

Parameters:
    arg0 : 'a * 'b -> 'c
    arg1 : 'a
    arg2 : 'b

Returns: 'c

Curry a pair of arguments.

arg0 : 'a * 'b -> 'c
arg1 : 'a
arg2 : 'b
Returns: 'c

futureFeature ()

Full Usage: futureFeature ()

Parameters:
    () : unit

Returns: 'a

Not implemented features encountered, so raise an exception and die.

() : unit
Returns: 'a

impossible ()

Full Usage: impossible ()

Parameters:
    () : unit

Returns: 'a

Fatal error. This should never happen.

() : unit
Returns: 'a

tap arg1 arg2

Full Usage: tap arg1 arg2

Parameters:
    arg0 : 'a -> unit
    arg1 : 'a

Returns: 'a

Apply a procedure in the middle of function pipes.

arg0 : 'a -> unit
arg1 : 'a
Returns: 'a

tripleFst arg1

Full Usage: tripleFst arg1

Parameters:
    arg0 : 'a * 'b * 'c

Returns: 'a

Return the first item of a triple.

arg0 : 'a * 'b * 'c
Returns: 'a

tripleSnd arg1

Full Usage: tripleSnd arg1

Parameters:
    arg0 : 'a * 'b * 'c

Returns: 'b

Return the second item of a triple.

arg0 : 'a * 'b * 'c
Returns: 'b

tripleThd arg1

Full Usage: tripleThd arg1

Parameters:
    arg0 : 'a * 'b * 'c

Returns: 'c

Return the third item of a triple.

arg0 : 'a * 'b * 'c
Returns: 'c

tupleToOpt (arg1, arg2)

Full Usage: tupleToOpt (arg1, arg2)

Parameters:
    arg0 : bool
    arg1 : 'a

Returns: 'a option

Convert a tuple result to an option type. The tuple result is obtained from the TryGetValue pattern, e.g., IDictionary.

arg0 : bool
arg1 : 'a
Returns: 'a option

uncurry arg1 (arg2, arg3)

Full Usage: uncurry arg1 (arg2, arg3)

Parameters:
    arg0 : 'a -> 'b -> 'c
    arg1 : 'a
    arg2 : 'b

Returns: 'c

Uncurry a pair of arguments.

arg0 : 'a -> 'b -> 'c
arg1 : 'a
arg2 : 'b
Returns: 'c