/aeson-tiled

Aeson instances for Tiled map editor types

Primary LanguageHaskellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

aeson-tiled

Hackage

Types and instances for Tiled map editor map/.tmj and tileset/.tsj files.

aeson-tiled is the spiritual successor to htiled. htiled uses hxt which 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 with aeson representation, one type at a time. They provide JSON Value translation 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.