-
Notifications
You must be signed in to change notification settings - Fork 1
/
docs.json
1 lines (1 loc) · 27.5 KB
/
docs.json
1
[{"name":"CellAutomata","comment":" If you are new to this package, consider checking out CellAutomata.LifeLike first,\r\nas it is written as an introduction to this module.\r\n\r\n**If you want to create automatas with more then one state,**\r\n**but still operates on a 2D-Grid, than this package is the right one for you.**\r\n\r\nFirst start by writing your own state type.\r\n[As an example](orasund.github.io/elm-cellautomata/ant), lets try to simulate an ant that escapes any mase by always following the right wall.\r\n\r\n\r\nOur state will now be the following\r\n\r\n type State = Wall\r\n | Up\r\n | Down\r\n | Left\r\n | Right\r\n\r\n\r\n# The Basics\r\n\r\n\r\n## Types\r\n\r\n@docs Order, Grid, Location\r\n\r\n\r\n## Rule\r\n\r\n@docs RuleExpression, Neighborhood, anyNeighborhood, Rule\r\n\r\n\r\n## Automata Without Symmetry\r\n\r\n@docs step, Automata, automataWithoutSymmetry\r\n\r\n\r\n# Symmetries\r\n\r\nNow that we specify our own state, it is no longer possible to write a\r\n`fullSymmetry`-function (and it is not adviced to do so).\r\n\r\n\r\n## Symmetry\r\n\r\n@docs Symmetry, noSymmetry, horMirrorSymmetry, vertMirrorSymmetry, rot45Symmetry, rot90Symmetry\r\n\r\n\r\n## Automata\r\n\r\n@docs automata\r\n\r\n\r\n## Helpful sub-functions\r\n\r\n@docs mapNeighborhood\r\n\r\n","unions":[{"name":"RuleExpression","comment":" RuleExpressions give us a very flexible way of talking about neighbors.\r\n\r\nSaying something is `Anything`, it means its value is ignored.\r\n\r\n","args":["state"],"cases":[["Exactly",["state"]],["Anything",[]]]}],"aliases":[{"name":"Automata","comment":" The Automata type can be seen as a config type.\r\n\r\nIts stores all information to specify the behaviour of a cell automata.\r\nSometimes more then one automata should act on to the same `Grid`.\r\nFor this reason it is its own type.\r\n","args":["state"],"type":"CellAutomata.General.Automata (CellAutomata.Neighborhood (Maybe.Maybe state)) (CellAutomata.Neighborhood (CellAutomata.RuleExpression (Maybe.Maybe state))) CellAutomata.Location state"},{"name":"Grid","comment":" The grid is the _model_ of this module.\r\n\r\nYou might want to write your own view function for it\r\nor else you can't see what the automata has done.\r\n\r\nIn your head you should think of this as a grid, where some cells are filled in.\r\nIn fact, only the filled cells are stored in the Dict.\r\n\r\nCells have the type `Maybe state` where `state` should be a custom type.\r\n(See CellAutomata.LifeLike for a idea of how the state may be implemented.)\r\n\r\n","args":["state"],"type":"Dict.Dict CellAutomata.Location state"},{"name":"Location","comment":" The location is the unique identifier for any cell.\r\nFor our purpose we use `(x,y)`-coordinates.\r\n\r\n**Note:** The south of `(0,0)` is `(0,y)` while the north is `(0,-y)`.\r\n\r\n","args":[],"type":"( Basics.Int, Basics.Int )"},{"name":"Neighborhood","comment":" The Neighborhood of a cell consists of the 8 surounding cells.\r\n\r\nIf some neighbor may have any value (that is most often the case),\r\nits best to use the anyNeighborhood template and start from there.\r\n\r\n","args":["state"],"type":"{ north : state, northEast : state, east : state, southEast : state, south : state, southWest : state, west : state, northWest : state }"},{"name":"Order","comment":" Every state needs a defined order.\r\n(a function that gives each state a unique identifer)\r\n\r\nFor our ant example we define the following order:\r\n\r\n order maybeState =\r\n case maybeState of\r\n Nothing ->\r\n 0\r\n\r\n Just Wall ->\r\n 1\r\n\r\n Just Up ->\r\n 2\r\n\r\n Just Down ->\r\n 3\r\n\r\n Just Left ->\r\n 4\r\n\r\n Just Right ->\r\n 5\r\n\r\n","args":["state"],"type":"Maybe.Maybe state -> Basics.Int"},{"name":"Rule","comment":" A rule consist of the following elements:\r\n\r\n - **from** - the state of the cell\r\n - **neighbors** - the nessesary pattern of the neighbors\r\n - **to** - the state, the cell will transition in, if the rule applies\r\n\r\n","args":["state"],"type":"{ from : Maybe.Maybe state, neighbors : CellAutomata.Neighborhood (CellAutomata.RuleExpression (Maybe.Maybe state)), to : Maybe.Maybe state }"},{"name":"Symmetry","comment":" A symmetry is just a function that determines when a rule is sucessfully applied.\r\nIf so, it returns the new state.\r\n","args":["state"],"type":"Maybe.Maybe state -> CellAutomata.Neighborhood (Maybe.Maybe state) -> CellAutomata.Rule state -> Maybe.Maybe (Maybe.Maybe state)"}],"values":[{"name":"anyNeighborhood","comment":" This template helps defining a Neighborhood.\r\n\r\nFor example, if we would want to only consider the north neighbor,\r\nwe might specify it the following way\r\n\r\n { anyNeighborhood\r\n | north = Exactly a\r\n }\r\n\r\n","type":"CellAutomata.Neighborhood (CellAutomata.RuleExpression (Maybe.Maybe state))"},{"name":"automata","comment":" With this function we can now add our own symmetry.\r\n\r\nThe previous example can now be implemented the following way:\r\n\r\n let\r\n rotState : State -> State\r\n rotState state =\r\n case state of\r\n Up ->\r\n Right\r\n\r\n Right ->\r\n Down\r\n\r\n Down ->\r\n Left\r\n\r\n Left ->\r\n Up\r\n\r\n a ->\r\n a\r\n in\r\n ( List.concat\r\n [ [Up,Left,Right,Down]\r\n |> List.map\r\n (\\dir ->\r\n { from = Just dir\r\n , neighbors = anyNeighborhood\r\n , to = Nothing\r\n }\r\n )\r\n , [ { from = Nothing\r\n , to = Just Up\r\n , neighbors =\r\n { anyNeighborhood\r\n | south = Exactly <| Just Up\r\n , southEast = Exactly <| Just Wall\r\n }\r\n }\r\n , { from = Nothing\r\n , to = Just Right\r\n , neighbors =\r\n { anyNeighborhood\r\n | south = Exactly <| Just Wall\r\n , west = Exactly <| Just Up }\r\n }\r\n , { from = Nothing\r\n , to = Just Right\r\n , neighbors =\r\n { anyNeighborhood\r\n | southWest = Exactly <| Just Wall\r\n , west = Exactly <| Just Down }\r\n }\r\n ]\r\n ]\r\n )\r\n |> automata (rot90Symmetry rotState) order\r\n\r\n**Note:** for now the symmetry can not effect the original `.from` state.\r\nThis will hopefully chance in the future.\r\n","type":"CellAutomata.Symmetry state -> CellAutomata.Order state -> List.List (CellAutomata.Rule state) -> CellAutomata.Automata state"},{"name":"automataWithoutSymmetry","comment":" This function uses no symmetry, this means every possible combination must be\r\nspecified.\r\n\r\n automataWithoutSymmetry =\r\n automataWithCustomSymmetry noSymmetry\r\n\r\n**This function is not useful in practice.**\r\n**Most often you want at least rotational or mirrored symmetry**\r\n**This function is only included for demonstration purposes**\r\n\r\nCheckout CellAutomata.LifeLike for a more detailed discribtion.\r\n\r\nFor our example with the ant, that escapes any mase by following the right wall,\r\nthis could be implemented the following way:\r\n\r\n [ { from = Just Up, neighbors = anyNeighborhood, to = Nothing }\r\n , { from = Just Down, neighbors = anyNeighborhood, to = Nothing }\r\n , { from = Just Left, neighbors = anyNeighborhood, to = Nothing }\r\n , { from = Just Right, neighbors = anyNeighborhood, to = Nothing }\r\n , { from = Nothing, to = Just Up, neighbors = { anyNeighborhood | south = Exactly <| Just Up, southEast = Exactly <| Just Wall } }\r\n , { from = Nothing, to = Just Right, neighbors = { anyNeighborhood | south = Exactly <| Just Wall, west = Exactly <| Just Up } }\r\n , { from = Nothing, to = Just Right, neighbors = { anyNeighborhood | west = Exactly <| Just Right, southWest = Exactly <| Just Wall } }\r\n , { from = Nothing, to = Just Down, neighbors = { anyNeighborhood | west = Exactly <| Just Wall, north = Exactly <| Just Right } }\r\n , { from = Nothing, to = Just Down, neighbors = { anyNeighborhood | north = Exactly <| Just Right, northWest = Exactly <| Just Wall } }\r\n , { from = Nothing, to = Just Left, neighbors = { anyNeighborhood | north = Exactly <| Just Wall, east = Exactly <| Just Down } }\r\n , { from = Nothing, to = Just Left, neighbors = { anyNeighborhood | east = Exactly <| Just Right, northEast = Exactly <| Just Wall } }\r\n , { from = Nothing, to = Just Up, neighbors = { anyNeighborhood | east = Exactly <| Just Wall, south = Exactly <| Just Left } }\r\n ]\r\n |> automataWithoutSymmetry order\r\n\r\nThis code is on purpose more complicated as it should be.\r\nIf possible one should always use a custom symmetry.\r\n\r\n","type":"CellAutomata.Order state -> List.List (CellAutomata.Rule state) -> CellAutomata.Automata state"},{"name":"horMirrorSymmetry","comment":" Pattern may be horizontally mirrored\r\n\r\nThe first argument is a function `(state -> state)` that states how the values of\r\nthe state can be mirrored (horizontally).\r\nUse the `identity` function if you do not see a need in specifing the first arguement.\r\n\r\nAs example, given the state\r\n\r\n State =\r\n Up\r\n | Down\r\n | Left\r\n | Right\r\n\r\nWe can specify a symmetry the following way\r\n\r\n horMirrorSymmetry\r\n (\\state ->\r\n case state of\r\n Up ->\r\n Down\r\n\r\n Down ->\r\n Up\r\n\r\n a ->\r\n a\r\n )\r\n\r\n","type":"(state -> state) -> Maybe.Maybe state -> CellAutomata.Neighborhood (Maybe.Maybe state) -> CellAutomata.Rule state -> Maybe.Maybe (Maybe.Maybe state)"},{"name":"mapNeighborhood","comment":" Transforms a neighborhood.\r\n\r\nIt takes a function `a -> b` in order to transform a `Neighborhood a` to `Neighborhood b`\r\n","type":"(a -> b) -> CellAutomata.Neighborhood a -> CellAutomata.Neighborhood b"},{"name":"noSymmetry","comment":" Every possible way the neighbors might be arranged needs its own rule.\r\n","type":"Maybe.Maybe state -> CellAutomata.Neighborhood (Maybe.Maybe state) -> CellAutomata.Rule state -> Maybe.Maybe (Maybe.Maybe state)"},{"name":"rot45Symmetry","comment":" Pattern may be rotated in any position.\r\n\r\nThe first argument is a function (state -> state) that states how the values of\r\nthe state can be rotated (clock-wise).\r\nUse the identity function if you dont see a need in specifing the first arguement.\r\n\r\nAs example, given the state\r\n\r\n State =\r\n North\r\n | NorthEast\r\n | East\r\n | SouthEast\r\n | South\r\n | SouthWest\r\n | West\r\n | NorthWest\r\n\r\nWe can specify the symmetry the following way\r\n\r\n rot45Symmetry\r\n (\\state ->\r\n case state of\r\n North ->\r\n NorthEast\r\n\r\n NorthEast ->\r\n East\r\n\r\n East ->\r\n SouthEast\r\n\r\n SouthEast ->\r\n South\r\n\r\n South ->\r\n SouthWest\r\n\r\n SouthWest ->\r\n West\r\n\r\n South ->\r\n NorthWest\r\n\r\n NorthWest ->\r\n North\r\n )\r\n\r\n","type":"(state -> state) -> Maybe.Maybe state -> CellAutomata.Neighborhood (Maybe.Maybe state) -> CellAutomata.Rule state -> Maybe.Maybe (Maybe.Maybe state)"},{"name":"rot90Symmetry","comment":" Pattern may be rotated in 90,180 and 270 degree angles.\r\n\r\nThe first argument is a function (state -> state) that states how the values of\r\nthe state can be rotated (clock-wise).\r\nUse the identity function if you dont see a need in specifing the first arguement.\r\n\r\nAs example, given the state\r\n\r\n State =\r\n Left\r\n | Right\r\n | Up\r\n | Down\r\n\r\nWe can specify the symmetry the following way\r\n\r\n rot90Symmetry\r\n (\\state ->\r\n case state of\r\n Left ->\r\n Down\r\n\r\n Down ->\r\n Right\r\n\r\n Right ->\r\n Up\r\n\r\n Up ->\r\n Left\r\n )\r\n\r\n","type":"(state -> state) -> Maybe.Maybe state -> CellAutomata.Neighborhood (Maybe.Maybe state) -> CellAutomata.Rule state -> Maybe.Maybe (Maybe.Maybe state)"},{"name":"step","comment":" This is the main function.\r\nIt has a wierd type, but thats because it is meant to be used with Dict.update:\r\n\r\n List.range 0 12\r\n |> List.foldl\r\n (\\x g ->\r\n List.range 0 10\r\n |> List.foldl\r\n (\\y ->\r\n Dict.update\r\n ( x, y )\r\n ( ( x, y )\r\n |> step automata grid\r\n )\r\n )\r\n g\r\n )\r\n grid\r\n\r\n","type":"CellAutomata.Automata state -> CellAutomata.Grid state -> CellAutomata.Location -> Maybe.Maybe state -> Maybe.Maybe state"},{"name":"vertMirrorSymmetry","comment":" Pattern may be vertically mirrored\r\n\r\nThe first argument is a function (state -> state) that states how the values of\r\nthe state can be mirrored (vertically).\r\nUse the identity function if you dont see a need in specifing the first arguement.\r\n\r\nAs example, given the state\r\n\r\n State =\r\n Up\r\n | Down\r\n | Left\r\n | Right\r\n\r\nWe can specify the symmetry the following way\r\n\r\n vertMirrorSymmetry\r\n (\\state ->\r\n case state of\r\n Left ->\r\n Right\r\n\r\n Right ->\r\n Left\r\n\r\n a ->\r\n a\r\n )\r\n\r\n","type":"(state -> state) -> Maybe.Maybe state -> CellAutomata.Neighborhood (Maybe.Maybe state) -> CellAutomata.Rule state -> Maybe.Maybe (Maybe.Maybe state)"}],"binops":[]},{"name":"CellAutomata.LifeLike","comment":" \r\nThis module was created to give a smooth introduction to the main module, \r\nbut also because for a lot of use cases this simpler version is already enough.\r\n\r\n**If you know of Conway's Game of Life and want to make something similiar,** \r\n**this module is the right one for you**\r\n\r\nIn this module, a few assumptions about the automata were made:\r\n* The cells are organiced in a two dimensional grid.\r\n* Each cell can have on of two states: *Dead*(`Nothing`) or *Alive*(`Just Alive`)\r\n* Each cell has eight neighbors\r\n* A rule can only take the amount of alive neighbored cells into account. (Not the pattern)\r\n\r\n**Note:** This last assumption can be ignored by using\r\n`automataWithoutSymmetry`(the exact pattern must the matched) \r\nor `automataWithCustomSymmetry`(for example mirrored or rotational symmetry).\r\n\r\n# The Basics\r\n## Basic Types\r\n@docs Grid,State,Location\r\n\r\n## Basic Automata\r\n@docs AliveNeighbors,step,Automata,automata\r\n\r\n# Rule Expressions and Symmetries\r\nUp until now, only the amound of living neighbors where important, but not their position. \r\n\r\nFor the remaining documentation we use a modified version of game of life, \r\nwhere only the four direct neighbors (North,South,East,West) are considered. \r\n\r\n## Rule\r\n@docs RuleExpression,Neighborhood,anyNeighborhood,Rule\r\n\r\n## Automata\r\n@docs automataWithoutSymmetry\r\n\r\n## Symmetry\r\n@docs Symmetry,fullSymmetry,noSymmetry,horMirrorSymmetry,vertMirrorSymmetry,rot45Symmetry,rot90Symmetry\r\n\r\n## Automata with Symmetry\r\n@docs automataWithCustomSymmetry\r\n","unions":[{"name":"AliveNeighbors","comment":" This type specifies how many neighbors may be alive.\r\n","args":[],"cases":[["AllDead",[]],["OneAlive",[]],["TwoAlive",[]],["ThreeAlive",[]],["FourAlive",[]],["FiveAlive",[]],["SixAlive",[]],["SevenAlive",[]],["EightAlive",[]],["AnyAmount",[]]]},{"name":"RuleExpression","comment":" RuleExpressions give us a very flexible way of talking about neighbors.\r\n\r\nWhen writing a rule for the neighbors, they can now have one of the following values: \r\n* **(Exactly <| Just Alive)** - its alive\r\n* **(Exactly <| Nothing)** - its dead\r\n* **Anything** - it may be dead or alive - we dont care.\r\n\r\n**Note:**\r\nIf you would go back to counting the alive neighbors, the `Anything`-expression will\r\nact like an optional neighbor. \r\nFor example a rule that looks for 3 `Alive` and 2 `Anything`, \r\nits will be successfull if it finds either 3,4 or 5 alive neighbors. \r\n","args":["state"],"cases":[["Exactly",["state"]],["Anything",[]]]},{"name":"State","comment":" The State will specify all posible states a Cell can be in (besides a empty Cell)\r\n\r\nThis means cells will be of type `Maybe State`. \r\nThis way its clear that, if not specified otherwise, a cell will be `Nothing`. \r\nIn this module there is just one other state: `Just Alive`. \r\nIf you want to add more states, then you should go to the main module.\r\n","args":[],"cases":[["Alive",[]]]}],"aliases":[{"name":"Automata","comment":" The Automata type can be seen as a config type. \r\nIts stores all information to specify the behaviour of a cell automata. \r\nSometimes more then one automata should act on to the same Grid. \r\nFor this reason it is its own type.\r\n","args":[],"type":"CellAutomata.General.Automata (CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State)) (CellAutomata.LifeLike.Neighborhood (CellAutomata.LifeLike.RuleExpression (Maybe.Maybe CellAutomata.LifeLike.State))) CellAutomata.LifeLike.Location CellAutomata.LifeLike.State"},{"name":"Grid","comment":" The grid is the `model` of this module.\r\n\r\nYou might want to write your own view function for it or else you can't see what the automata has done.\r\n\r\nIn your head you should think of this as a grid, where some cells are filled in. \r\nIn fact, only the filled cells are stored in the Dict. \r\nFilled cells have the value `Just Alive` while empty cells have the value `Nothing`. \r\nThis is why we represent the grid as a dictionary.\r\n","args":[],"type":"Dict.Dict CellAutomata.LifeLike.Location CellAutomata.LifeLike.State"},{"name":"Location","comment":" The location is the unique identifier for any cell. \r\nFor our purpose we use `(x,y)`-coordinates.\r\n\r\n**Note:** The south of `(0,0)` is `(0,y)` while the north is `(0,-y)`.\r\n","args":[],"type":"( Basics.Int, Basics.Int )"},{"name":"Neighborhood","comment":" This replaces the `AliveNeighbors` type.\r\n\r\nInstead of saying \"one alive neighbor\", we now need to explicitly specify where\r\nthis neighbor is located.\r\n\r\nIf some neighbor may have any value (that is most often the case), \r\nits best to use the anyNeighborhood template and start from there. \r\n","args":["state"],"type":"{ north : state, northEast : state, east : state, southEast : state, south : state, southWest : state, west : state, northWest : state }"},{"name":"Rule","comment":" A rule now needs a Neighborhood instead of an `AliveNeighbors`-value.\r\n","args":[],"type":"{ from : Maybe.Maybe CellAutomata.LifeLike.State, neighbors : CellAutomata.LifeLike.Neighborhood (CellAutomata.LifeLike.RuleExpression (Maybe.Maybe CellAutomata.LifeLike.State)), to : Maybe.Maybe CellAutomata.LifeLike.State }"},{"name":"Symmetry","comment":" A symmetry is just a function that determines when a rule is sucessfully applied.\r\nIf so, it returns the new state.\r\nDuring this documentation we have already encountered two different symmetries: \r\n`fullSymmetry` and `noSymmetry`.\r\n","args":[],"type":"Maybe.Maybe CellAutomata.LifeLike.State -> CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State) -> CellAutomata.LifeLike.Rule -> Maybe.Maybe (Maybe.Maybe CellAutomata.LifeLike.State)"}],"values":[{"name":"anyNeighborhood","comment":" this template helps defining a Neighborhood.\r\n\r\nFor example, if we would want to only consider the 4 adjacent neighbors,\r\nwe might specify it the following way\r\n\r\n {anyNeighborhood\r\n | north : Exactly a\r\n , east : Exactly b\r\n , south : Exactly c\r\n , west : Exactly d\r\n }\r\n","type":"CellAutomata.LifeLike.Neighborhood (CellAutomata.LifeLike.RuleExpression (Maybe.Maybe CellAutomata.LifeLike.State))"},{"name":"automata","comment":" The input is a list of rules. \r\n[As an example](orasund.github.io/elm-cellautomata/GameOfLife), lets look at the rules for conway's game of life:\r\n* Alive cells survive if they have 2 or 3 alive neighbors, else they die.\r\n* Dead cells turn alive if exactly 3 neighbors are alive.\r\n\r\nImplemented, these rules look like this:\r\n\r\n [ { from = Just Alive\r\n , neighbors = TwoAlive\r\n , to = Just Alive\r\n }\r\n , { from = Just Alive\r\n , neighbors = ThreeAlive\r\n , to = Just Alive\r\n }\r\n , { from = Just Alive\r\n , neighbors = AnyAmount\r\n , to = Nothing\r\n }\r\n , { from = Nothing\r\n , neighbors = ThreeAlive\r\n , to = Just Alive\r\n }\r\n ]\r\n\r\nThe order of the rules are important: the automata will go through the list, \r\nand use the first use it can apply.\r\n","type":"List.List { from : Maybe.Maybe CellAutomata.LifeLike.State, neighbors : CellAutomata.LifeLike.AliveNeighbors, to : Maybe.Maybe CellAutomata.LifeLike.State } -> CellAutomata.LifeLike.Automata"},{"name":"automataWithCustomSymmetry","comment":" With this function we can now add our own symmetry.\r\n\r\nGoing back to the old example, this can now be done the following way:\r\n\r\n let\r\n neighbors a b c d = \r\n {anyNeighborhood\r\n | north = Exactly a\r\n , east = Exactly b\r\n , south = Exactly c\r\n , west = Exactly d\r\n }\r\n in\r\n [ {from = Just Alive\r\n , to = Just Alive\r\n , neighbors = neighbors (Just Alive) Nothing Nothing Nothing\r\n }\r\n , {from = Just Alive\r\n , to = Nothing\r\n , neighbors = anyNeighborhood\r\n }\r\n , {from = Nothing\r\n , to = Just Alive\r\n , neighbors = neighbors (Just Alive) Nothing Nothing Nothing\r\n }\r\n ]\r\n |> automataWithCustomSymmetry rot90Symmetry\r\n","type":"CellAutomata.LifeLike.Symmetry -> List.List CellAutomata.LifeLike.Rule -> CellAutomata.LifeLike.Automata"},{"name":"automataWithoutSymmetry","comment":" This function uses no symmetry, this means every possible combination must be\r\nspecified.\r\n\r\n automataWithoutSymmetry =\r\n automataWithCustomSymmetry noSymmetry\r\n\r\n**This function is not useful in practice.** \r\n**Most often you want at least rotational or mirrored symmetry** \r\n**This function is only included for demonstration purposes**\r\n\r\n[For example](orasund.github.io/elm-cellautomata/modGoL), lets say we want to modify conway's game of life, such that\r\nit only considers the four adjacent neighbors:\r\n* Alive cells survive if they have exactly 1 adjacent neighbors\r\n* Dead cells turn alive if exactly 1 neighbors are alive\r\n\r\nThe implementation would be the following list:\r\n\r\n let\r\n neighbors a b c d = \r\n {anyNeighborhood\r\n | north = Exactly a\r\n , east = Exactly b\r\n , south = Exactly c\r\n , west = Exactly d\r\n }\r\n in\r\n [ {from = Just Alive\r\n , to = Just Alive\r\n , neighbors = neighbors (Just Alive) Nothing Nothing Nothing\r\n }\r\n , {from = Just Alive\r\n , to = Just Alive\r\n , neighbors = neighbors Nothing (Just Alive) Nothing Nothing\r\n }\r\n , {from = Just Alive\r\n , to = Just Alive\r\n , neighbors = neighbors Nothing Nothing (Just Alive) Nothing\r\n }\r\n , {from = Just Alive\r\n , to = Just Alive\r\n , neighbors = neighbors Nothing Nothing Nothing (Just Alive)\r\n }\r\n , {from = Just Alive, to = Nothing, neighbors = anyNeighborhood}\r\n , {from = Nothing\r\n , to = Just Alive\r\n , neighbors = neighbors (Just Alive) Nothing Nothing Nothing\r\n }\r\n , {from = Nothing\r\n , to = Just Alive\r\n , neighbors = neighbors Nothing (Just Alive) Nothing Nothing\r\n }\r\n , {from = Nothing\r\n , to = Just Alive\r\n , neighbors = neighbors Nothing Nothing (Just Alive) Nothing\r\n }\r\n , {from = Nothing\r\n , to = Just Alive\r\n , neighbors = neighbors Nothing Nothing Nothing (Just Alive)\r\n }\r\n ]\r\n\r\nAs one can tell, that example blew up. Thats because we did not use any symmetry.\r\n","type":"List.List CellAutomata.LifeLike.Rule -> CellAutomata.LifeLike.Automata"},{"name":"fullSymmetry","comment":" The position of the neighbors is not important, only the amount.\r\n","type":"Maybe.Maybe CellAutomata.LifeLike.State -> CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State) -> CellAutomata.LifeLike.Rule -> Maybe.Maybe (Maybe.Maybe CellAutomata.LifeLike.State)"},{"name":"horMirrorSymmetry","comment":" Pattern may be horizontally mirrored\r\n","type":"Maybe.Maybe CellAutomata.LifeLike.State -> CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State) -> CellAutomata.LifeLike.Rule -> Maybe.Maybe (Maybe.Maybe CellAutomata.LifeLike.State)"},{"name":"noSymmetry","comment":" Every possible way the neighbors might be arranged needs its own rule.\r\n","type":"Maybe.Maybe CellAutomata.LifeLike.State -> CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State) -> CellAutomata.LifeLike.Rule -> Maybe.Maybe (Maybe.Maybe CellAutomata.LifeLike.State)"},{"name":"rot45Symmetry","comment":" Pattern may be rotated in any position.\r\n","type":"Maybe.Maybe CellAutomata.LifeLike.State -> CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State) -> CellAutomata.LifeLike.Rule -> Maybe.Maybe (Maybe.Maybe CellAutomata.LifeLike.State)"},{"name":"rot90Symmetry","comment":" Pattern may be rotated in 90,180 and 270 degree angles.\r\n","type":"Maybe.Maybe CellAutomata.LifeLike.State -> CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State) -> CellAutomata.LifeLike.Rule -> Maybe.Maybe (Maybe.Maybe CellAutomata.LifeLike.State)"},{"name":"step","comment":" This is the main function. \r\nIt has a wierd type, but thats because it is meant to be used with Dict.update:\r\n\r\n List.range 0 12\r\n |> List.foldl\r\n (\\x g ->\r\n List.range 0 10\r\n |> List.foldl\r\n (\\y ->\r\n Dict.update\r\n (x,y)\r\n ( (x,y) |> step automata grid )\r\n )\r\n g\r\n )\r\n grid\r\n","type":"CellAutomata.LifeLike.Automata -> CellAutomata.LifeLike.Grid -> CellAutomata.LifeLike.Location -> Maybe.Maybe CellAutomata.LifeLike.State -> Maybe.Maybe CellAutomata.LifeLike.State"},{"name":"vertMirrorSymmetry","comment":" Pattern may be vertically mirrored\r\n","type":"Maybe.Maybe CellAutomata.LifeLike.State -> CellAutomata.LifeLike.Neighborhood (Maybe.Maybe CellAutomata.LifeLike.State) -> CellAutomata.LifeLike.Rule -> Maybe.Maybe (Maybe.Maybe CellAutomata.LifeLike.State)"}],"binops":[]}]