chore(data/buffer/parser): remove universe parameter

All operations are defined on Type only anyway
This commit is contained in:
Sebastian Ullrich 2018-03-09 20:04:21 +01:00 committed by Leonardo de Moura
parent 23884d2863
commit dc3db17fcd

View file

@ -4,17 +4,15 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Ebner
-/
import data.buffer data.dlist
universes u v
inductive parse_result (α : Type u)
inductive parse_result (α : Type)
| done (pos : ) (result : α) : parse_result
| fail (pos : ) (expected : dlist string) : parse_result
def parser (α : Type u) :=
def parser (α : Type) :=
∀ (input : char_buffer) (start : ), parse_result α
namespace parser
-- Type polymorphism is restricted here because of monad.bind
variables {α β γ : Type}
protected def bind (p : parser α) (f : α → parser β) : parser β :=
@ -51,7 +49,7 @@ protected def fail (msg : string) : parser α :=
instance : monad parser :=
{ pure := @parser.pure, bind := @parser.bind }
instance : is_lawful_monad parser.{0} :=
instance : is_lawful_monad parser :=
{ id_map := @parser.id_map,
pure_bind := λ _ _ _ _, rfl,
bind_assoc := @parser.bind_assoc }