polarity/std/codata/pair.pol
Brendan Zabarauskas 1a10bdc950
Use trailing commas when pretty printing (#508)
* Use trailing commas when pretty printing

* Use trailing commas in examples and prelude
2025-03-27 09:13:09 +00:00

13 lines
398 B
Text

/// The codata type of pairs defined by a first and second projection.
codata Pair(a b: Type) {
/// First projection on a pair.
Pair(a, b).fst(implicit a b: Type): a,
/// Second projection on a pair.
Pair(a, b).snd(implicit a b: Type): b,
}
/// Constructing an element of the pair type.
codef MkPair(a b: Type, x: a, y: b): Pair(a, b) {
.fst(_, _) => x,
.snd(_, _) => y,
}