chore(library/init/core): add strictAnd and strictOr

This commit is contained in:
Leonardo de Moura 2019-03-28 09:42:12 -07:00
parent 19f31d483a
commit 2943fce8c8
2 changed files with 3 additions and 3 deletions

View file

@ -601,6 +601,9 @@ prefix ! := not
infix || := or
infix && := and
@[inlineIfReduce] def strictOr (b₁ b₂ : Bool) := b₁ || b₂
@[inlineIfReduce] def strictAnd (b₁ b₂ : Bool) := b₁ && b₂
@[inline] def bne {α : Type u} [HasBeq α] (a b : α) : Bool :=
!(a == b)

View file

@ -42,9 +42,6 @@ p s (mkInput 0 st bst)
| ⟨Result.ok _ it st bst _, h⟩ := Result.ok a it st bst true
| ⟨Result.error _ _ _ _ _, h⟩ := unreachableError h
@[inlineIfReduce] def strictOr (b₁ b₂ : Bool) := b₁ || b₂
@[inlineIfReduce] def strictAnd (b₁ b₂ : Bool) := b₁ && b₂
@[inline] def parserM.bind (x : parserM σ δ μ α) (f : α → parserM σ δ μ β) : parserM σ δ μ β :=
λ str inp,
match x str inp with