Skip to content

Commit 61649a5

Browse files
committed
Fix := syntax in examples
1 parent 575b459 commit 61649a5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

example/match.bl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
def (xs? length) do:
1+
def xs? length =
22
if xs == () then 0 else 1 + (xs tail length)
33

4-
def (xs? drop n?) do:
4+
def xs? drop n? =
55
match n with:
66
0 => xs
77
n? => xs tail drop n - 1
88

9-
def (xs? take n?) do:
9+
def xs? take n? =
1010
match n with:
1111
0 => ()
1212
n? => xs head :: xs tail take n - 1
1313

14-
def (merge a? b?) do:
14+
def merge a? b? =
1515
match (a, b) with:
1616
(a?, ()) => a
1717
((), b?) => b
@@ -21,14 +21,14 @@ def (merge a? b?) do:
2121
else
2222
b head :: (merge a b tail)
2323

24-
def (sort items?) do:
24+
def sort items? =
2525
match items with:
2626
() => ()
2727
x? :: () => items
2828
xs? => do:
29-
n := xs length
30-
left := xs take n / 2
31-
right := xs drop n / 2
29+
def n = xs length
30+
def left = xs take n / 2
31+
def right = xs drop n / 2
3232
merge (sort left) (sort right)
3333

3434
sort (list 4 7 5 2 3 0 1 9 8 6)

example/union.bl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
def (unpack x?) do:
1+
def unpack x? =
22
match x with:
33
i? : Int => "int!"
44
s? : String => "string!"
55

6-
MyType := (Int | String)
7-
x := 1 : MyType
6+
def MyType = (Int | String)
7+
def x = 1 : MyType
88

9-
unpack x
9+
println unpack x

0 commit comments

Comments
 (0)