mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 01:52:11 +03:00
36b390fcb0
- Closes #2331. The rules implemented in this pr are as follows. 1. If a type definition has only one constructor, no pipe is added. The constructor is printed in the same line if it fits. 2. If a constructor is a record with a single field, the field is printed in the same line if it fits. If the constructor has multiple fields, they are printed aligned and indented after a line break. Examples: ``` type T := constructT : T; type T-wrapper := mkWrapper {unwrap : T}; type EnumRecord := | --- doc for C1 C1 { c1a : T; c1b : T } | C2 { c2a : T; c2b : T }; ```
22 lines
246 B
Plaintext
22 lines
246 B
Plaintext
module Adt;
|
|
|
|
type Bool :=
|
|
| true
|
|
| false;
|
|
|
|
type Pair (A B : Type) := mkPair A B;
|
|
|
|
type Nat :=
|
|
| zero
|
|
| suc Nat;
|
|
|
|
c1 : Bool := true;
|
|
|
|
c2 : Bool := false;
|
|
|
|
c3 : Pair Bool Bool := mkPair true false;
|
|
|
|
c4 : Nat := zero;
|
|
|
|
c5 : Nat := suc zero;
|