lean4-htt/library/init/control/id.lean
2018-04-27 08:33:08 -07:00

18 lines
437 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) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich
The identity monad.
-/
prelude
import init.control.lift
universe u
@[inline] def id_bind {α β : Type u} (x : α) (f : α → id β) : id β := f x
@[inline] instance : monad.{u u} id :=
{ pure := @id, bind := @id_bind }
@[inline] instance : monad_run id id :=
⟨@id⟩