diff --git a/README.md b/README.md index 853e8b6..098fb9e 100644 --- a/README.md +++ b/README.md @@ -891,6 +891,27 @@ The `cata` method takes two arguments: 1. If `g` is not a function, the behaviour of `cata` is unspecified. 2. No parts of `g`'s return value should be checked. +### Tuple + +`Tuple` is the canonical product type and represents a structure containing two +values (Tuple a b). + +```hs +Tuple a b = { cata :: (a -> b -> c) -> c } +tuple :: (a, b) -> Tuple a b +``` + +A value which conforms to the Tuple specification must provide an `cata` method. + +The `cata` method takes a single argument: + + t.cata(f) + +1. `f` must be a function of two arguments which returns a value + + 1. If `f` is not a function, the behaviour of `cata` is unspecified. + 2. No parts of `f`'s return value should be checked. + ## Derivations When creating data types which satisfy multiple algebras, authors may choose