infix or-else

This commit is contained in:
xenia 2023-09-03 13:50:30 +02:00
parent 3216656638
commit d2bd03a17e
2 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,8 @@ _or-else_ : {A : Type} → Maybe A → A → A
(real x) or-else _ = x (real x) or-else _ = x
cake or-else x = x cake or-else x = x
infix 10 _or-else_
is-real : {A : Type} Maybe A Type is-real : {A : Type} Maybe A Type
is-real cake = is-real cake =
is-real (real x) = is-real (real x) =

View File

@ -138,7 +138,7 @@ module Parse-URL where
reg-name = decode-utf8⁺ <$?> (many (unreserved <|> percent-encoded <|> sub-delims)) reg-name = decode-utf8⁺ <$?> (many (unreserved <|> percent-encoded <|> sub-delims))
unchecked : [ Parser Authority ] unchecked : [ Parser Authority ]
unchecked = (λ (host , rest) host (proj₂ <$> rest) or-else 80) unchecked = (λ (host , rest) host (proj₂ <$> rest or-else 80))
<$> (reg-name <&?> enbox (any-of ":" <&> enbox number)) <$> (reg-name <&?> enbox (any-of ":" <&> enbox number))
parse-path : [ Parser Path ] parse-path : [ Parser Path ]