Skip to content

Instantly share code, notes, and snippets.

@lucasmoreiradev
Created January 4, 2022 00:29
Show Gist options
  • Save lucasmoreiradev/496f2c675d38bbd03cc66222b12b65be to your computer and use it in GitHub Desktop.
Save lucasmoreiradev/496f2c675d38bbd03cc66222b12b65be to your computer and use it in GitHub Desktop.
let id = fun x -> x
let id x = x
let one = id 1
let one_dot_ne = id 1.1
let a = id "a"
let unit = id ()
let hello = fun () -> print_endline "hello"
let add a b = a + b
let add_one = add 1
let three = add_one 2
let list_one = [1;2]
let hd l =
match l with
| el :: _ -> el
| [] -> failwith "hd"
let x_x = hd [1;2;3]
type status =
| Authorized
| Unauthorized
type user = { id: int; name: string; status: status }
let lucas = {id = 0; name = "Lucas"; status = Unauthorized }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment