diff options
Diffstat (limited to 'lib/Tiled2.hs')
-rw-r--r-- | lib/Tiled2.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Tiled2.hs b/lib/Tiled2.hs index c3bf401..8220bfb 100644 --- a/lib/Tiled2.hs +++ b/lib/Tiled2.hs @@ -1,6 +1,6 @@ -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- | This module provides Haskell types for Tiled's JSON exports, which you can @@ -18,6 +18,7 @@ import Data.Aeson hiding (Object) import qualified Data.Aeson as A import Data.Aeson.Types (Parser, typeMismatch) import qualified Data.ByteString.Lazy.Char8 as C8 +import Data.Functor ((<&>)) import Data.Map (Map) import qualified Data.Map as M import Data.Maybe (fromMaybe) @@ -25,13 +26,14 @@ import Data.Text (Text) import Data.Vector (Vector) import GHC.Exts (fromList, toList) import GHC.Generics (Generic) -import Data.Functor ((<&>)) -- | A globally indexed identifier. newtype GlobalId = GlobalId { unGlobalId :: Int } deriving (Ord, Eq, Enum, Num, Generic, Show, FromJSON, ToJSON, FromJSONKey, ToJSONKey) +mkTiledId :: Int -> GlobalId +mkTiledId i = GlobalId { unGlobalId = i } -- | A locally indexed identifier. newtype LocalId = LocalId { unLocalId :: Int } |