Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-87 authored Sep 15, 2024
1 parent 75992fd commit 4862a7c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Here's a hello world program in khasm:
```ocaml
import Stdlib
fun main (): unit =
Stdlib.print "Hello, World!"
println "Hello, World!"
```

The classic recursive fibonacci:
Expand Down Expand Up @@ -61,16 +61,15 @@ fun streaming_add_two (l: List int): Stream int =
Traits? You bet!
```ocaml
trait Show a =
fun show : a -> String
fun show : a -> string
end
(* slight sugar for `impl Show Int` *)
impl Show for Int =
fun show (x: Int): String =
impl Show int =
fun show (x: int): string =
int_to_string x
end
let two_ints_to_strings (x: Int) (y: Int): (String, String) =
fun two_ints_to_strings (x: int) (y: int): (string, string) =
(show x, show y)
```

Expand Down

0 comments on commit 4862a7c

Please sign in to comment.