Amy de Buitléir | 18 Feb 13:41 2013
Picon

Subject: ANNOUNCE: grid-3.0.1 (tile maps for board games or maths)

I'm happy to announce a new major release of the grid package:

    http://hackage.haskell.org/package/grid
    https://github.com/mhwombat/grid/wiki (wiki)

WHAT'S NEW:

Functions for reporting the boundary and centre of bounded grid have been added,
along with some miscellaneous new utility functions. IMPORTANT: The order of
parameters for some functions has changed to make it easier to use them with map
and fold operations.

ABOUT GRID:
Grid provides tools for working with regular arrangements of tiles, such as
might be used in a board game or self-organising map (SOM). Grid currently
supports triangular, square, and hexagonal tiles, with various 2D and toroidal
layouts. If you need a tile shape or layout that isn't currently provided,
please let me know. See Math.Geometry.Grid for an example of how to use the
package. Suggestions for improvement are welcome.
Twan van Laarhoven | 18 Feb 14:08 2013
Picon

Re: Subject: ANNOUNCE: grid-3.0.1 (tile maps for board games or maths)

On 18/02/13 13:41, Amy de Buitléir wrote:
> I'm happy to announce a new major release of the grid package:
>
>      http://hackage.haskell.org/package/grid
>      https://github.com/mhwombat/grid/wiki (wiki)
>

After taking a peek at the documentation: have you considered removing the size 
function from Grid? It is the only function that actually uses the type 
parameter 's'. If you really need it, I would suggest putting it in a separate 
class,

     class HasSize a s | a -> s where
         size :: a -> s

It might also be useful to add a rectangular grid type where diagonally adjacent 
cells are also neighbors.

Another interesting idea is to have modifier types that change which cells are 
neighbors, for example you could have
     class Colinear g x | g x where
         -- | Are three points separated by moves in the same direction?
         isColinear :: g -> x -> x -> x -> Bool

     -- neighbors are separated by diagonal moves
     newtype Diagonal g = Diagonal g
     instance (Grid g, Colinear g x) => Grid (Diagonal g) x where
         neighbors g x = [z | y <- neigbhors x, z <- neigbhors y
                            , not (isColinear x y z)]

(Continue reading)

Amy de Buitléir | 19 Feb 12:43 2013
Picon

Re: Subject: ANNOUNCE: grid-3.0.1 (tile maps for board games or maths)

Twan van Laarhoven <twanvl <at> gmail.com> writes:

> After taking a peek at the documentation: have you considered removing
> the size function from Grid?
. . .
> It might also be useful to add a rectangular grid type where diagonally 
> adjacent cells are also neighbors.
. . .
> Another interesting idea is to have modifier types that change which 
> cells are neighbors, for example you could have

Those are all great suggestions, thank you. I'll look into incorporating
them into the next major release.

Gmane