[{"name":"Pair","comment":"\n@docs Pair\n\n### create\n@docs decode\n\nor through the constructor\n\n### shape\n@docs mapLeft, mapRight, encode\n","unions":[],"aliases":[{"name":"Pair","comment":" `left` & `right` as a value-pair\n\n    openClosedCurlyBracePair=\n      { left= '{', right= '}' }\n\n    openCurly= .left openClosedCurlyBracePair\n    closedCurly= .right openClosedCurlyBracePair\n","args":["left","right"],"type":"{ left : left, right : right }"}],"values":[{"name":"decode","comment":" A `Json.Decode.Decoder` for `Pair`s, encoded by `encodePair`\n    \n    \"\"\"\n    {\n     \\\"left\\\": 1,\n     \\\"right\\\": 11\n    }\n    \"\"\"\n    |>Decode.decodeString\n        (Pair.decode Decode.int Decode.int)\n\n\n> `Ok { left= 1, right= 11 }`\n","type":"Json.Decode.Decoder left -> Json.Decode.Decoder right -> Json.Decode.Decoder (Pair.Pair left right)"},{"name":"encode","comment":" Convert a `Pair` to a `Json.Encode.Value`.\n\n    Encode.encode 1\n      (Pair.encode\n        Encode.int Encode.int\n        { left= 1, right= 11 }\n      )\n\n    \"\"\"\n    {\n     \\\"left\\\": 1,\n     \\\"right\\\": 11\n    }\n    \"\"\"\n","type":"(left -> Json.Encode.Value) -> (right -> Json.Encode.Value) -> Pair.Pair left right -> Json.Encode.Value"},{"name":"mapLeft","comment":" map the `left` value in a `Pair`\n\n    { left= 128522, right= \"smile\" }\n    |>mapLeft Char.fromCode\n\n> `{ left= '😊', right= \"smile\" }`\n\nThis is handy when using maps or folds etc.\n\n    namedEmojiCodes=\n      PairDict.empty\n      |>PairDict.insert { left= 127824, right= \"pear\" }\n      |>PairDict.insert { left= 127795, right= \"tree\" }\n    namedEmojis=\n      namedEmojiCodes\n      |>PairDict.map (Pair.mapLeft String.fromInt)\n\n> `PairDict.fromList [ ( '🍐', \"pear\" ), ( '🌳', \"tree\" ) ]`\n","type":"(left -> resultLeft) -> Pair.Pair left right -> Pair.Pair resultLeft right"},{"name":"mapRight","comment":" map the `right` value in a `Pair`\n\n    { left= \"smile\", right= 128522 }\n    |>mapRight Char.fromCode\n\n> `{ left= \"smile\", right= '😊' }`\n\nThis is handy when using maps or folds etc.\n\n    namedEmojiCodes=\n      PairDict.empty\n      |>PairDict.insert { left= \"pear\", right= 127824 }\n      |>PairDict.insert {  left= \"tree\", right= 127795 }\n    namedEmojis=\n      namedEmojiCodes\n      |>PairDict.map (Pair.mapLeft String.fromInt)\n\n> `PairDict.fromList [ ( \"pear\", '🍐' ), ( \"tree\", '🌳' ) ]`\n","type":"(right -> resultRight) -> Pair.Pair left right -> Pair.Pair left resultRight"}],"binops":[]},{"name":"PairDict","comment":" \n@docs PairDict\n\n@docs equal\n\n## create\n@docs empty, fromDict, fromList, decode\n\n## access\n@docs rightOf, leftOf\n\n## properties\n@docs size\n\n## in\n@docs insert, union\n\n## out\n@docs removeLeft, removeRight\n\n## shape\n@docs lefts, rights, fold, map, toDict, encode\n","unions":[{"name":"PairDict","comment":" Want to look up value-pairs from the left or the right?\n\nLike [assoc-list](https://github.com/pzp1997/assoc-list),\na `PairDict` allows for anything as `left` or `right` values except for functions and things that contain functions.\n\n## Example: cased letters\n    lowerUppercaseLetters=\n      empty\n      |>insert { left= 'a', right= 'A' }\n      |>insert { left= 'b', right= 'B' }\n      |>insert { left= 'c', right= 'C' }\n\n    upperCase char=\n      rightOf char lowerUppercaseLetters\n","args":["left","right"],"cases":[]}],"aliases":[],"values":[{"name":"decode","comment":" A `Json.Decode.Decoder` for `PairDict`s, encoded by `encodePair`.\n\nThe order of insertion is not reconstructed (see `equal`)\n\n    \"\"\"\n    [\n     {\n      \\\"left\\\": 2,\n      \\\"right\\\": 22\n     },\n     {\n      \\\"left\\\": 1,\n      \\\"right\\\": 11\n     }\n    ]\n    \"\"\"\n    |>Decode.decodeString\n        (decode Decode.int Decode.int)\n\n> `Ok (fromList [ ( 1, 11 ), ( 2, 22 ) ])`\n","type":"Json.Decode.Decoder left -> Json.Decode.Decoder right -> Json.Decode.Decoder (PairDict.PairDict left right)"},{"name":"empty","comment":" A `PairDict` with no elements\n","type":"PairDict.PairDict left right"},{"name":"encode","comment":" Convert a `PairDict` to a `Json.Encode.Value`.\n\n    somePairDict=\n      empty\n      |>insert { left= 1, right= 11 }\n      |>insert { left= 2, right= 22 }\n    Encode.encode 1\n      (encode\n        Encode.int Encode.int\n        somePairDict\n      )\n\n\n    \"\"\"\n    [\n     {\n      \\\"left\\\": 2,\n      \\\"right\\\": 22\n     },\n     {\n      \\\"left\\\": 1,\n      \\\"right\\\": 11\n     }\n    ]\n    \"\"\"\n","type":"(left -> Json.Encode.Value) -> (right -> Json.Encode.Value) -> PairDict.PairDict left right -> Json.Encode.Value"},{"name":"equal","comment":" using (==) built-in equality is often not useful in the context of association-dicts.\n\nIgnoring insertion order: do these 2 `PairDict`s have the same size and identical `Pair`s?\n\n    letterCodes=\n      fromList [ ( 'a', 0 ), ( 'b', 1 ) ]\n    fancyCompetingLetterCodes=\n      fromList [ ( 'b', 1 ), ( 'a', 0 ) ]\n    \n    equal\n      letterCodes\n      fancyCompetingLetterCodes\n    --> True\n","type":"PairDict.PairDict left right -> PairDict.PairDict left right -> Basics.Bool"},{"name":"fold","comment":" Reduce the left-right `Pair`s from most recently inserted\nto least recently inserted.\nA fold in the other direction doesn't exist, as association-`Dict`s should rarely rely on order (see `equal`)\n\n    brackets=\n      fromList\n        [ ( '(', ')' )\n        , ( '{', '}' )\n        ]\n    openingAndClosing=\n      brackets\n      |>fold\n          (\\{ left, right } acc->\n            acc ++[ String.fromList [ left, right ] ]\n          )\n          []\n> `[ \"{}\", \"()\" ]`\n","type":"(Pair.Pair left right -> acc -> acc) -> acc -> PairDict.PairDict left right -> acc"},{"name":"fromDict","comment":" Create a `PairDict` from a association-`Dict`. `left` is the key, `right` is the value.\nIf multiple equal keys or values are present, the value **first** in the `Dict` is **prefered**.\n    \n    lowerToUpperLetters=\n      AssocList.Dict.empty\n      |>AssocList.Dict.insert 'a' 'A'\n      |>AssocList.Dict.insert 'b' 'B'\n\n    lowerUpperLetters= fromDict lowerToUpperLetters\n","type":"AssocList.Dict left right -> PairDict.PairDict left right"},{"name":"fromList","comment":" Create a `PairDict` _conveniently_ from `Tuple`s. `left` is the first, `right` is the second.\nIf right or left values are given multiple times, the value **first** in the `List` is **prefered**.\n    \n    fromList\n      [ ( 'b', 'B' ) --insert { left= 'b', right= 'B' }\n      , ( 'a', 'A' ) --insert { left= 'a', right= 'A' }\n      , ( 'b', 'C' ) --ignored, as the left value already exists\n      , ( 'c', 'A' ) --ignored, as the right value already exists\n      , ( 'c', 'C' ) --insert { left= 'c', right= 'C' }\n      ]\n","type":"List.List ( left, right ) -> PairDict.PairDict left right"},{"name":"insert","comment":" Put in a left-right-`Pair`.\n\nIf either **value** is already **present**, the `PairDict` is **unchanged**.\n\n    empty\n    |>insert { left= 'b', right= 'B' } --puts it in \n    |>insret { right= 'A', left= 'a' } --puts it in\n    |>insert { left= 'b', right= 'C' } --ignored, the left value already exists\n    |>insert { left= 'c', right= 'A' } --ignored, the right value already exists\n    |>insert { left= 'c', right= 'C' } --puts it in\n","type":"Pair.Pair left right -> PairDict.PairDict left right -> PairDict.PairDict left right"},{"name":"leftOf","comment":" `Just` the right value if the left value is present in the `PairDict`, else `Nothing`\n\n    casedLetters=\n      empty\n      |>insert { left= 'a', right= 'A' }\n      |>insert { left= 'b', right= 'B' }\n\n    upperCase char=\n      rightOf char casedLetters\n","type":"right -> PairDict.PairDict left right -> Maybe.Maybe left"},{"name":"lefts","comment":" values on the left\n\n    brackets=\n      fromList [ ( '(', ')' ), ( '{', '}' ) ]\n    opening= lefts brackets\n","type":"PairDict.PairDict left right -> List.List left"},{"name":"map","comment":" map pairs\n\n    digitNames=\n      fromList\n        [ ( 0, \"zero\" )\n        , ( 1, \"one\" )\n        ]\n    mathSymbolNames=\n      digitNames\n      |>map (Pair.mapLeft String.fromInt)\n      |>insert { left= \"+\", right= \"plus\" }\n","type":"(Pair.Pair left right -> Pair.Pair resultLeft resultRight) -> PairDict.PairDict left right -> PairDict.PairDict resultLeft resultRight"},{"name":"removeLeft","comment":" remove left-right pair.\nIf **`left` does not exist**, the `PairDict` is **unchanged**\n\n    empty\n    |>insert \"(\" \")\"\n    |>removeLeft \")\" --unchanged, \")\" is not a left value\n    |>removeLeft \"(\" --removes { left= \"(\", right= \")\" }\n    --empty\n","type":"left -> PairDict.PairDict left right -> PairDict.PairDict left right"},{"name":"removeRight","comment":" remove left-right pair.\nIf `right` does not exist, the `PairDict` is unchanged\n\n    empty\n    |>insert { left= \"(\", right= \")\" }\n    |>removeRight \"(\" --unchanged, \"(\" is not a right value\n    |>removeRight \")\" --removes { left= \"(\", right= \")\" }\n    --empty\n","type":"right -> PairDict.PairDict left right -> PairDict.PairDict left right"},{"name":"rightOf","comment":" `Just` the right value if the left value is present in the `PairDict`, else `Nothing`\n\n    casedLetters=\n      empty\n      |>insert { left= 'a', right= 'A' }\n      |>insert { left= 'b', right= 'B' }\n\n    lowerCase char=\n      leftOf char casedLetters\n","type":"left -> PairDict.PairDict left right -> Maybe.Maybe right"},{"name":"rights","comment":" values on the right\n\n    brackets=\n      fromList [ ( '(', ')' ), ( '{', '}' ) ]\n    closing= rights brackets\n","type":"PairDict.PairDict left right -> List.List right"},{"name":"size","comment":" How many pairs there are.\n\n    size empty\n> `0`\n    \n    size\n      (fromList\n        (List.range 0 41 |>List.map (\\i-> ( i, i )))\n      )\n> `42`\n","type":"PairDict.PairDict left right -> Basics.Int"},{"name":"toDict","comment":" Convert to an association-`Dict`, which you can access only from the left\n\n    casedLetters=\n      fromList\n        [ ( 'A', 'a' ), ( 'B', 'b' ) ]\n    lowerFromUpper=\n      casedLetters |>dictFromLeft\n","type":"PairDict.PairDict left right -> AssocList.Dict left right"},{"name":"union","comment":" Merge 2 `PairDict`s.\nIf a value on the left or right is present, prefer the second dict.\n\n    numberNamedOperators=\n      fromList\n        [ ( '+', \"plus\" )\n        , ( '-', \"minus\" )\n        ]\n    customNamedOperators=\n      fromList\n        [ ( '∧', \"and\" )\n        , ( '∨', \"or\" )\n        , ( '-', \"negate\" )\n        ]\n    validNamedOperators=\n      union\n        custumNamedOperators --has a '-' left\n        numberOperatorNames --preferred → its '-'-Pair is inserted\n","type":"PairDict.PairDict left right -> PairDict.PairDict left right -> PairDict.PairDict left right"}],"binops":[]}]