FSharpx.Extras


LayoutOps Module

A layout is a sequence of strings which have been joined together. The strings are classified as words, separators and left and right parenthesis. This classification determines where spaces are inserted. A joint is either unbreakable, breakable or broken. If a joint is broken the RHS layout occurs on the next line with optional indentation. A layout can be squashed to for given width which forces breaks as required.

Functions and values

Function or value Description

layout1 ++ layout2

Full Usage: layout1 ++ layout2

Parameters:
Returns: Layout

Join, possible break with indent=0

layout1 : Layout
layout2 : Layout
Returns: Layout

layout1 -- layout2

Full Usage: layout1 -- layout2

Parameters:
Returns: Layout

Join, possible break with indent=1

layout1 : Layout
layout2 : Layout
Returns: Layout

layout1 --- layout2

Full Usage: layout1 --- layout2

Parameters:
Returns: Layout

Join, possible break with indent=2

layout1 : Layout
layout2 : Layout
Returns: Layout

layout1 @@ layout2

Full Usage: layout1 @@ layout2

Parameters:
Returns: Layout

Join broken with ident=0

layout1 : Layout
layout2 : Layout
Returns: Layout

layout1 @@- layout2

Full Usage: layout1 @@- layout2

Parameters:
Returns: Layout

Join broken with ident=1

layout1 : Layout
layout2 : Layout
Returns: Layout

layout1 @@-- layout2

Full Usage: layout1 @@-- layout2

Parameters:
Returns: Layout

Join broken with ident=2

layout1 : Layout
layout2 : Layout
Returns: Layout

layout1 ^^ layout2

Full Usage: layout1 ^^ layout2

Parameters:
Returns: Layout

Join, unbreakable.

layout1 : Layout
layout2 : Layout
Returns: Layout

aboveL layout1 layout2

Full Usage: aboveL layout1 layout2

Parameters:
Returns: Layout

Layout two vertically.

layout1 : Layout
layout2 : Layout
Returns: Layout

aboveListL layouts

Full Usage: aboveListL layouts

Parameters:
Returns: Layout

Layout list vertically.

layouts : Layout list
Returns: Layout

braceL layout

Full Usage: braceL layout

Parameters:
Returns: Layout

Wrap braces around layout.

layout : Layout
Returns: Layout

bracketL Layout

Full Usage: bracketL Layout

Parameters:
Returns: Layout

Wrap round brackets around Layout.

Layout : Layout
Returns: Layout

commaListL layouts

Full Usage: commaListL layouts

Parameters:
Returns: Layout

Join layouts into a comma separated list.

layouts : Layout list
Returns: Layout

emptyL

Full Usage: emptyL

Returns: Layout

The empty layout

Returns: Layout

isEmptyL layout

Full Usage: isEmptyL layout

Parameters:
Returns: bool

Is it the empty layout?

layout : Layout
Returns: bool

leftL text

Full Usage: leftL text

Parameters:
    text : string

Returns: Layout

An string which is left parenthesis (no space on the right).

text : string
Returns: Layout

listL selector value

Full Usage: listL selector value

Parameters:
    selector : 'T -> Layout
    value : 'T list

Returns: Layout

Layout like an F# list.

selector : 'T -> Layout
value : 'T list
Returns: Layout

objL value

Full Usage: objL value

Parameters:
    value : obj

Returns: Layout

An uninterpreted leaf, to be interpreted into a string by the layout engine. This allows leaf layouts for numbers, strings and other atoms to be customized according to culture.

value : obj
Returns: Layout

optionL selector value

Full Usage: optionL selector value

Parameters:
    selector : 'T -> Layout
    value : 'T option

Returns: Layout

Layout like an F# option.

selector : 'T -> Layout
value : 'T option
Returns: Layout

rightL text

Full Usage: rightL text

Parameters:
    text : string

Returns: Layout

An string which is right parenthesis (no space on the left).

text : string
Returns: Layout

semiListL layouts

Full Usage: semiListL layouts

Parameters:
Returns: Layout

Join layouts into a semi-colon separated list.

layouts : Layout list
Returns: Layout

sepL text

Full Usage: sepL text

Parameters:
    text : string

Returns: Layout

An string which requires no spaces either side.

text : string
Returns: Layout

sepListL layout1 layouts

Full Usage: sepListL layout1 layouts

Parameters:
Returns: Layout

Join layouts into a list separated using the given Layout.

layout1 : Layout
layouts : Layout list
Returns: Layout

spaceListL layouts

Full Usage: spaceListL layouts

Parameters:
Returns: Layout

Join layouts into a space separated list.

layouts : Layout list
Returns: Layout

squareBracketL layout

Full Usage: squareBracketL layout

Parameters:
Returns: Layout

Wrap square brackets around layout.

layout : Layout
Returns: Layout

tagAttrL text maps layout

Full Usage: tagAttrL text maps layout

Parameters:
    text : string
    maps : (string * string) list
    layout : Layout

Returns: Layout

See tagL

text : string
maps : (string * string) list
layout : Layout
Returns: Layout

tupleL layouts

Full Usage: tupleL layouts

Parameters:
Returns: Layout

Form tuple of layouts.

layouts : Layout list
Returns: Layout

unfoldL selector folder state count

Full Usage: unfoldL selector folder state count

Parameters:
    selector : 'T -> Layout
    folder : 'State -> ('T * 'State) option
    state : 'State
    count : int

Returns: Layout list

For limitting layout of list-like sequences (lists,arrays,etc). unfold a list of items using (project and z) making layout list via itemL. If reach maxLength (before exhausting) then truncate.

selector : 'T -> Layout
folder : 'State -> ('T * 'State) option
state : 'State
count : int
Returns: Layout list

wordL text

Full Usage: wordL text

Parameters:
    text : string

Returns: Layout

An string leaf

text : string
Returns: Layout