Skip to content

Commit

Permalink
feat(tree-sitter-sol): use ||
Browse files Browse the repository at this point in the history
  • Loading branch information
aripiprazole committed May 7, 2024
1 parent 56e8ae3 commit 68b478c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tree-sitter-sol/examples/Main.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// Natural numbers
Nat : * = (n : *) -> (n -> n) -> n

Succ (prev : Nat) : Nat = \n succ# zero# =>
Succ (prev : Nat) : Nat = |n succ# zero#|
succ# (prev n succ# zero#) zero#

Zero : Nat = \n succ# zero# => zero#
Zero : Nat = |n succ# zero#|
zero#

// Maybe definition
Maybe (t : *) = (a : *) -> (t -> a) a -> a

Just (value : a) : Maybe a = \t just# nothing# =>
Just (value : a) : Maybe a = |t just# nothing#|
just# value

Nothing : Maybe a = \t just# nothing# =>
Nothing : Maybe a = |t just# nothing#|
nothing#

Maybe.unwrap (maybe : Maybe a) : a =
Expand Down

0 comments on commit 68b478c

Please sign in to comment.