[{"name":"ZipperPull","comment":"\n\n\n# INTERFACE TYPE\n\n@docs Interface\n\n\n# CREATION\n\n@docs create\n\n\n# Too few functions?\n\nThe interface does not have `updateFocus : (stock -> stock) -> model -> model`, `insertLeft : stock -> model -> model`, `getLeftList : model -> List stock` etc.\nThis is because these operation can be done simpler way with ordinary record operations. It may be confusing to have more than one way of doing one thing.\nIf you have any inconvinience, please tell me or make a pull request.\n\n","unions":[],"aliases":[{"name":"Interface","comment":" A record containing functions for manipulating specified data type as list zipper. The type parameter `output` should not be specifide.\n","args":["stock","model","output"],"type":"{ focusLeft : model -> model, focusRight : model -> model, focusLeftEnd : model -> model, focusRightEnd : model -> model, isLeftEnd : model -> Basics.Bool, isRightEnd : model -> Basics.Bool, indexFromLeft : model -> Basics.Int, indexFromRight : model -> Basics.Int, map : (stock -> stock) -> model -> model, toLeftHeadList : model -> List.List stock, toRightHeadList : model -> List.List stock, foldl : (stock -> output -> output) -> output -> model -> output, foldr : (stock -> output -> output) -> output -> model -> output, mapToLeftHeadList : (stock -> output) -> model -> List.List output, mapToRightHeadList : (stock -> output) -> model -> List.List output }"}],"values":[{"name":"create","comment":" The way you can attach list zipper interface on ordinary record.\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 : Interface (String, Int) Model output\n    pull =\n        create\n            { getRightList = .latterVolumes\n            , getLeftList = .previousVolumes\n            , getFocus = \\m -> (m.title, m.readCount)\n            , setRightList = \\l m -> {m| latterVolumes = l}\n            , setLeftList = \\f m -> {m| previousVolumes = f}\n            , setFocus = \\(t,c) m -> {m| title=t, readCount=c}\n            }\n\n    model\n      |> pull.focusRightEnd\n      |> pull.focusLeft\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.isLeftEnd --> True\n\n    model |> pull.focusRight |> pull.isLeftEnd --> False\n\n    model |> pull.isRightEnd --> False\n\n    model |> pull.focusRightEnd |> pull.isRightEnd --> True\n\n    model\n        |> pull.foldl\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.foldr\n            (\\(_, count) sofar -> sofar + count)\n            0\n            --> 14\n\n    model\n        |> pull.indexFromLeft\n        --> 0\n\n","type":"{ getRightList : model -> List.List a, getLeftList : model -> List.List a, getFocus : model -> a, setRightList : List.List a -> model -> model, setLeftList : List.List a -> model -> model, setFocus : a -> model -> model } -> ZipperPull.Interface a model b"}],"binops":[]}]