-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93d41ad
commit a2d623c
Showing
2 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
-- constructor printing | ||
module test055; | ||
|
||
import Stdlib.Prelude open; | ||
import Juvix.Builtin.V1.Fixity open; | ||
import Juvix.Builtin.V1.Trait.FromNatural open public; | ||
import Juvix.Builtin.V1.Nat open; | ||
import Juvix.Builtin.V1.List open; | ||
|
||
type Pair' := pair : Nat -> Nat -> Pair'; | ||
|
||
open Pair' using {pair} public; | ||
|
||
syntax operator Pair., pair; | ||
|
||
--- Inductive pair. I.e. a tuple with two components. | ||
builtin pair | ||
type Pair (A B : Type) := , : A → B → Pair A B; | ||
|
||
open Pair using {,} public; | ||
|
||
main : Pair (List (Pair Pair' Nat)) (List Pair') := | ||
(pair 1 2, 3) :: (pair 2 3, 4) :: nil, pair 1 2 :: pair 2 3 :: nil; |