Keďže vyšla tá 4ka, tak som si to znova na chvíľu vyskúšal. Rozbehnutie bolo triviálne, má to builder, jedhoduchý extension pre VS Code.
Syntax je parádna.
Našiel som však len jeden funkčný program, všetko ostatné sú proovery. A to je zhustená, náročná matematika. Zatiaľ je to vo fáze pokusu a omylu ako to asi vlastne funguje.
Lean má naozaj strmú krivku učenia teda.
-- import «First»
def twice (f : Nat Nat) (a : Nat) :=
f (f a)
structure Person where
name : String
age : Nat
def main : IO Unit :=
-- let name := "John Doe"
-- IO.println s!"Hello, {name}!"
-- let names := ["Sebastian", "Leo", "Daniel"]
-- for name in names do
-- IO.println name
-- let res := twice (fun x => x + 2) 10
-- IO.println res
-- IO.println Lean.versionString
-- let res := List.map (fun x => x + 1) [1, 2, 3]
-- IO.println res
-- let p := { name := "Leo", age := 44 : Person }
-- IO.println p.name
-- IO.println p
let vals := #[1, 2, 3]
IO.println vals[0]