[
    {
        "name": "Monocle.Common",
        "comment": " Common lenses/prisms/optionals that most projects will use.\n\n@docs (=>)\n@docs maybe\n@docs array\n@docs dict\n@docs result\n@docs id\n@docs first\n@docs second\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "array",
                "comment": " Step into an `Array` at the given index.\n\n    array.getOption 2 (Array.fromList [10..15])\n    > Just 12\n\n    array.getOption 8 (Array.fromList [10..15])\n    > Nothing\n",
                "type": "Int -> Optional (Array a) a"
            },
            {
                "name": "dict",
                "comment": " Step into a `Dict` with the given key.\n\n    dict.getOption \"Tom\" (Dict.fromList [(\"Tom\",\"Cat\")])\n    > Just \"Cat\"\n\n    dict.getOption \"Jerry\" (Dict.fromList [(\"Tom\",\"Cat\")])\n    > Nothing\n",
                "type": "comparable -> Optional (Dict comparable v) v"
            },
            {
                "name": "first",
                "comment": " Step into the first element of a pair.\n\n    first.get ('a', 'b')\n    > Just 'a'\n",
                "type": "Lens ( a, b ) a"
            },
            {
                "name": "id",
                "comment": " Step into a record with an `id` key.\n\n    id.get {id = 1000, name = ...}\n    > Just 1000\n\nSince records with an `id` field are incredible common, this is\nincluded for convenience. It also serves as a simple recipe for\ncreating record lenses.\n",
                "type": "Lens { a | id : b } b"
            },
            {
                "name": "maybe",
                "comment": " Step into a `Maybe` value.\n\n    maybe.set 5 Nothing\n    > Just 5\n",
                "type": "Optional (Maybe a) a"
            },
            {
                "name": "result",
                "comment": " Step into the success value of a `Result`.\n\n    result.getOption (Ok 5)\n    > Just 5\n\n    result.getOption (Err \"500\")\n    > Nothing\n",
                "type": "Optional (Result e a) a"
            },
            {
                "name": "second",
                "comment": " Step into the second element of a pair.\n\n    second.get ('a', 'b')\n    > Just 'b'\n",
                "type": "Lens ( a, b ) b"
            }
        ],
        "binops": [
            {
                "name": "=>",
                "comment": " Convenient infix operator for composing optionals.\n\n   .getOption (maybe => array 2) (Just [10..15])\n   > 12\n\n",
                "type": "Optional a b -> Optional b c -> Optional a c",
                "associativity": "left",
                "precedence": 9
            }
        ]
    },
    {
        "name": "Monocle.Optional",
        "comment": " A Optional is a weaker Lens and a weaker Prism\n\n# Definition\n@docs Optional\n\n# Derived methods\n@docs compose, composeLens, modifyOption, modify, modify2, modify3, zip, tuple, tuple3\n\n# Conversion\n@docs fromPrism, fromLens\n\n# Example\n\n    addressRegionOptional : Optional Address String\n    addressRegionOptional =\n        let\n            getOption a = a.region\n\n            set r a = { a | region = Just r }\n        in\n            Optional getOption set\n",
        "unions": [],
        "aliases": [
            {
                "name": "Optional",
                "comment": " In order to create Optional we need to suply 2 functions: set and getOption\n",
                "args": [
                    "a",
                    "b"
                ],
                "type": "{ getOption : a -> Maybe b, set : b -> a -> a }"
            }
        ],
        "values": [
            {
                "name": "compose",
                "comment": " Composes `Optional a b` with `Optional b c` and returns `Optional a c`\n\n    string2IntPrism : Prism String Int\n    string2IntPrism = Prism (String.toInt >> Result.toMaybe) toString\n\n    addressRegionIntOptional: Optional Address Int\n    addressRegionIntOptional = compose addressRegionOptional (fromPrism string2IntPrism)\n",
                "type": "Optional a b -> Optional b c -> Optional a c"
            },
            {
                "name": "composeLens",
                "comment": " Composes `Optional a b` with `Lens b c` and returns `Optional a c`\n\n    string2CharListIso : Iso String (List Char)\n    string2CharListIso = Iso String.toList String.fromList\n\n    addressRegionListCharOptional: Optional Address (List Char)\n    addressRegionListCharOptional = composeLens addressRegionOptional (fromIso string2CharListIso)\n",
                "type": "Optional a b -> Lens b c -> Optional a c"
            },
            {
                "name": "fromLens",
                "comment": " Casts `Lens a b` to `Optional a b` where `getOption` will return always `Just`\n",
                "type": "Lens a b -> Optional a b"
            },
            {
                "name": "fromPrism",
                "comment": " Casts `Prism a b` to `Optional a b`\n\n    string2IntPrism : Prism String Int\n    string2IntPrism =\n        Prism (String.toInt >> Result.toMaybe) toString\n\n    stringIntOptional: Optional String Int\n    stringIntOptional = fromPrism string2IntPrism\n",
                "type": "Prism a b -> Optional a b"
            },
            {
                "name": "modify",
                "comment": " Modifies given function `(b -> b)` to be `(a -> a)` using `Optional a b`\n\n        modifyRegion: String -> String\n        modifyRegion region = String.reverse region\n\n        modifyAddressRegion: Address -> Address\n        modifyAddressRegion address = Optional.modify addressRegionOptional modifyRegion address\n",
                "type": "Optional a b -> (b -> b) -> a -> a"
            },
            {
                "name": "modify2",
                "comment": " Modifies given function `(b,d) -> (b,d)` to be `(a,c) -> (a,c)` using `Optional a b` and `Optional c d`\n\n    Function will be invoked ONLY when for ALL arguments `a` and `c` method `Optional.getOption` returns some value.\n",
                "type": "Optional a b -> Optional c d -> (( b, d ) -> ( b, d )) -> ( a, c ) -> ( a, c )"
            },
            {
                "name": "modify3",
                "comment": " Modifies given function `( b, d, f ) -> ( b, d, f )` to be `( a, c, e ) -> ( a, c, e )` using `Optional a b` and `Optional c d` and `Optional e f`\n\n    Function will be invoked ONLY when for ALL arguments `a`,`c`,`f` method `Optional.getOption` returns some value.\n",
                "type": "Optional a b -> Optional c d -> Optional e f -> (( b, d, f ) -> ( b, d, f )) -> ( a, c, e ) -> ( a, c, e )"
            },
            {
                "name": "modifyOption",
                "comment": " Modifies given function `(b -> b)` to be `(a -> Maybe a)` using `Optional a b`\n\n        modifyRegion: String -> String\n        modifyRegion region = String.reverse region\n\n        modifyAddressRegion: Address -> Maybe Address\n        modifyAddressRegion address = Optional.modifyOption addressRegionOptional modifyRegion address\n",
                "type": "Optional a b -> (b -> b) -> a -> Maybe a"
            },
            {
                "name": "tuple",
                "comment": " Tuple `Optional a b` with `Optional a c` and returns `Optional a (b,c)`\n\n    Method `Optional.getOption` returns pair of values only when both given optionals return some value.\n",
                "type": "Optional a b -> Optional a c -> Optional a ( b, c )"
            },
            {
                "name": "tuple3",
                "comment": " Tuple `Optional a b` with `Optional a c` with `Optional a d` and returns `Optional a (b,c,d)`\n\n    Method `Optional.getOption` returns triple of values only when all given optionals return some value.\n",
                "type": "Optional a b -> Optional a c -> Optional a d -> Optional a ( b, c, d )"
            },
            {
                "name": "zip",
                "comment": " Zip `Optional a c` with `Optional b d` to form Optional for the pairs ( a, b ) ( c, d )\n",
                "type": "Optional a c -> Optional b d -> Optional ( a, b ) ( c, d )"
            }
        ],
        "binops": []
    },
    {
        "name": "Monocle.Prism",
        "comment": " A Prism is a tool which optionally converts elements of type A into elements of type B and back.\n\n# Definition\n@docs Prism\n\n# Example\n\n    string2IntPrism : Prism String Int\n    string2IntPrism =\n        Prism (String.toInt >> Result.toMaybe) toString\n\n    string2IntPrism.getOption \"17896\" == Just 17896\n    string2IntPrism.getOption \"1a896\" == Nothing\n    string2IntPrism.reverseGet 1626767 = \"1626767\"\n\n# Derived methods\n@docs isMatching, modify, modifyOption, compose, composeIso\n\n# Conversion\n@docs fromIso\n\n",
        "unions": [],
        "aliases": [
            {
                "name": "Prism",
                "comment": " In order to create a `Prism` we need to supply two functions: `getOption` and `reverseGet`\n",
                "args": [
                    "a",
                    "b"
                ],
                "type": "{ getOption : a -> Maybe b, reverseGet : b -> a }"
            }
        ],
        "values": [
            {
                "name": "compose",
                "comment": " Composes `Prism a b` with `Prism b c` and returns `Prism a c`\n\n        prism = Monocle.Prism.compose string2FloatPrism float2IntPrism\n        prism.getOption \"22\" == Just 22\n        prism.getOption \"22.2\" == Nothing\n        prism.getOption \"22a\" == Nothing\n        prism.getOption \"abc\" == Nothing\n\n",
                "type": "Prism a b -> Prism b c -> Prism a c"
            },
            {
                "name": "composeIso",
                "comment": " Composes `Prism a b` with `Iso b c` and returns `Prism a c`\n\n        iso = Iso ((*) 10) ((//) 10)\n        prism = Monocle.Prism.composeIso string2IntPrism iso\n        prism.getOption \"22\" == Just 220\n        prism.getOption \"22.2\" == Nothing\n        prism.getOption \"22a\" == Nothing\n        prism.getOption \"abc\" == Nothing\n",
                "type": "Prism a b -> Iso b c -> Prism a c"
            },
            {
                "name": "fromIso",
                "comment": " Casts `Iso a b` to `Prism a b`\n",
                "type": "Iso a b -> Prism a b"
            },
            {
                "name": "isMatching",
                "comment": " Checks if value of type `A` has matching element of type 'B'\n\n        Monocle.Prism.isMatching string2IntPrism \"abc\" == False\n        Monocle.Prism.isMatching string2IntPrism \"123\" == True\n",
                "type": "Prism a b -> a -> Bool"
            },
            {
                "name": "modify",
                "comment": " Modifies given function `(b -> b)` to be `(a -> a)` using `Prism a b`\n\n        fx i = i * 2\n        modified = Monocle.Prism.modify string2IntPrism fx\n        modified \"22\" == \"44\"\n        modified \"abc\" == \"abc\"\n",
                "type": "Prism a b -> (b -> b) -> a -> a"
            },
            {
                "name": "modifyOption",
                "comment": " Modifies given function `(b -> b)` to be `(a -> Maybe a)` using `Prism a b`\n\n        fx i = i * 2\n        modified = Monocle.Prism.modify string2IntPrism fx\n        modified \"22\" == Just \"44\"\n        modified \"abc\" == Nothing\n",
                "type": "Prism a b -> (b -> b) -> a -> Maybe a"
            }
        ],
        "binops": []
    },
    {
        "name": "Monocle.Lens",
        "comment": " A Lens is a functional concept which solves a very common problem:\n    how to easily update a complex immutable structure,\n    for this purpose Lens acts as a zoom into a record.\n\n# Definition\n@docs Lens\n\n# Example\n    addressStreetNameLens : Lens Address String\n    addressStreetNameLens =\n        let\n            get a = a.streetName\n\n            set sn a = { a | streetName = sn }\n        in\n            Lens get set\n\n    placeAddressLens : Lens Place Address\n    placeAddressLens =\n        let\n            get p = p.address\n\n            set a p = { p | address = a }\n        in\n            Lens get set\n\n    placeStreetName: Lens Place String\n    placeStreetName = compose placeAddressLens addressStreetNameLens\n\n# Derived methods\n@docs compose, modify, modify2, modify3, modifyAndMerge, zip, tuple, tuple3\n\n# Conversion\n@docs fromIso\n\n",
        "unions": [],
        "aliases": [
            {
                "name": "Lens",
                "comment": " In order to create Lens we need to suply 2 functions: set and get\n",
                "args": [
                    "a",
                    "b"
                ],
                "type": "{ get : a -> b, set : b -> a -> a }"
            }
        ],
        "values": [
            {
                "name": "compose",
                "comment": " Composes `Lens a b` with `Lens b c` and returns `Lens a c`\n",
                "type": "Lens a b -> Lens b c -> Lens a c"
            },
            {
                "name": "fromIso",
                "comment": " Casts `Iso a b` to `Lens a b`\n",
                "type": "Iso a b -> Lens a b"
            },
            {
                "name": "modify",
                "comment": " Modifies given function `(b -> b)` to be `(a -> a)` using `Lens a b`\n\n    addressStreetNameLens = Lens Address String\n    fx streetName = String.reverse streeName\n    fx2 = Lens.modify addressStreetNameLens fx\n    fx2 {streetName=\"abcdef\"} == {streetName=\"fedcba\"}\n",
                "type": "Lens a b -> (b -> b) -> a -> a"
            },
            {
                "name": "modify2",
                "comment": " Modifies given function `(b,d) -> (b,d)` to be `(a,c) -> (a,c)` using `Lens a b` and `Lens c d`\n",
                "type": "Lens a b -> Lens c d -> (( b, d ) -> ( b, d )) -> ( a, c ) -> ( a, c )"
            },
            {
                "name": "modify3",
                "comment": " Modifies given function `(b,d,f) -> (b,d,f)` to be `(a,c,e) -> (a,c,e)` using `Lens a b` and `Lens c d` and `Lens e f`\n",
                "type": "Lens a b -> Lens c d -> Lens e f -> (( b, d, f ) -> ( b, d, f )) -> ( a, c, e ) -> ( a, c, e )"
            },
            {
                "name": "modifyAndMerge",
                "comment": " Modifies given function `(b -> (b,c))` to be `(a,c) -> (a,c)` using `Lens a b` and `merge` function\n\n",
                "type": "Lens a b -> (b -> ( b, c )) -> (c -> c -> c) -> ( a, c ) -> ( a, c )"
            },
            {
                "name": "tuple",
                "comment": " Tuple `Lens a b` with `Lens a c` and returns `Lens a (b,c)`\n",
                "type": "Lens a b -> Lens a c -> Lens a ( b, c )"
            },
            {
                "name": "tuple3",
                "comment": " Tuple `Lens a b` with `Lens a c` with `Lens a d` and returns `Lens a (b,c,d)`\n",
                "type": "Lens a b -> Lens a c -> Lens a d -> Lens a ( b, c, d )"
            },
            {
                "name": "zip",
                "comment": " Zips `Lens a c` with `Lens b d` to form Lens ( a, b ) ( c, d )\n",
                "type": "Lens a c -> Lens b d -> Lens ( a, b ) ( c, d )"
            }
        ],
        "binops": []
    },
    {
        "name": "Monocle.Iso",
        "comment": " An Iso is a tool which converts elements of type A into elements of type B and back without loss.\n\n# Definition\n@docs Iso\n\n# Laws\n    Identity:  \\x -> iso.get(iso.reverseGet x) == x\n    Reversed:  \\x -> iso.reverseGet(iso.get x) == x\n\n# Example\n\n    string2CharListIso : Iso String (List Char)\n    string2CharListIso =\n        Iso String.toList String.fromList\n\n    (string2CharListIso.get \"ABcdE\") == ['A','B','c','d','E']\n    (string2CharListIso.reverseGet ['A','B','c','d','E']) == \"ABcdE\"\n\n# Derived methods\n@docs reverse, modify, compose\n",
        "unions": [],
        "aliases": [
            {
                "name": "Iso",
                "comment": " In order to create an `Iso` we need to supply two total functions: `get` and `reverseGet`\n",
                "args": [
                    "a",
                    "b"
                ],
                "type": "{ get : a -> b, reverseGet : b -> a }"
            }
        ],
        "values": [
            {
                "name": "compose",
                "comment": " Composes `Iso a b` with `Iso b c` and returns `Iso a c`\n",
                "type": "Iso a b -> Iso b c -> Iso a c"
            },
            {
                "name": "modify",
                "comment": " Modifies given function `(b -> b)` to be `(a -> a)` using `Iso a b`\n\n        someiso = Iso String.toList String.fromList\n        somefx xs =  '@' :: xs\n        modified = Iso.modify someiso somefx\n        (modified \"artur\") == \"@artur\"\n\n",
                "type": "Iso a b -> (b -> b) -> a -> a"
            },
            {
                "name": "reverse",
                "comment": " Creates reversed `Iso b a`, exchanges functions `get` and `reverseGet`\n\n        .get (Iso.reversed someiso) == someiso.reverseGet\n        .reverseGet (Iso.reversed someiso) == someiso.get\n        Iso.compose someiso (Iso.reversed someiso) == Iso identity identity\n",
                "type": "Iso a b -> Iso b a"
            }
        ],
        "binops": []
    }
]