The rail Reference Manual

This is the rail Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:36:34 2024 GMT+0.

Table of Contents


1 Systems

The main system appears first, followed by any subsystem dependency.


1.1 rail

Library implementing functions for railway oriented programming.

Author

Marcin Radoszewski

License

MIT

Version

0.0.1

Source

rail.asd.

Child Components

2 Files

Files are sorted by type and then listed depth-first from the systems components trees.


2.1 Lisp


2.1.1 rail/rail.asd

Source

rail.asd.

Parent Component

rail (system).

ASDF Systems

rail.


2.1.2 rail/package.lisp

Source

rail.asd.

Parent Component

rail (system).

Packages

rail.


2.1.3 rail/rail.lisp

Dependency

package.lisp (file).

Source

rail.asd.

Parent Component

rail (system).

Public Interface
Internals

3 Packages

Packages are listed by definition order.


3.1 rail

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

4 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


4.1 Public Interface


4.1.1 Ordinary functions

Function: bind (f branch)

Given function f (value -> branch) applies it on success branch

Package

rail.

Source

rail.lisp.

Function: fail (messages)

Create fail branch.

Package

rail.

Source

rail.lisp.

Function: fail-if-nil (fail-message value)

Creates branch from a value. If value is nil then fails with given message

Package

rail.

Source

rail.lisp.

Function: fail? (branch)
Package

rail.

Source

rail.lisp.

Function: failure-tee (f b)

Alias for failure-side-effect

Package

rail.

Source

rail.lisp.

Function: flat-map (f branch)

Alias for bind

Package

rail.

Source

rail.lisp.

Function: fmap (f branch)

Alias for lift.

Package

rail.

Source

rail.lisp.

Function: lift (f branch)

Given a function f : applies it to value stored in branch

Package

rail.

Source

rail.lisp.

Function: map-messages (f branch)

Given a function (f : (messages) -> messages) applies function to branch messages

Package

rail.

Source

rail.lisp.

Function: map-success (f branch)

Given a function (f : (value messages) -> branch) transforms success branch and returns a resulting branch

Package

rail.

Source

rail.lisp.

Function: merge-messages (msgs branch)

Merges additional messages to the branch

Package

rail.

Source

rail.lisp.

Function: succeed (value &optional messages)

Create a success branch. Optionally with messages.

Package

rail.

Source

rail.lisp.

Function: success-tee (f b)

Alias for success-side-effect

Package

rail.

Source

rail.lisp.

Function: success? (branch)
Package

rail.

Source

rail.lisp.


4.1.2 Generic functions

Generic Reader: branch-messages (object)
Package

rail.

Methods
Reader Method: branch-messages ((branch branch))

automatically generated reader method

Source

rail.lisp.

Target Slot

messages.

Generic Writer: (setf branch-messages) (object)
Package

rail.

Methods
Writer Method: (setf branch-messages) ((branch branch))

automatically generated writer method

Source

rail.lisp.

Target Slot

messages.

Generic Reader: branch-name (object)
Package

rail.

Methods
Reader Method: branch-name ((branch branch))

automatically generated reader method

Source

rail.lisp.

Target Slot

name.

Generic Writer: (setf branch-name) (object)
Package

rail.

Methods
Writer Method: (setf branch-name) ((branch branch))

automatically generated writer method

Source

rail.lisp.

Target Slot

name.

Generic Reader: branch-value (object)
Package

rail.

Methods
Reader Method: branch-value ((success success))

automatically generated reader method

Source

rail.lisp.

Target Slot

value.

Generic Writer: (setf branch-value) (object)
Package

rail.

Methods
Writer Method: (setf branch-value) ((success success))

automatically generated writer method

Source

rail.lisp.

Target Slot

value.

Generic Function: either (f-success f-failure branch)

Applies f-success if on success branch of f-failure if on failure branch. f-success takes value and a list of messages and should return a branch. f-failure takes list of messages and returns a branch.

Package

rail.

Source

rail.lisp.

Methods
Method: either ((f-success function) (f-failure function) (branch failure))
Method: either ((f-success function) (f-failure function) (branch success))
Generic Function: failure-side-effect (f branch)

Given a function f : (messages) -> any and a branch
applies the function to the success branch and returns result unchanged

Package

rail.

Source

rail.lisp.

Methods
Method: failure-side-effect ((f function) (b branch))
Method: failure-side-effect ((f function) (b failure))
Generic Function: fapply (f-branch v-branch)

Applies function (value -> value) stored as a value in f-branch to value stored in v-branch.

Package

rail.

Source

rail.lisp.

Methods
Method: fapply ((f-branch branch) (v-branch branch))
Method: fapply ((f-branch success) (v-branch success))
Generic Function: get-or-default (default branch)

Returns the value from success branch or default for failure branch.

Package

rail.

Source

rail.lisp.

Methods
Method: get-or-default (default (b failure))
Method: get-or-default (default (b success))
Generic Function: get-or-default-f (default-f branch)

Returns the value from success branch or computed value from default-f function for failure

Package

rail.

Source

rail.lisp.

Methods
Method: get-or-default-f ((default-f function) (b failure))
Method: get-or-default-f ((default-f function) (b success))
Generic Function: success-side-effect (f branch)

Given a function f : (value, messages) -> any and a branch
applies the function to the success branch and returns result unchanged

Package

rail.

Source

rail.lisp.

Methods
Method: success-side-effect ((f function) (b branch))
Method: success-side-effect ((f function) (b success))

4.1.3 Standalone methods

Method: print-object ((f failure) out)
Source

rail.lisp.

Method: print-object ((s success) out)
Source

rail.lisp.


4.1.4 Classes

Class: failure
Package

rail.

Source

rail.lisp.

Direct superclasses

branch.

Direct methods
Direct slots
Slot: name
Initform

:failure

Class: success
Package

rail.

Source

rail.lisp.

Direct superclasses

branch.

Direct methods
Direct slots
Slot: name
Initform

:success

Slot: value
Initargs

:value

Readers

branch-value.

Writers

(setf branch-value).


4.2 Internals


4.2.1 Generic functions

Generic Function: branch-copy (branch &key messages value)

Copies given branch and gives the ability to update it’s contents

Package

rail.

Source

rail.lisp.

Methods
Method: branch-copy ((branch failure) &key messages)
Method: branch-copy ((branch success) &key value messages)

4.2.2 Classes

Class: branch
Package

rail.

Source

rail.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

branch-name.

Writers

(setf branch-name).

Slot: messages
Initargs

:messages

Readers

branch-messages.

Writers

(setf branch-messages).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
B   E   F   G   L   M   P   S  
Index Entry  Section

(
(setf branch-messages): Public generic functions
(setf branch-messages): Public generic functions
(setf branch-name): Public generic functions
(setf branch-name): Public generic functions
(setf branch-value): Public generic functions
(setf branch-value): Public generic functions

B
bind: Public ordinary functions
branch-copy: Private generic functions
branch-copy: Private generic functions
branch-copy: Private generic functions
branch-messages: Public generic functions
branch-messages: Public generic functions
branch-name: Public generic functions
branch-name: Public generic functions
branch-value: Public generic functions
branch-value: Public generic functions

E
either: Public generic functions
either: Public generic functions
either: Public generic functions

F
fail: Public ordinary functions
fail-if-nil: Public ordinary functions
fail?: Public ordinary functions
failure-side-effect: Public generic functions
failure-side-effect: Public generic functions
failure-side-effect: Public generic functions
failure-tee: Public ordinary functions
fapply: Public generic functions
fapply: Public generic functions
fapply: Public generic functions
flat-map: Public ordinary functions
fmap: Public ordinary functions
Function, bind: Public ordinary functions
Function, fail: Public ordinary functions
Function, fail-if-nil: Public ordinary functions
Function, fail?: Public ordinary functions
Function, failure-tee: Public ordinary functions
Function, flat-map: Public ordinary functions
Function, fmap: Public ordinary functions
Function, lift: Public ordinary functions
Function, map-messages: Public ordinary functions
Function, map-success: Public ordinary functions
Function, merge-messages: Public ordinary functions
Function, succeed: Public ordinary functions
Function, success-tee: Public ordinary functions
Function, success?: Public ordinary functions

G
Generic Function, (setf branch-messages): Public generic functions
Generic Function, (setf branch-name): Public generic functions
Generic Function, (setf branch-value): Public generic functions
Generic Function, branch-copy: Private generic functions
Generic Function, branch-messages: Public generic functions
Generic Function, branch-name: Public generic functions
Generic Function, branch-value: Public generic functions
Generic Function, either: Public generic functions
Generic Function, failure-side-effect: Public generic functions
Generic Function, fapply: Public generic functions
Generic Function, get-or-default: Public generic functions
Generic Function, get-or-default-f: Public generic functions
Generic Function, success-side-effect: Public generic functions
get-or-default: Public generic functions
get-or-default: Public generic functions
get-or-default: Public generic functions
get-or-default-f: Public generic functions
get-or-default-f: Public generic functions
get-or-default-f: Public generic functions

L
lift: Public ordinary functions

M
map-messages: Public ordinary functions
map-success: Public ordinary functions
merge-messages: Public ordinary functions
Method, (setf branch-messages): Public generic functions
Method, (setf branch-name): Public generic functions
Method, (setf branch-value): Public generic functions
Method, branch-copy: Private generic functions
Method, branch-copy: Private generic functions
Method, branch-messages: Public generic functions
Method, branch-name: Public generic functions
Method, branch-value: Public generic functions
Method, either: Public generic functions
Method, either: Public generic functions
Method, failure-side-effect: Public generic functions
Method, failure-side-effect: Public generic functions
Method, fapply: Public generic functions
Method, fapply: Public generic functions
Method, get-or-default: Public generic functions
Method, get-or-default: Public generic functions
Method, get-or-default-f: Public generic functions
Method, get-or-default-f: Public generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, success-side-effect: Public generic functions
Method, success-side-effect: Public generic functions

P
print-object: Public standalone methods
print-object: Public standalone methods

S
succeed: Public ordinary functions
success-side-effect: Public generic functions
success-side-effect: Public generic functions
success-side-effect: Public generic functions
success-tee: Public ordinary functions
success?: Public ordinary functions