@@ -17,12 +17,21 @@ import Rel8.Expr ( Expr )
1717import Rel8.Table ( Table )
1818
1919
20+-- | Like 'Alt' in Haskell. This class is purely a Rel8 concept, and allows you
21+-- to take a choice between two tables. See also 'AlternativeTable'.
22+--
23+-- For example, using '<|>:' on 'MaybeTable' allows you to combine two tables
24+-- and to return the first one that is a "just" MaybeTable.
2025type AltTable :: (Type -> Type) -> Constraint
2126class AltTable f where
27+ -- | An associative binary operation on 'Table's.
2228 (<|>:) :: Table Expr a => f a -> f a -> f a
2329 infixl 3 <|>:
2430
2531
32+-- | Like 'Alternative' in Haskell, some 'Table's form a monoid on applicative
33+-- functors.
2634type AlternativeTable :: (Type -> Type) -> Constraint
2735class AltTable f => AlternativeTable f where
36+ -- | The identity of '<|>:'.
2837 emptyTable :: Table Expr a => f a