Skip to content

Commit

Permalink
Change <&> operator to <^> for rescript-lang/rescript-compiler#3807
Browse files Browse the repository at this point in the history
  • Loading branch information
andywhite37 committed Sep 5, 2019
1 parent 22b8c26 commit 46ccc7b
Show file tree
Hide file tree
Showing 9 changed files with 1,633 additions and 1,633 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ together using a variety of techniques.
// Combine two parsers into a tuple of the results (assuming all succeed)
P.tuple2(P.anyDigit, P.anyDigit) |> P.runParser("12") // Belt.Result.Ok(("1", "2"))
// <&> operator (operator version of tuple2)
P.anyDigit <&> P.anyDigit |> P.runParser("12") // Belt.Result.Ok(("1", "2"))
// <^> operator (operator version of tuple2)
P.anyDigit <^> P.anyDigit |> P.runParser("12") // Belt.Result.Ok(("1", "2"))
// Combine more parsers using tuple3 up to tuple5
P.tuple3(P.anyDigit, P.anyDigit, P.anyDigit)
Expand Down Expand Up @@ -481,8 +481,8 @@ list of parser functions that come with `ReludeParse`.
|--------|-----------|-------|
|`map`/`<$>`/`<#>`/`<$`/`$>`|functor functions for mapping pure functions over a parser
|`apply`/`<*>`/`<*`/`*>`|applicative functions for combining parsers
|`<&>`|combine two parsers using a tuple
|`tuple2`-`5`|combine parsers into tuples
|`<^>`|combine two parsers to produce a tuple of results
|`tuple2`-`5`|combine parsers to produce tuples of results
|`map2`-`5`|combine parsers using a function to combine the results
|`mapTuple2`-`5`|combine a tuple of parsers using a function to combine the results
|`pure`|lift a pure value into a parser that always succeeds with the value
Expand Down
8 changes: 4 additions & 4 deletions __tests__/ReludeParse_Parser_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ describe("ReludeParse_Parser", () => {
)
);

test("<&> (tuple2 operator)", () =>
test("<^> (tuple2 operator)", () =>
testParse(
P.anyDigit <&> P.anyDigit,
P.anyDigit <^> P.anyDigit,
"01",
("0", "1"),
{pos: 2, str: "01"},
Expand Down Expand Up @@ -333,15 +333,15 @@ describe("ReludeParse_Parser", () => {

test("lookAheadNot success", () =>
testParse(
P.anyAlpha <&> P.lookAheadNot(P.str("bbb")),
P.anyAlpha <^> P.lookAheadNot(P.str("bbb")),
"a999",
("a", ()),
{pos: 1, str: "a999"},
)
);

test("lookAheadNot failure", () =>
testParseFail(P.anyAlpha <&> P.lookAheadNot(P.str("bbb")), "abbb", 1)
testParseFail(P.anyAlpha <^> P.lookAheadNot(P.str("bbb")), "abbb", 1)
);

test("many success", () =>
Expand Down
1,010 changes: 505 additions & 505 deletions docs/coverage/lcov-report/src/ReludeParse_Parser.bs.js.html

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions docs/coverage/lcov-report/src/extras/ReludeParse_IPv4.bs.js.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 46ccc7b

Please sign in to comment.