!fl[      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ (C) 2018-18 Edward Wastell!MIT -style (see the file LICENSE)!Edward Wastell <ed@wastell.co.uk> provisionalNone &'.1SUVXk& sized-gridXMagic is stole from Constraints, and I don't really understand it, but it is needed for  sized-gridA type constraint for getting SingI sized-gridA singleton type for Bools sized-gridZGive a runtime representation of a type level number being less than or equal than another sized-grid A Dict prove that m - 1 + 1 is m sized-gridAlso don't understand sized-gridARuntime proof that n - m is an insance of KnownNat if n and m are None&',-.1=>?@AHSUVXk sized-gridlAn Ordinal can only hold m different values, ususally corresponding to 0 .. m - 1. We store it here using a L of a type level number and use constraints to keep the required invariants.zDesprite represeting a number, Ordinal is not an instance of Num and many functions (such as negate) would only be partial sized-gridEConvert a normal integral to an ordinal. If it is outside the range ( 0or= m), Nothing is returned. sized-grid&Transform an ordinal to a given number  sized-grid9Convert between an ordinal and a usual number. This is a Prism as it may fail as Oridnals# can only exist in a certain range.  None-.8=>?HSUVXk* sized-gridKEverything that can be uses as a Coordinate. The only required function is  and the type instance of (: the rest can be derived automatically.This is kind * -> Constraint for ease of use later. There is some argument that it should be of kind (Nat -> *) -> Constraint and we could remove ", but that has other complications sized-grid2The maximum number of values that a Coord can take sized-gridWAs each coord represents a finite number of states, it must be isomorphic to an Ordinal sized-grid#The origin. If c is an instance of , this should be mempty sized-grid Retrive a  of the size sized-grid'The largest possible number expressable! sized-gridProof an idiom about how 9 works. This relies on 'CoordFromNat a (CoordSized a ~ a'$ sized-grid2Enumerate all possible values of a coord, in order !"#$!"# $None-.1=>?HMUVXk-& sized-grid8A coordinate with periodic boundaries, as if on a taurus&'(&'(None .1>HMUVXk.7 sized-grid$A coordinate that clamps its numbers789789None%-.7=>?@AHSUVXghkBN sized-grid2All Diffs of the members of the list must be equalO sized-gridMThe number of elements a coord can have. This is equal to the product of the  of each elementP sized-gridApply d to each element of a type level list. This is required as type families can't be partially applied.Q sized-gridOThe type of difference between two coords. A n-dimensional coord should have a  of an n-tuple of Integers . We use F and our 1-tuple. Unfortuantly, each instance is manual at the moment.R sized-gridA multideminsion coordinateU sized-gridLength of a type level listZ sized-gridaGet the first element of a coord. Thanks to type level information, we can write this as a total [ sized-gridA  into the the tail of R\ sized-grid-Turn a single element into a one dimensional R] sized-gridAdd a new element to a R#. This increases the dimensionality^ sized-grid%Generate all possible coords in order_ sized-grid Convert a R to its position in a vector` sized-gridECalculate the Moore neighbourhood around a point. Includes the centera sized-gridJCalculate the von Neuman neighbourhood around a point. Includes the centerb sized-grid$Swap x and y for a coord in 2D spacec sized-gridThe zero position for a coordHIJKLMNOPQRSTUVWXYZ[\]^_`abcURSTXWVYZ[\]QP^O_N`abcLMJKHIW5None./14567=>?@ACHMSUVXhkP*| sized-grid2A Constraint that all grid sizes are instances of } sized-gridGiven a grid type, give back a series of nested lists repesenting the grid. The lists will have a number of layers equal to the dimensionality.~ sized-grid/All but the first elements of a type level list sized-grid&The first element of a type level list sized-gridA multi dimensional sized grid sized-grid Convert a vector into a list of Vector:s, where all the elements of the list have the given size. sized-grid~Convert a grid to a series of nested lists. This removes type level information, but it is sometimes easier to work with lists sized-gridrConvert a series of nested lists to a grid. If the size of the grid does not match the size of lists this will be z{|}~~}|z{None 456=>?@AMU sized-grid Similar to ], but this has a focus on a certain square. Becuase of this we loose some instances, such as , but we gain a  and R instance. We can convert between a focused and unfocused list using facilites in IsGrid None =>?@ACSXY sized-gridConversion between  and  and access grids at a R sized-gridPGet the element at a grid location. This is a lens because we know it must exist sized-grid&Convert to, or run a function over, a  sized-grid&Convert to, or run a function over, a NoneZ"Y  !"#$&'(789HIJKLMNOPQRSTUVWXYZ[\]^_`abcz{|}~      !"#$%&'()*+,-./01233456789:;<=>?@ABCCDEFGHIJKLMNOPQRSTUVWXYZ[\]]^_`abcdefghijklmnopqrstuvwxyz{|}~       )sized-grid-0.1.1.5-KU5jkLUCL2P2O7tFE4dPdR SizedGridSizedGrid.OrdinalSizedGrid.Coord.ClassSizedGrid.Coord.PeriodicSizedGrid.Coord.HardWrapSizedGrid.CoordSizedGrid.Grid.GridSizedGrid.Grid.FocusedSizedGrid.Grid.ClassSizedGrid.Internal.Type+generics-sop-0.3.2.0-1LIoMWx8QIZINcf2OfoAbyGenerics.SOP.ConstraintAllComposeGenerics.SOP.SingSListIGenerics.SOP.BasicFunctorsIOrdinal numToOrdinal ordinalToNumstrengthenOrdinal weakenOrdinal_Ordinal$fFromJSONKeyOrdinal$fToJSONKeyOrdinal$fFromJSONOrdinal$fToJSONOrdinal $fEnumOrdinal$fBoundedOrdinal$fRandomOrdinal $fOrdOrdinal $fEqOrdinal $fShowOrdinalIsCoord CoordSized CoordFromNat asOrdinal zeroPosition sCoordSized maxCoordSizemaxCoord asSizeProxy weakenIsCoordstrengthenIsCoordcoordFromNatCollapsecoordFromNatSamecoordSizedCollapse allCoordLike$fIsCoordOrdinalPeriodic unPeriodic$fAffineSpacePeriodic$fAdditiveGroupPeriodic$fMonoidPeriodic$fSemigroupPeriodic$fIsCoordPeriodic$fEnumPeriodic $fEqPeriodic$fShowPeriodic $fOrdPeriodic$fFromJSONKeyPeriodic$fFromJSONPeriodic$fToJSONKeyPeriodic$fToJSONPeriodic$fRandomPeriodicHardWrap unHardWrap$fAffineSpaceHardWrap$fMonoidHardWrap$fSemigroupHardWrap$fIsCoordHardWrap $fEqHardWrap$fShowHardWrap $fOrdHardWrap$fFromJSONKeyHardWrap$fToJSONKeyHardWrap$fFromJSONHardWrap$fToJSONHardWrap$fBoundedHardWrap$fEnumHardWrap$fRandomHardWrapStrengthenCoordstrengthenCoord WeakenCoord weakenCoord AllSizedKnown sizeProof AllDiffSame MaxCoordSizeMapDiff CoordDiffCoordunCoordLength EmptyCoord:| coordSplit _WrappedCoord coordHead coordTail singleCoord appendCoordallCoord coordPosition moorePointsvonNeumanPoints tranposeCoord zeroCoord$fField5CoordCoordee'$fField4CoordCoorddd'$fField3CoordCoordcc'$fField2CoordCoordbb'$fField1CoordCoordaa' $fRandomCoord$fAdditiveGroupCoord $fMonoidCoord$fSemigroupCoord$fFromJSONCoord $fToJSONCoord $fShowCoord $fOrdCoord $fEqCoord$fAffineSpaceCoord$fAllSizedKnown:$fAllSizedKnown[]$fWeakenCoord::$fWeakenCoord[][]$fStrengthenCoord::$fStrengthenCoord[][]$fGenericCoordShrinkableGrid shrinkGridAllGridSizeKnown CollapseGridTailHeadGridunGridsplitVectorBySize collapseGrid gridFromList transposeGrid splitGrid combineGridcombineHigherDimdropGridtakeGridsplitHigherDim mapLowerDim$fTraversableWithIndexCoordGrid$fFoldableWithIndexCoordGrid$fFunctorWithIndexCoordGrid$fRepresentableGrid$fDistributiveGrid $fMonadGrid$fApplicativeGrid$fFromJSONGrid $fToJSONGrid$fShrinkableGrid:::$fShrinkableGrid[][][]$fEqGrid $fShowGrid $fFunctorGrid$fFoldableGrid$fTraversableGrid $fEq1Grid $fShow1Grid $fGenericGrid FocusedGrid focusedGridfocusedGridPosition$fComonadStoreCoordFocusedGrid$fComonadFocusedGrid$fFunctorFocusedGrid$fFoldableFocusedGrid$fTraversableFocusedGridIsGrid gridIndexasGrid asFocusedGrid$fIsGridcsFocusedGrid$fIsGridcsGridMagictakeNatSBoolISBool sLessThan takeAddIsIdmagicsBoolSFalseSTruebase Data.ProxyProxyGHC.BaseMonoid(vector-space-0.15-HnRnSSynu3s4SPvn0XtjI0Data.AffineSpaceDiffData.Functor.IdentityIdentity lens-4.17-CT4JBnbANTY4Ofd5JvefG9Control.Lens.TypeLens GHC.TypeNatsKnownNat GHC.MaybeNothing Applicative$comonad-5.0.4-LBYV6BL1bh79y2u8lDkjRdControl.ComonadComonadControl.Comonad.Store.Class ComonadStore