lean4-htt/library/init/native/procedure.lean
Jared Roesch e65d90ac79 feat(*): C++ code generator
in progress move of Lean.native to init
2016-12-05 16:11:41 -08:00

21 lines
525 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.

/-
Copyright (c) 2016 Jared Roesch. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jared Roesch
-/
prelude
import init.meta.name
import init.meta.expr
meta def procedure :=
name × expr
meta def procedure.to_string : procedure → string
| (n, e) := "def " ++ to_string n ++ " := \n" ++ to_string e
meta def procedure.map_body (f : expr → expr) : procedure → procedure
| (n, e) := (n, f e)
meta instance : has_to_string procedure :=
⟨ procedure.to_string ⟩