[{"name":"ZipperPull","comment":" This library makes it easier to attach interface as [linear zipper](https://en.wikipedia.org/wiki/Zipper_(data_structure)#Example:_Bidirectional_list_traversal \"list zipper\") on arbitrary data types including ordinary records. Actually, no data correction type is defined in this package: the only functions exposed here is `create`, which returns a record containing handler functions, not data itself, to treat your data like list zipper. So it is named ZipperPull, not Zipper itself.\n\n\n# INTERFACE TYPE\n\n@docs ZipperPull\n\n\n# CREATION\n\n@docs create\n\n","unions":[],"aliases":[{"name":"ZipperPull","comment":" A record containing functions for manipulating specified data type as list zipper.\n","args":["stock","model","output"],"type":"{ next : model -> model, prev : model -> model, first : model -> model, last : model -> model, isFirst : model -> Basics.Bool, isLast : model -> Basics.Bool, foldFromFirst : (stock -> output -> output) -> output -> model -> output, foldFromLast : (stock -> output -> output) -> output -> model -> output, position : model -> Basics.Int, toList : model -> List.List stock }"}],"values":[{"name":"create","comment":" The way you can attach list zipper interface on ordinary record (or any other data type).\n\n    type alias Model =\n        { title : String\n        , readCount : Int\n        , previousVolumes : List (String, Int)\n        , latterVolumes : List (String, Int)\n        }\n\n    model : Model\n    model =\n        { title = \"Philosopher's Stone\"\n        , readCount = 3\n        , previousVolumes = []\n        , latterVolumes =\n            [ (\"Chamber of Secrets\",2)\n            , (\"Prisoner of Azkaban\",2)\n            , (\"Goblet of Fire\",3)\n            , (\"Order of the Phoenix\",2)\n            , (\"Half-Blood Prince\",1)\n            , (\"Deathly Hallows\",1)\n            ]\n        }\n\n    pull : ZipperPull (String, Int) Model output\n    pull =\n        create\n            { getForeList = .latterVolumes\n            , getRearList = .previousVolumes\n            , getCurrent = \\m -> (m.title, m.readCount)\n            , setForeList = \\l m -> {m| latterVolumes = l}\n            , setRearList = \\f m -> {m| previousVolumes = f}\n            , setCurrent = \\(t,c) m -> {m| title=t, readCount=c}\n            }\n\n    model\n      |> pull.last\n      |> pull.prev\n      --> { title = \"Half-Blood Prince\" , readCount = 1 , previousVolumes = [ (\"Order of the Phoenix\", 2) , (\"Goblet of Fire\", 3) , (\"Prisoner of Azkaban\", 2) , (\"Chamber of Secrets\", 2) , (\"Philosopher's Stone\", 3) ] , latterVolumes = [ (\"Deathly Hallows\", 1) ] }\n\n    model |> pull.isFirst --> True\n\n    model |> pull.next |> pull.isFirst --> False\n\n    model |> pull.isLast --> False\n\n    model |> pull.last |> pull.isLast --> True\n\n    model\n        |> pull.foldFromFirst\n            (\\(title, count) str ->\n                str\n                ++ \"I have read \\\"\"\n                ++ title\n                ++ \"\\\" \"\n                ++ String.fromInt count\n                ++ \" times. \"\n            )\n            \"\"\n            --> \"I have read \\\"Philosopher's Stone\\\" 3 times. \" ++ \"I have read \\\"Chamber of Secrets\\\" 2 times. \" ++ \"I have read \\\"Prisoner of Azkaban\\\" 2 times. \" ++ \"I have read \\\"Goblet of Fire\\\" 3 times. \" ++ \"I have read \\\"Order of the Phoenix\\\" 2 times. \" ++ \"I have read \\\"Half-Blood Prince\\\" 1 times. \" ++ \"I have read \\\"Deathly Hallows\\\" 1 times. \"\n\n    model\n        |> pull.foldFromLast\n            (\\(_, count) sofar -> sofar + count)\n            0\n            --> 14\n\n    model\n        |> pull.position\n        --> 0\n\n","type":"{ getForeList : model -> List.List a, getRearList : model -> List.List a, getCurrent : model -> a, setForeList : List.List a -> model -> model, setRearList : List.List a -> model -> model, setCurrent : a -> model -> model } -> ZipperPull.ZipperPull a model b"}],"binops":[]}]