lean4-htt/tests/lean/run/hmul2.lean
Leonardo de Moura 656b7a8d87 chore: fix tests
2021-03-11 10:51:11 -08:00

34 lines
659 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

instance [Mul α] : HMul α (Array α) (Array α) where
hMul a as := as.map (a * .)
#check fun x => x * 2
#check fun y : Int => let x := 1; x * y
#check fun y : Int => let_delayed x := 1; x * y
def f1 (n : Nat) (i : Int) :=
i * n
def f2 (n : Nat) (i : Int) :=
n * i
def f3 (n : Nat) (i : Int) :=
n * (n * (n * (n * i)))
def f4 (n : Nat) (i : Int) :=
n + (n + (n * (n * i)))
def f5 (n : Nat) (i : Int) :=
n + (n + (n * (i, i).1))
#eval (2:Nat) * #[3, 4, 5]
def f6 (n : Nat) (i : Int) :=
let y := 2 * i
let x := y * n
n + x
def f7 (n : Nat) (i : Int) :=
n + (n * 2 * i)
def f8 (n : Nat) (i : Int) :=
n * 2 + (i * 1 * n * 2 * i)