API Reference

# algebraic-data-library

A library of common algebraic data types.

## ALGEBRAIC-DATA-LIBRARY

• Generic-Function `FMAP` (fun val)
A way to lift FUN into a container-like value VAL.
• Function `FMAP*` (fun)
A curried version of FMAP: lift FUN to operate on functor types.
• Generic-Function `WRAP` (type value)
Lift VALUE to type TYPE.
• Generic-Function `>>=` (val f)
Send/compose the result of VAL to F.
• Generic-Function `>>` (a b)
Compute A and then B, discarding A.
• Method `>>` (a b)
• Macro `MLET` (bindings &body body)
Similar to Haskell's `do' notation, allows for `>>=' to be chained together.
• Struct `UNIT`
No slots.
• Struct `NUL`
No slots.
• Variable `NUL`
```(if (boundp 'algebraic-data-library:nul)
algebraic-data-library:nul
(algebraic-data-library::%nul))```
• Struct `MAYBE`
No slots.
• Struct `JUST`
`%0`
• Function `JUST` (%0)
• Struct `NOTHING`
No slots.
• Variable `NOTHING`
```(if (boundp 'algebraic-data-library:nothing)
algebraic-data-library:nothing
(algebraic-data-library::%nothing))```
• Function `JUST-OR-ELSE` (maybe-val or-else)
Return the encapsulated value of a JUST, otherwise return OR-ELSE if MAYBE-VAL is NOTHING.
• Function `LOOKUP` (key hash-table)
A type-safe version of GETHASH. Look up the key KEY in the hash table HASH-TABLE.
• Method `FMAP` ((f function) (val maybe))
• Method `WRAP` ((x (eql 'maybe)) value)
• Method `>>=` ((val maybe) f)
• Struct `EITHER`
No slots.
• Struct `LEFT`
`%0`
• Function `LEFT` (%0)
• Struct `RIGHT`
`%0`
• Function `RIGHT` (%0)
• Function `MIRROR` (either-val)
• Method `FMAP` ((f function) (val either))