!ic]j      !"#$%&'()*+,-./0123456789:;<=>?@AB C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i None%&',-.1456=>?@AHMUVXgk XgridsThe index type for Grids.gridsSafely construct a ? for a given grid size, checking that all indexes are in range h> coord @[3, 3] [1, 2] Just [1, 2] > coord @[3, 3] [3, 3] Nothing > coord @[3, 3] [1, 2, 3] NothinggridsGet the first index from a grids Append two s gridsGet the total size of a Grid of the given dimensions gridSize @'[2, 2] == 4  None,-.456=>?@AHMUVXk 1None,-.456=>?@AHMUVXkgridsPRepresents valid dimensionalities. All non empty lists of Nats have an instancegridsaComputes the level of nesting requried to represent a given grid dimensionality as a nested list HNestedLists [2, 3] Int == [[Int]] NestedLists [2, 3, 4] Int == [[[Int]]]None,-.456=>?@AHMUVXk!"!"None,-.456=>?@AHMUVXk%L&grids An grid of arbitrary dimensions.e.g. a Grid [2, 3] Int might look like: Rgenerate id :: Grid [2, 3] Int fromNestedLists [[0,1,2], [3,4,5]])grids5Build a grid by selecting an element for each element*gridsTTurn a grid into a nested list structure. List nesting increases for each dimension BtoNestedLists (G.generate id :: Grid [2, 3] Int) [[0,1,2],[3,4,5]]+gridsyTurn a nested list structure into a Grid if the list is well formed. Required list nesting increases for each dimension fromNestedLists [[0,1,2],[3,4,5]] :: Maybe (Grid [2, 3] Int) Just (Grid [[0,1,2],[3,4,5]]) fromNestedLists [[0],[1,2]] :: Maybe (Grid [2, 3] Int) Nothing,gridsPartial variant of + which errors on malformed input-gridsRConvert a list into a Grid or fail if not provided the correct number of elements G.fromList [0, 1, 2, 3, 4, 5] :: Maybe (Grid [2, 3] Int) Just (Grid [[0,1,2],[3,4,5]]) G.fromList [0, 1, 2, 3] :: Maybe (Grid [2, 3] Int) Nothing.gridsPartial variant of - which errors on malformed input/gridsUpdate elements of a grid&'()*+,-./&'()*+,-./None,-.456=>?@AHMUVXk.k<gridsThe inverse of =[, joinGrid will nest a grid from: > Grid outer (Grid inner a) -> Grid (outer ++ inner) aIFor example, you can nest a simple 3x3 from smaller [3] grids as follows: <joinGrid (myGrid :: Grid [3] (Grid [3] a)) :: Grid '[3, 3] a=gridsThe inverse of <, splitGrid  outerDims [innerDims will un-nest a grid from: > Grid (outer ++ inner) a -> Grid outer (Grid inner a)4For example, you can unnest a simple 3x3 as follows: 6splitGrid @'[3] @'[3] myGrid :: Grid '[3] (Grid [3] a)<=<=None,-.456=>?@AHMSUVXk0 AgridsFocus an element of a & given its >?@A?>@A None,-.456=>?@AHMUVXk1 None,-.456=>?@AHMUVXkOuEgridsPerform a computation based on the context surrounding a cell Good for doing things like Linear Image Filters (e.g. gaussian blur) or simulating Cellular Automata (e.g. Conway's game of life)BThis function accepts a function which indicates what to do with 'out-of-bounds' indexes, I, J and K are examples.It also acccepts a transformation function which operates over the functor created by the first parameter and collapses it down to a new value for the cell at that position.This function is best used with Type Applications to denote the desired window size; the Grid passed to the given function contains the current cell (in the middle) and all the surrounding cells.Here's an example of computing the average of all neighbouring cells, repeating values at the edge of the grid when indexes are out of bounds (using I) gaussian :: (Dimensions dims) => Grid dims Double -> Grid dims Double gaussian = autoConvolute clampWindow avg where avg :: Grid '[3, 3] Double -> Double avg g = sum g / fromIntegral (length g)Fgrids#This is a fully generic version of E which allows the user to provide a function which builds a context from the current coord, then provides a collapsing function over the same functor.Ggrids+Given a coordinate generate a grid of size GM filled with coordinates surrounding the given coord. Mostly used internallyIgrids Use with EA; Clamp out-of-bounds coordinates to the nearest in-bounds coord.Jgrids Use with EL; Wrap out-of-bounds coordinates pac-man style to the other side of the gridKgrids Use with E; Out of bounds coords become jEgrids4Restrict out of bounds coordinates in some way. Use I, J or Kgrids$Collapse the context down to a valuegrids Starting gridFgridsDBuild a neighbouring context within a functor from the current coordgrids&Collapse the context to a single valuegrids Starting grid BCDEFGHIJK DEFGBCHIJK None,-.456=>?@ACHMUVXk]Ngrids9Get the inverse of a permutation pattern, used internallyQgridsPermute dimensions of a &/. This is similar to MatLab's permute functionQi requires a type application containing a permutation pattern; The pattern is a re-ordering of the list [0..n]P which represents the new dimension order. For example the permutation pattern  [1, 2, 0]! when applied to the dimensions  [4, 5, 6] results in the dimensions  [5, 6, 4].0For 2 dimensional matrixes, a permutation using [1, 0] is simply a matrix S > small fromNestedLists [[0,1,2] ,[3,4,5] ,[6,7,8]] > permute @[1, 0] small fromNestedLists [[0,3,6] ,[1,4,7] ,[2,5,8]]RgridsPPermute the dimensions of a coordinate according to a permutation pattern. see Q regarding permutation patternsSgrids0Transpose a 2 dimensional matrix. Equivalent to: permute @[1, 0]NOPQRSPOQRSNNone,-.456=>?@AHMUVXk^# &'()*+,-./<=ABEFIJKOPQRS#&'()+,-.*/AEFIJKSQR<= BOP None,-.456=>?@AHMUVXk`TUVWXYZ[\]^_`abTUVWXYZ[\]^_`ab None ,-.456=>?@AHMUVXkb"cdefghicdefghiNone,-.456=>?@AHMUVXkc8klmnopqrs !"#$%&'()*+,-./01234566789:;<=>?@ABCDEFGHIJKLMNOP Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w xyz{|}~$grids-0.3.0.0-3pJioitKwUSHPBml0MjZQl Data.GridData.Grid.Internal.CoordData.Grid.Internal.ErrorsData.Grid.Internal.NestedListsData.Grid.Internal.PrettyData.Grid.Internal.GridData.Grid.Internal.NestData.Grid.Internal.LensData.Grid.Internal.ConvolutionData.Grid.Internal.TransposeData.Grid.Examples.IntroData.Grid.Examples.ConwayData.Grid.Internal.Identity Paths_grids&adjunctions-4.4-IFPBFICXoDm8fM1a9ofrh7Data.Functor.RepindextabulateCoordunCoord:#coordunconsCappendC highestIndexclamp clampCoord wrapCoordgridSizecoerceCoordDims coordInBounds $fEnumCoord $fEnumCoord0$fBoundedCoord$fBoundedCoord0 $fNumCoord $fShowCoord $fIsListCoord $fEqCoord?! Dimensions nestLists unNestLists NestedListsAllC chunkVector $fDimensions:$fDimensions:0 PrettyList prettyList$fPrettyList[]$fPrettyList[]0$fPrettyList[]1GridtoVectorgenerate toNestedListsfromNestedListsfromNestedLists'fromList fromList'// $fNumGrid$fRepresentableGrid$fDistributiveGrid$fApplicativeGrid $fMonoidGrid$fSemigroupGrid $fShowGrid$fEqGrid $fFunctorGrid$fFoldableGrid$fTraversableGrid $fNFDataGridjoinGrid splitGridLens'Lenslenscell Neighboring neighbors criticalError autoConvolute convolutewindow neighboring clampWindow wrapWindow safeWindow$fNeighboring:$fNeighboring:0 InvertKeyValidPermutationPermutedpermute permuteCoord transpose simpleGrid coordGridavgmxsmallsmall'medbiggauss clampGaussseeNeighboringcoords doubleGrid simpleGauss pacmanGaussrulestepgliderstartsimulateshowBoolshowGridbase GHC.MaybeNothingversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName