Skip to content

Commit

Permalink
update fixity syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Sep 13, 2023
1 parent 75b3c62 commit 6f47fbb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions Stdlib/Data/Fixity.juvix
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module Stdlib.Data.Fixity;

syntax fixity rapp {arity: binary, assoc: right};
syntax fixity lapp {arity: binary, assoc: left, same: rapp};
syntax fixity seq {arity: binary, assoc: left, above: [lapp]};
syntax fixity rapp := binary {assoc := right};
syntax fixity lapp := binary {assoc := left; same := rapp};
syntax fixity seq := binary {assoc := left; above := [lapp]};

syntax fixity functor {arity: binary, assoc: right};
syntax fixity functor := binary {assoc := right};

syntax fixity logical {arity: binary, assoc: right, above: [seq]};
syntax fixity comparison {arity: binary, assoc: none, above: [logical]};
syntax fixity logical := binary {assoc := right; above := [seq]};
syntax fixity comparison := binary {assoc := none; above := [logical]};

syntax fixity pair {arity: binary, assoc: right};
syntax fixity cons {arity: binary, assoc: right, above: [pair]};
syntax fixity pair := binary {assoc := right};
syntax fixity cons := binary {assoc := right; above := [pair]};

syntax fixity step {arity: binary, assoc: right};
syntax fixity range {arity: binary, assoc: right, above: [step]};
syntax fixity step := binary {assoc := right};
syntax fixity range := binary {assoc := right; above := [step]};

syntax fixity additive {arity: binary, assoc: left, above: [comparison, range, cons]};
syntax fixity multiplicative {arity: binary, assoc: left, above: [additive]};
syntax fixity additive := binary {assoc := left; above := [comparison; range; cons]};
syntax fixity multiplicative := binary {assoc := left; above := [additive]};

syntax fixity composition {arity: binary, assoc: right, above: [multiplicative]};
syntax fixity composition := binary {assoc := right; above := [multiplicative]};
2 changes: 1 addition & 1 deletion Stdlib/Data/Int/Range.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Range :=
step : Int
};

syntax iterator for {init: 1, range: 1};
syntax iterator for {init := 1; range := 1};

{-# specialize: [1, 3] #-}
for {A} (f : A → Int → A) (a : A) : Range → A
Expand Down
2 changes: 1 addition & 1 deletion Stdlib/Data/Nat/Range.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Range :=
step : Nat
};

syntax iterator for {init: 1, range: 1};
syntax iterator for {init := 1; range := 1};

{-# specialize: [1, 3] #-}
for {A} (f : A → Nat → A) (a : A) : Range → A
Expand Down

0 comments on commit 6f47fbb

Please sign in to comment.