miscelleaneous

Random Lean experiments

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
def mapM [Monad m] (f : α  m β) : List α  m (List β)
  | [] => pure []
  | x :: xs =>
    f x >>= fun hd =>
    mapM f xs >>= fun tl =>
    pure (hd :: tl)


#eval mapM (m := Id) (· + 1) [1, 2, 3, 4, 5]

#eval show IO Unit from IO.println "hello world"
#reduce show IO Unit from IO.println "hello world"