chore(data/buffer/parser): remove universe parameter
All operations are defined on Type only anyway
This commit is contained in:
parent
23884d2863
commit
dc3db17fcd
1 changed files with 3 additions and 5 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue