Aeson instances for the Tiled map editor.
The mighty Tiled 2D map editor is an open source app for creating tile based level maps. This package provides types and aeson instances to read Tiled json files.
aeson-tiled
Types and instances for Tiled map editor map/.tmj and tileset/.tsj files.
aeson-tiledis the spiritual successor tohtiled.htileduseshxtwhich relies too heavily on Arrows and is rather hard to work with. Tiled's json export supports 100% of Tiled's features, so there doesn't seem to be much of a point to maintaining a large Arrows-based project when writing Aeson instances for Tiled types is much easier. Hence this project!
The package is geared toward minimal divergence from Tiled type specifications.
Tiled data format is taken at version 1.8.4. Should be compatible down to 1.6 (where the version field changed to string).
GHC versions are supported from 8.10 and follow Stackage LTS + Stackage Nightly + whatever is available on ghcup.
Module structure
The modules are designed for qualified imports and OverloadedRecordDot extension. Everyone has a Generic instance so you can use generic-lens or generic-optics if you wish.
- Modules under
Codec.Tiled.*are concerned withaesonrepresentation, one type at a time. They provide JSONValuetranslation to concrete types, but not much beyond that. Your application most likely should use its own representation. - Modules under
Data.Tiled.*are types specific to this package. They are more refined and may be utilized directly.