[{"name":"ZipperPull.Smooth","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.Smooth.Interface a model b"}],"binops":[]},{"name":"ZipperPull.Stiff","comment":" This module provides a 'stiff' list zipper interface, meaning that the motion may fail. The failue results from two reasons:\n1.the pull already comes at the left or right end.\n2.the data conversion between focused and stored data fails.\nIn order to express this fact, some methods provided by interface made with `Zipper.Stiff.create` returns `Result`s.\n\n\n# INTERFACE TYPE\n\n@docs Interface\n\n\n# CREATION\n\n@docs create\n\n\n# Error\n\n@docs Err\n\n","unions":[{"name":"Err","comment":" Represents failure reason in moving focus.\n","args":["g"],"cases":[["FailedToGetFocus",["g"]],["BumpsLeftEnd",[]],["BumpsRightEnd",[]]]}],"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":["g","stock","model","output"],"type":"{ focusLeft : model -> Result.Result (ZipperPull.Stiff.Err g) model, focusRight : model -> Result.Result (ZipperPull.Stiff.Err g) model, focusLeftEnd : model -> Result.Result (ZipperPull.Stiff.Err g) model, focusRightEnd : model -> Result.Result (ZipperPull.Stiff.Err g) model, isLeftEnd : model -> Basics.Bool, isRightEnd : model -> Basics.Bool, indexFromLeft : model -> Basics.Int, indexFromRight : model -> Basics.Int, map : (stock -> stock) -> model -> Result.Result (ZipperPull.Stiff.Err g) model, toLeftHeadList : model -> Result.Result (ZipperPull.Stiff.Err g) (List.List stock), toRightHeadList : model -> Result.Result (ZipperPull.Stiff.Err g) (List.List stock), foldl : (stock -> output -> output) -> output -> model -> Result.Result (ZipperPull.Stiff.Err g) output, foldr : (stock -> output -> output) -> output -> model -> Result.Result (ZipperPull.Stiff.Err g) output, mapToLeftHeadList : (stock -> output) -> model -> Result.Result (ZipperPull.Stiff.Err g) (List.List output), mapToRightHeadList : (stock -> output) -> model -> Result.Result (ZipperPull.Stiff.Err g) (List.List output) }"}],"values":[{"name":"create","comment":" The way you can attach stiff list zipper interface on ordinary record.\n","type":"{ getRightList : model -> List.List a, getLeftList : model -> List.List a, getFocus : model -> Result.Result g a, setRightList : List.List a -> model -> model, setLeftList : List.List a -> model -> model, setFocus : a -> model -> model } -> ZipperPull.Stiff.Interface g a model b"}],"binops":[]}]