FSharpx.Extras


Prelude Module

Functions and values

Function or value Description

!>x

Full Usage: !>x

Parameters:
    x : ^a

Returns: ^b
Modifiers: inline
Type parameters: ^a, ^b

Performs an implicit conversion using op_Implicit

x : ^a
Returns: ^b

(^)

Full Usage: (^)

Returns: ('a -> 'b) -> 'a -> 'b

Sequencing operator like Haskell's ($). Has better precedence than (<|) due to the first character used in the symbol.

Returns: ('a -> 'b) -> 'a -> 'b

x |>! fn

Full Usage: x |>! fn

Parameters:
    x : 'a
    fn : 'a -> 'b

Returns: 'a
Modifiers: inline

Custom operator for `tee`: Given a value, apply a function to it, ignore the result, then return the original value.

x : 'a
fn : 'a -> 'b
Returns: 'a

curry f a b

Full Usage: curry f a b

Parameters:
    f : 'd * 'e -> 'f
    a : 'd
    b : 'e

Returns: 'f
Modifiers: inline
Type parameters: 'd, 'e, 'f

Transforms an uncurried function to a curried function.

f : 'd * 'e -> 'f
a : 'd
b : 'e
Returns: 'f

curry3 f a b c

Full Usage: curry3 f a b c

Parameters:
    f : 'a * 'b * 'c -> 'd
    a : 'a
    b : 'b
    c : 'c

Returns: 'd
Modifiers: inline

Transforms an uncurried function to a triple-curried function.

f : 'a * 'b * 'c -> 'd
a : 'a
b : 'b
c : 'c
Returns: 'd

fix f x

Full Usage: fix f x

Parameters:
    f : ('d -> 'e) -> 'd -> 'e
    x : 'd

Returns: 'e

Fixed point combinator.

f : ('d -> 'e) -> 'd -> 'e
x : 'd
Returns: 'e

fix2 f x y

Full Usage: fix2 f x y

Parameters:
    f : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c
    x : 'a
    y : 'b

Returns: 'c

Fixed point combinator.

f : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c
x : 'a
y : 'b
Returns: 'c

fix3 f x y z

Full Usage: fix3 f x y z

Parameters:
    f : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd
    x : 'a
    y : 'b
    z : 'c

Returns: 'd

Fixed point combinator.

f : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd
x : 'a
y : 'b
z : 'c
Returns: 'd

flip f a b

Full Usage: flip f a b

Parameters:
    f : 'd -> 'e -> 'f
    a : 'e
    b : 'd

Returns: 'f
Modifiers: inline
Type parameters: 'd, 'e, 'f

Transforms a function by flipping the order of its arguments.

f : 'd -> 'e -> 'f
a : 'e
b : 'd
Returns: 'f

flip3 f a b c

Full Usage: flip3 f a b c

Parameters:
    f : 'a -> 'b -> 'c -> 'd
    a : 'b
    b : 'c
    c : 'a

Returns: 'd
Modifiers: inline

Transforms a function by flipping the order of its arguments.

f : 'a -> 'b -> 'c -> 'd
a : 'b
b : 'c
c : 'a
Returns: 'd

flip4 f a b c d

Full Usage: flip4 f a b c d

Parameters:
    f : 'a -> 'b -> 'c -> 'd -> 'e
    a : 'b
    b : 'c
    c : 'd
    d : 'a

Returns: 'e
Modifiers: inline

Transforms a function by flipping the order of its arguments.

f : 'a -> 'b -> 'c -> 'd -> 'e
a : 'b
b : 'c
c : 'd
d : 'a
Returns: 'e

konst a arg2

Full Usage: konst a arg2

Parameters:
    a : 'a
    arg1 : 'b

Returns: 'a
Modifiers: inline

Given a value, creates a function with one ignored argument which returns the value.

a : 'a
arg1 : 'b
Returns: 'a

konst2 a arg2 arg3

Full Usage: konst2 a arg2 arg3

Parameters:
    a : 'a
    arg1 : 'b
    arg2 : 'c

Returns: 'a
Modifiers: inline

Given a value, creates a function with two ignored arguments which returns the value.

a : 'a
arg1 : 'b
arg2 : 'c
Returns: 'a

reraise' e

Full Usage: reraise' e

Parameters:
    e : exn

Returns: 'T

Rethrows an exception. This can be used even outside of try-with block. The exception object (stacktrace, etc) is not changed.

e : exn
Returns: 'T

reraiseWith f e

Full Usage: reraiseWith f e

Parameters:
    f : exn -> unit
    e : exn

Returns: 'T

Rethrows an exception, but bebore that applies a function on it. This can be used even outside of try-with block. The exception object (stacktrace, etc) is not changed.

f : exn -> unit
e : exn
Returns: 'T

swap (a, b)

Full Usage: swap (a, b)

Parameters:
    a : 'a
    b : 'b

Returns: 'b * 'a
Modifiers: inline

Swap the elements of a pair.

a : 'a
b : 'b
Returns: 'b * 'a

tee fn x

Full Usage: tee fn x

Parameters:
    fn : 'a -> 'b
    x : 'a

Returns: 'a
Modifiers: inline

Given a value, apply a function to it, ignore the result, then return the original value.

fn : 'a -> 'b
x : 'a
Returns: 'a

toOption (arg1, arg2)

Full Usage: toOption (arg1, arg2)

Parameters:
    arg0 : bool
    arg1 : 'a

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

tryWith f x

Full Usage: tryWith f x

Parameters:
    f : 'a -> bool * 'b
    x : 'a

Returns: 'b option
Modifiers: inline
f : 'a -> bool * 'b
x : 'a
Returns: 'b option

tuple2 a b

Full Usage: tuple2 a b

Parameters:
    a : 'a
    b : 'b

Returns: 'a * 'b
Modifiers: inline

Creates a pair

a : 'a
b : 'b
Returns: 'a * 'b

tuple3 a b c

Full Usage: tuple3 a b c

Parameters:
    a : 'a
    b : 'b
    c : 'c

Returns: 'a * 'b * 'c
Modifiers: inline

Creates a 3-tuple

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

tuple4 a b c d

Full Usage: tuple4 a b c d

Parameters:
    a : 'a
    b : 'b
    c : 'c
    d : 'd

Returns: 'a * 'b * 'c * 'd
Modifiers: inline

Creates a 4-tuple

a : 'a
b : 'b
c : 'c
d : 'd
Returns: 'a * 'b * 'c * 'd

tuple5 a b c d e

Full Usage: tuple5 a b c d e

Parameters:
    a : 'a
    b : 'b
    c : 'c
    d : 'd
    e : 'e

Returns: 'a * 'b * 'c * 'd * 'e
Modifiers: inline

Creates a 5-tuple

a : 'a
b : 'b
c : 'c
d : 'd
e : 'e
Returns: 'a * 'b * 'c * 'd * 'e

tuple6 a b c d e f

Full Usage: tuple6 a b c d e f

Parameters:
    a : 'a
    b : 'b
    c : 'c
    d : 'd
    e : 'e
    f : 'f

Returns: 'a * 'b * 'c * 'd * 'e * 'f
Modifiers: inline

Creates a 6-tuple

a : 'a
b : 'b
c : 'c
d : 'd
e : 'e
f : 'f
Returns: 'a * 'b * 'c * 'd * 'e * 'f

uncurry f (a, b)

Full Usage: uncurry f (a, b)

Parameters:
    f : 'a -> 'b -> 'c
    a : 'a
    b : 'b

Returns: 'c
Modifiers: inline

Transforms an uncurried function to a curried function.

f : 'a -> 'b -> 'c
a : 'a
b : 'b
Returns: 'c

uncurry3 f (a, b, c)

Full Usage: uncurry3 f (a, b, c)

Parameters:
    f : 'a -> 'b -> 'c -> 'd
    a : 'a
    b : 'b
    c : 'c

Returns: 'd
Modifiers: inline

Transforms an uncurried function to a triple-curried function.

f : 'a -> 'b -> 'c -> 'd
a : 'a
b : 'b
c : 'c
Returns: 'd

undefined

Full Usage: undefined

Returns: 'T

Bottom value

Returns: 'T

Type extensions

Type extension Description

Boolean.parse ()

Full Usage: Boolean.parse ()

Parameters:
    () : unit

Returns: string -> bool option

Extended Type: Boolean

() : unit
Returns: string -> bool option

Boolean.parse

Full Usage: Boolean.parse

Returns: string -> bool option

Extended Type: Boolean

Returns: string -> bool option

Byte.parse x

Full Usage: Byte.parse x

Parameters:
    x : string

Returns: byte option

Extended Type: Byte

x : string
Returns: byte option

SByte.parse x

Full Usage: SByte.parse x

Parameters:
    x : string

Returns: sbyte option

Extended Type: SByte

x : string
Returns: sbyte option

UInt16.parse x

Full Usage: UInt16.parse x

Parameters:
    x : string

Returns: uint16 option

Extended Type: UInt16

x : string
Returns: uint16 option

Int16.parse x

Full Usage: Int16.parse x

Parameters:
    x : string

Returns: int16 option

Extended Type: Int16

x : string
Returns: int16 option

UInt32.parse x

Full Usage: UInt32.parse x

Parameters:
    x : string

Returns: uint32 option

Extended Type: UInt32

x : string
Returns: uint32 option

Int32.parse x

Full Usage: Int32.parse x

Parameters:
    x : string

Returns: int option

Extended Type: Int32

x : string
Returns: int option

UInt64.parse x

Full Usage: UInt64.parse x

Parameters:
    x : string

Returns: uint64 option

Extended Type: UInt64

x : string
Returns: uint64 option

Int64.parse x

Full Usage: Int64.parse x

Parameters:
    x : string

Returns: int64 option

Extended Type: Int64

x : string
Returns: int64 option

Decimal.parse x

Full Usage: Decimal.parse x

Parameters:
    x : string

Returns: decimal option

Extended Type: Decimal

x : string
Returns: decimal option

Single.parse x

Full Usage: Single.parse x

Parameters:
    x : string

Returns: float32 option

Extended Type: Single

x : string
Returns: float32 option

Double.parse x

Full Usage: Double.parse x

Parameters:
    x : string

Returns: float option

Extended Type: Double

x : string
Returns: float option

DateTime.parse x

Full Usage: DateTime.parse x

Parameters:
    x : string

Returns: DateTime option

Extended Type: DateTime

x : string
Returns: DateTime option

DateTimeOffset.parse x

Full Usage: DateTimeOffset.parse x

Parameters:
    x : string

Returns: DateTimeOffset option

Extended Type: DateTimeOffset

x : string
Returns: DateTimeOffset option

DateTime.parseExact formats x

Full Usage: DateTime.parseExact formats x

Parameters:
    formats : string[]
    x : string

Returns: DateTime option

Extended Type: DateTime

formats : string[]
x : string
Returns: DateTime option

DateTimeOffset.parseExact formats x

Full Usage: DateTimeOffset.parseExact formats x

Parameters:
    formats : string[]
    x : string

Returns: DateTimeOffset option

Extended Type: DateTimeOffset

formats : string[]
x : string
Returns: DateTimeOffset option

DateTime.parseExactWithOptions style provider formats x

Full Usage: DateTime.parseExactWithOptions style provider formats x

Parameters:
Returns: DateTime option

Extended Type: DateTime

style : DateTimeStyles
provider : IFormatProvider
formats : string[]
x : string
Returns: DateTime option

DateTimeOffset.parseExactWithOptions style provider formats x

Full Usage: DateTimeOffset.parseExactWithOptions style provider formats x

Parameters:
Returns: DateTimeOffset option

Extended Type: DateTimeOffset

style : DateTimeStyles
provider : IFormatProvider
formats : string[]
x : string
Returns: DateTimeOffset option

Byte.parseWithOptions style provider x

Full Usage: Byte.parseWithOptions style provider x

Parameters:
Returns: byte option

Extended Type: Byte

style : NumberStyles
provider : IFormatProvider
x : string
Returns: byte option

SByte.parseWithOptions style provider x

Full Usage: SByte.parseWithOptions style provider x

Parameters:
Returns: sbyte option

Extended Type: SByte

style : NumberStyles
provider : IFormatProvider
x : string
Returns: sbyte option

UInt16.parseWithOptions style provider x

Full Usage: UInt16.parseWithOptions style provider x

Parameters:
Returns: uint16 option

Extended Type: UInt16

style : NumberStyles
provider : IFormatProvider
x : string
Returns: uint16 option

Int16.parseWithOptions style provider x

Full Usage: Int16.parseWithOptions style provider x

Parameters:
Returns: int16 option

Extended Type: Int16

style : NumberStyles
provider : IFormatProvider
x : string
Returns: int16 option

UInt32.parseWithOptions style provider x

Full Usage: UInt32.parseWithOptions style provider x

Parameters:
Returns: uint32 option

Extended Type: UInt32

style : NumberStyles
provider : IFormatProvider
x : string
Returns: uint32 option

Int32.parseWithOptions style provider x

Full Usage: Int32.parseWithOptions style provider x

Parameters:
Returns: int option

Extended Type: Int32

style : NumberStyles
provider : IFormatProvider
x : string
Returns: int option

UInt64.parseWithOptions style provider x

Full Usage: UInt64.parseWithOptions style provider x

Parameters:
Returns: uint64 option

Extended Type: UInt64

style : NumberStyles
provider : IFormatProvider
x : string
Returns: uint64 option

Int64.parseWithOptions style provider x

Full Usage: Int64.parseWithOptions style provider x

Parameters:
Returns: int64 option

Extended Type: Int64

style : NumberStyles
provider : IFormatProvider
x : string
Returns: int64 option

Decimal.parseWithOptions style provider x

Full Usage: Decimal.parseWithOptions style provider x

Parameters:
Returns: decimal option

Extended Type: Decimal

style : NumberStyles
provider : IFormatProvider
x : string
Returns: decimal option

Single.parseWithOptions style provider x

Full Usage: Single.parseWithOptions style provider x

Parameters:
Returns: float32 option

Extended Type: Single

style : NumberStyles
provider : IFormatProvider
x : string
Returns: float32 option

Double.parseWithOptions style provider x

Full Usage: Double.parseWithOptions style provider x

Parameters:
Returns: float option

Extended Type: Double

style : NumberStyles
provider : IFormatProvider
x : string
Returns: float option

DateTime.parseWithOptions style provider x

Full Usage: DateTime.parseWithOptions style provider x

Parameters:
Returns: DateTime option

Extended Type: DateTime

style : DateTimeStyles
provider : IFormatProvider
x : string
Returns: DateTime option

DateTimeOffset.parseWithOptions style provider x

Full Usage: DateTimeOffset.parseWithOptions style provider x

Parameters:
Returns: DateTimeOffset option

Extended Type: DateTimeOffset

style : DateTimeStyles
provider : IFormatProvider
x : string
Returns: DateTimeOffset option

Active patterns

Active pattern Description

(|Boolean|_|)

Full Usage: (|Boolean|_|)

Returns: string -> bool option
Returns: string -> bool option

(|Byte|_|) arg00

Full Usage: (|Byte|_|) arg00

Parameters:
    arg00 : string

Returns: byte option
arg00 : string
Returns: byte option

(|DateTimeOffset|_|) arg00

Full Usage: (|DateTimeOffset|_|) arg00

Parameters:
    arg00 : string

Returns: DateTimeOffset option
arg00 : string
Returns: DateTimeOffset option

(|DateTime|_|) arg00

Full Usage: (|DateTime|_|) arg00

Parameters:
    arg00 : string

Returns: DateTime option
arg00 : string
Returns: DateTime option

(|Decimal|_|) arg00

Full Usage: (|Decimal|_|) arg00

Parameters:
    arg00 : string

Returns: decimal option
arg00 : string
Returns: decimal option

(|Double|_|) arg00

Full Usage: (|Double|_|) arg00

Parameters:
    arg00 : string

Returns: float option
arg00 : string
Returns: float option

(|Int16|_|) arg00

Full Usage: (|Int16|_|) arg00

Parameters:
    arg00 : string

Returns: int16 option
arg00 : string
Returns: int16 option

(|Int32|_|) arg00

Full Usage: (|Int32|_|) arg00

Parameters:
    arg00 : string

Returns: int option
arg00 : string
Returns: int option

(|Int64|_|) arg00

Full Usage: (|Int64|_|) arg00

Parameters:
    arg00 : string

Returns: int64 option
arg00 : string
Returns: int64 option

(|SByte|_|) arg00

Full Usage: (|SByte|_|) arg00

Parameters:
    arg00 : string

Returns: sbyte option
arg00 : string
Returns: sbyte option

(|Single|_|) arg00

Full Usage: (|Single|_|) arg00

Parameters:
    arg00 : string

Returns: float32 option
arg00 : string
Returns: float32 option

(|UInt16|_|) arg00

Full Usage: (|UInt16|_|) arg00

Parameters:
    arg00 : string

Returns: uint16 option
arg00 : string
Returns: uint16 option

(|UInt32|_|) arg00

Full Usage: (|UInt32|_|) arg00

Parameters:
    arg00 : string

Returns: uint32 option
arg00 : string
Returns: uint32 option

(|UInt64|_|) arg00

Full Usage: (|UInt64|_|) arg00

Parameters:
    arg00 : string

Returns: uint64 option
arg00 : string
Returns: uint64 option