summaryrefslogtreecommitdiff
path: root/tiled/Data/Tiled/TH.hs
blob: e0ad0e8d07f9e40940e4223bc2bbeb0290efc13e (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
  }