[{"name":"JohnsonTrotter","comment":" Implementation of the Johnson Trotter algorithm.\n\n    JohnsonTrotter.first [ \"a\", \"b\", \"c\" ]\n        |> JohnsonTrotter.getState\n        |> Maybe.map JohnsonTrotter.next\n        |> Maybe.andThen JohnsonTrotter.getPermutation\n    -- [ \"a\", \"c\", \"b\" ]\n\n\n# Step Type\n\n@docs Step\n\n\n# Initiating permutations\n\n@docs first\n\n\n# Iterating permutations\n\n@docs next, getState, getPermutation\n\n","unions":[{"name":"Step","comment":" Represents the next permutation, if there is one.\n","args":["a"],"cases":[["Done",[]],["Next",["JohnsonTrotter.State a","List.List a"]]]}],"aliases":[],"values":[{"name":"first","comment":" Initialises permutations. The first argument specifies the list that you want to get permutations for.\n","type":"List.List a -> JohnsonTrotter.Step a"},{"name":"getPermutation","comment":" Get the permutation from `Step`, if there is one.\n","type":"JohnsonTrotter.Step a -> Maybe.Maybe (List.List a)"},{"name":"getState","comment":" Get the `State` from `Step`, if there is one.\n","type":"JohnsonTrotter.Step a -> Maybe.Maybe (JohnsonTrotter.State a)"},{"name":"next","comment":" Get the next permutation. The first argument is the current `State` of the algorithm, which is in the `Step` returned by `first` and `next`. Use the `getState` helper funtion to retrieve the `State` from `Step`.\n","type":"JohnsonTrotter.State a -> JohnsonTrotter.Step a"}],"binops":[]}]