[
    {
        "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, zip\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 = addressRegionOptional `compose` (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 = addressRegionOptional `composeLens` (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": "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": "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 = placeAddressLens `compose` addressStreetNameLens\n\n# Derived methods\n@docs compose, modify, zip\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": "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": []
    }
]