@@ -10,47 +10,47 @@ _Details: [Let Bindings](/let-bindings)_
1010
1111Feature | Example
1212--------------------------------|----------
13- String value | ` let hi = "Hello World"; `
14- Int value | ` let count = 42; `
15- Type annotation on binding | ` let count: int = 42; `
13+ String value | < code class = " text-ocaml " > let hi = "Hello World"</ code >< code class = " text-reasonml " >let hi = "Hello World";</ code >
14+ Int value | < code class = " text-ocaml " > let count = 42</ code >< code class = " text-reasonml " >let count = 42;</ code >
15+ Type annotation on binding | < code class = " text-ocaml " > let count: int = 42</ code >< code class = " text-reasonml " >let count: int = 42;</ code >
1616
1717- Note: Let bindings are immutable and cannot change once created.
1818
1919## Built In Types
2020
21- _ Details: [ Primitives] ( primitives ) _
21+ _ Details: [ Primitives] ( / primitives) _
2222
2323Feature | Example
2424--------------------------------|----------
25- Int | ` let x: int = 10; `
26- Float | ` let x: float = 10.0; `
27- Boolean | ` let x: bool = false; `
28- String | ` let x: string = "ten"; `
29- Char | ` let x: char = 'c'; `
30- Unit | ` let x: unit = (); `
31- Option | ` let x: option(int) = Some(10); `
32- Tuple | ` let x: (int, string) = (10, "ten"); `
33- List | ` let x: list(int) = [1, 2, 3]; `
34- Array | <code >let x: array(int) = [ | ; 1, 2, 3| ; ] ;</code >
35- Functions | ` let x: (int, int) => int = (a, b) => a + b; `
25+ Int | < code class = " text-ocaml " > let x: int = 10</ code >< code class = " text-reasonml " >let x: int = 10;</ code >
26+ Float | < code class = " text-ocaml " > let x: float = 10.0</ code >< code class = " text-reasonml " >let x: float = 10.0;</ code >
27+ Boolean | < code class = " text-ocaml " > let x: bool = false</ code >< code class = " text-reasonml " >let x: bool = false;</ code >
28+ String | < code class = " text-ocaml " > let x: string = "ten"</ code >< code class = " text-reasonml " >let x: string = "ten";</ code >
29+ Char | < code class = " text-ocaml " > let x: char = 'c'</ code >< code class = " text-reasonml " >let x: char = 'c';</ code >
30+ Unit | < code class = " text-ocaml " > let x: unit = ()</ code >< code class = " text-reasonml " >let x: unit = ();</ code >
31+ Option | < code class = " text-ocaml " > let x: int option = Some 10</ code >< code class = " text-reasonml " >let x: option (int) = Some(10);</ code >
32+ Tuple | < code class = " text-ocaml " > let x: (int, string) = (10, "ten")</ code >< code class = " text-reasonml " >let x: (int, string) = (10, "ten");</ code >
33+ List | < code class = " text-ocaml " > let x: int list = [ 1; 2; 3 ] ;</ code >< code class = " text-reasonml " >let x: list (int) = [ 1, 2, 3] ;</ code >
34+ Array | <code class = " text-ocaml " >let x: int array = [ &# 124 ; 1; 2; 3 &# 124 ; ] </ code >< code class = " text-reasonml " >let x: array(int) = [ | ; 1, 2, 3| ; ] ;</code >
35+ Functions | < code class = " text-ocaml " > let x : int -> int -> int = fun a b -> a + b</ code >< code class = " text-reasonml " >let x: (int, int) => int = (a, b) => a + b;</ code >
3636
3737## Strings
3838
39- _ Details: [ Strings] ( primitives#strings ) _
39+ _ Details: [ Strings] ( / primitives#strings) _
4040
4141Feature | Example
4242--------------------------------|----------
4343String | ` "Hello" `
44- String concatenation | ` " Hello " ++ "World"`
44+ String concatenation | < code class = " text-ocaml " >" Hello " ^ "World"</ code >< code class = " text-reasonml " >"Hello " ++ "World"</ code >
4545Character | ` 'x' `
46- Character at index | ` let x = "Hello"; x.[2]; `
46+ Character at index | < code class = " text-ocaml " > let x = "Hello" in x. [ 2 ] </ code >< code class = " text-reasonml " >let x = "Hello" ; x.[ 2] ;</ code >
4747
48- - String Functions: [ ` module String ` ] ( https://reasonml.github.io /api/String.html )
48+ - String Functions: < a class = " text-ocaml " href = " https://melange.re/v4.0.0/api/ml/melange/Stdlib/String/ " > module String</ a >< a class = " text-reasonml " href = " https://melange.re/v4.0.0 /api/re/melange/Stdlib/ String/ " >module String</ a >
4949
5050## Numbers
5151
52- - _ Details: [ Integer] ( primitives#integer ) _
53- - _ Details: [ Float] ( primitives#float ) _
52+ - _ Details: [ Integer] ( / primitives#integer) _
53+ - _ Details: [ Float] ( / primitives#float) _
5454
5555Feature | Example
5656--------------------------------|----------
@@ -63,29 +63,29 @@ Float exponentiation | `2.0 ** 3.0`
6363
6464## Booleans and Logical Operators
6565
66- _ Details: [ Boolean] ( primitives#boolean ) _
66+ _ Details: [ Boolean] ( / primitives#boolean) _
6767
6868Feature | Example
6969--------------------------------|----------
7070Boolean Values | ` true ` , ` false `
7171Comparison | ` > ` , ` < ` , ` >= ` , ` <= `
72- Boolean operations | ` ! ` , ` && ` , <code >| ;| ; </code >
73- Reference equality | ` === ` , ` !== `
74- Structural equality | ` == ` , ` != `
72+ Boolean operations | < code class = " text-ocaml " >not</ code >< code class = " text-reasonml " >!</ code > , ` && ` , <code >| ;| ; </code >
73+ Reference equality | < code class = " text-ocaml " >==</ code >< code class = " text-reasonml " >===</ code >, < code class = " text-ocaml " >!=</ code >< code class = " text-reasonml " >!==</ code >
74+ Structural equality | < code class = " text-ocaml " >=</ code >< code class = " text-reasonml " >==</ code >, < code class = " text-ocaml " ><></ code >< code class = " text-reasonml " >!=</ code >
7575
7676## If-Else Expressions
7777
7878Feature | Example
7979--------------------------------|----------
80- If-Else expressions | ` if (condition) { a; } else { b; } `
81- Ternary expressions | ` condition ? a : b; `
80+ If-Else expressions | < code class = " text-ocaml " > if condition then a else b</ code >< code class = " text-reasonml " >if (condition) { a; } else { b; }</ code >
81+ Ternary expressions | < span class = " text-ocaml " >not applicable</ span >< code class = " text-reasonml " > condition ? a : b;</ code >
8282
8383- Note: These are expressions and can be assigned to a variable:
84- ` let x = if (condition) { a; } else { b; }; `
84+ < code class = " text-ocaml " > let x = if condition then a else b</ code >< code class = " text-reasonml " >let x = if (condition) { a; } else { b; };</ code >
8585
8686## Functions
8787
88- _ Details: [ Functions] ( functions ) _
88+ _ Details: [ Functions] ( / functions) _
8989
9090Feature | Example
9191--------------------------------|----------
0 commit comments