summaryrefslogtreecommitdiff
path: root/tiled/Data/Tiled/TH.hs
blob: c6b346cbaff796cac652e5d3a7cda9f26ef1f055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Data.Tiled.TH where

import           Universum

import qualified Data.Aeson.TH as TH
import           Data.Char     (toLower)

aesonOptions :: Int -> TH.Options
aesonOptions l = TH.defaultOptions
  { TH.omitNothingFields = True
  , TH.rejectUnknownFields = True
  -- can't be bothered to do a nicer prefix strip
  , TH.fieldLabelModifier = drop l . map toLower
  , TH.sumEncoding = TH.UntaggedValue
  }