diff options
author | Marvin Borner | 2024-11-27 15:16:11 +0100 |
---|---|---|
committer | Marvin Borner | 2024-11-27 15:16:11 +0100 |
commit | 4b38d1af08288e80a29c84fe02a40ac925331f21 (patch) | |
tree | ba2e959966c1fb4ccb521cf41aaeb7fe2005d775 /std/Monad/Parser.bruijn | |
parent | 96c3527d87766f3fb653c31306eb78317dcbc1cf (diff) |
Monad improvements
Diffstat (limited to 'std/Monad/Parser.bruijn')
-rw-r--r-- | std/Monad/Parser.bruijn | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/Monad/Parser.bruijn b/std/Monad/Parser.bruijn index 0364ea0..12c058f 100644 --- a/std/Monad/Parser.bruijn +++ b/std/Monad/Parser.bruijn @@ -38,7 +38,7 @@ fail [[R.err 1]] ⧗ a → (Parser a) pure [[R.ok (1 : 0)]] ⧗ a → (Parser a) -ap [[[R.apply (2 0) ok]]] ⧗ (Parser (a → b)) → (Parser a) → (Parser b) +ap [[[R.bind (2 0) ok]]] ⧗ (Parser (a → b)) → (Parser a) → (Parser b) ok &[[R.map ok (3 0)]] ok &[[(3 1) : 0]] @@ -52,14 +52,14 @@ string y [[0 [[[go]]] (pure [[0]])]] ⧗ String → (Parser a) return pure ⧗ a → (Parser a) -bind [[[R.apply (2 0) ok]]] ⧗ (Parser a) → (a → (Parser b)) → (Parser a) +bind [[[R.bind (2 0) ok]]] ⧗ (Parser a) → (a → (Parser b)) → (Parser a) ok &[[3 1 0]] …>>=… bind alt [[[2 0 R.ok err]]] ⧗ (Parser a) → (Parser a) → (Parser a) err [2 1 R.ok err] - err [R.err (error-compose 1 0)] + err R.err ∘ (error-compose 0) …<|>… alt |