Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

Commit b8e3d49

Browse files
committed
DOCS: Update code examples.
1 parent 88bdded commit b8e3d49

7 files changed

Lines changed: 27 additions & 27 deletions

File tree

‎README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ Booleans and If-Then construct built entirely using Lambda Expressions.
3131
true: Bool = \x: Any. \y: Any. x
3232
false: Bool = \x: Any. \y: Any. y
3333

34-
if: Any = \condition: Any.
34+
if: Any = \condition: Bool.
3535
\thenClause: Any. \elseClause: Any.
3636
(condition thenClause elseClause)
3737

38-
boolToString: Bool = \bool: Bool. (if bool "true" "false")
38+
boolToString: String = \bool: Bool. (if bool "true" "false")
3939

4040
(print (boolToString true) "\n")
4141
(print (boolToString false) "\n")
@@ -51,18 +51,18 @@ Shapes Demo
5151

5252
```haskell
5353
-- Define Pi as constant
54-
pi: Float = 3.14
54+
pi: Number = 3.14
5555

5656
-- Define function to calculate square
57-
square: Float -> Float = \x: Float. (mul x x)
57+
square: Number -> Number = \x: Number. (mul x x)
5858

5959
-- Define function to calculate area of circle
60-
areaOfCircle: Float -> Float = \r: Float.
60+
areaOfCircle: Number -> Number = \r: Number.
6161
(mul pi (square r))
6262

6363
-- Define function to calculate volume of cylinder
64-
volumeOfCylinder: Float -> Float -> Float = \r: Float.
65-
\h: Float. (mul (areaOfCircle r) h)
64+
volumeOfCylinder: Number -> Number -> Number = \r: Number.
65+
\h: Number. (mul (areaOfCircle r) h)
6666

6767
-- Calculate the volume of a cylinder
6868
(print "Volume of cylinder is: " (volumeOfCylinder 5.0 10.0) "\n")
@@ -76,12 +76,12 @@ Volume of cylinder is: 785.000000
7676
Fibonacci
7777

7878
```haskell
79-
fibonacci: Any = \num: Float.
79+
fibonacci: Number = \num: Number.
8080
(null (cmp 0 num) 0
8181
(null (cmp 1 num) 1
8282
(add (fibonacci (sub num 1.0)) (fibonacci (sub num 2.0)))))
8383

84-
(print (fibonacci 10))
84+
(print (fibonacci 10) "\n")
8585
```
8686

8787
```console

‎examples/conditional_branching.lbd‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
true: Bool = \x: Any. \y: Any. x
22
false: Bool = \x: Any. \y: Any. y
33

4-
if: Any = \condition: Any.
4+
if: Any = \condition: Bool.
55
\thenClause: Any. \elseClause: Any.
66
(condition thenClause elseClause)
77

8-
boolToString: Bool = \bool: Bool. (if bool "true" "false")
8+
boolToString: String = \bool: Bool. (if bool "true" "false")
99

1010
(print (boolToString true) "\n")
1111
(print (boolToString false) "\n")

‎examples/math_demos.lbd‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
fibonacci: Any = \num: Float.
1+
fibonacci: Number = \num: Number.
22
(null (cmp 0 num) 0
33
(null (cmp 1 num) 1
44
(add (fibonacci (sub num 1.0)) (fibonacci (sub num 2.0)))))
55

6-
(print (fibonacci 10))
6+
(print (fibonacci 10) "\n")

‎examples/shapes.lbd‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
-- Define Pi as constant
2-
pi: Float = 3.14
2+
pi: Number = 3.14
33

44
-- Define function to calculate square
5-
square: Float -> Float = \x: Float. (mul x x)
5+
square: Number -> Number = \x: Number. (mul x x)
66

77
-- Define function to calculate area of circle
8-
areaOfCircle: Float -> Float = \r: Float.
8+
areaOfCircle: Number -> Number = \r: Number.
99
(mul pi (square r))
1010

1111
-- Define function to calculate volume of cylinder
12-
volumeOfCylinder: Float -> Float -> Float = \r: Float.
13-
\h: Float. (mul (areaOfCircle r) h)
12+
volumeOfCylinder: Number -> Number -> Number = \r: Number.
13+
\h: Number. (mul (areaOfCircle r) h)
1414

1515
-- Calculate the volume of a cylinder
1616
(print "Volume of cylinder is: " (volumeOfCylinder 5.0 10.0) "\n")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
true: Bool = \x: Any. \y: Any. x
22
false: Bool = \x: Any. \y: Any. y
33

4-
if: Any = \condition: Any.
4+
if: Any = \condition: Bool.
55
\thenClause: Any. \elseClause: Any.
66
(condition thenClause elseClause)
77

8-
boolToString: Bool = \bool: Bool. (if bool "true" "false")
8+
boolToString: String = \bool: Bool. (if bool "true" "false")
99

1010
(print (boolToString true) "\n")
1111
(print (boolToString false) "\n")

‎tests/integration/fibonacci.lbd‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
fibonacci: Number -> Number = \num: Number.
1+
fibonacci: Number = \num: Number.
22
(null (cmp 0 num) 0
33
(null (cmp 1 num) 1
44
(add (fibonacci (sub num 1.0)) (fibonacci (sub num 2.0)))))
55

6-
(print (fibonacci 10) "\n")
6+
(print (fibonacci 10) "\n")

‎tests/integration/shapes.lbd‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
-- Define Pi as constant
2-
pi: Float = 3.14
2+
pi: Number = 3.14
33

44
-- Define function to calculate square
5-
square: Float -> Float = \x: Float. (mul x x)
5+
square: Number -> Number = \x: Number. (mul x x)
66

77
-- Define function to calculate area of circle
8-
areaOfCircle: Float -> Float = \r: Float.
8+
areaOfCircle: Number -> Number = \r: Number.
99
(mul pi (square r))
1010

1111
-- Define function to calculate volume of cylinder
12-
volumeOfCylinder: Float -> Float -> Float = \r: Float.
13-
\h: Float. (mul (areaOfCircle r) h)
12+
volumeOfCylinder: Number -> Number -> Number = \r: Number.
13+
\h: Number. (mul (areaOfCircle r) h)
1414

1515
-- Calculate the volume of a cylinder
1616
(print "Volume of cylinder is: " (volumeOfCylinder 5.0 10.0) "\n")

0 commit comments

Comments
 (0)