58 lines
1.7 KiB
Haskell
58 lines
1.7 KiB
Haskell
module Lib(
|
|
|
|
) where
|
|
|
|
-- data Status = Success | Partial | Failure deriving (Eq, Ord, Show, Read)
|
|
|
|
-- data Response i = ResponseMk {
|
|
-- inform :: i,
|
|
-- msg :: String,
|
|
-- responseCode :: Status
|
|
-- }
|
|
|
|
import Data.Kind(Type)
|
|
|
|
data Has :: (k -> Type) -> Type where
|
|
This :: p x -> Has p
|
|
|
|
{-# DEPRECATED UID "Use the specialised UID newtypes instead" #-}
|
|
type UID = Int
|
|
|
|
class (Show a, Read a, Eq a, Ord a, Enum a) => IsUID a where
|
|
mkUID :: Int -> a
|
|
unUID :: a -> Int
|
|
|
|
instance IsUID ItemUID where
|
|
mkUID = ItemUID
|
|
unUID (ItemUID a) = a
|
|
instance IsUID BodyPartUID where
|
|
mkUID = BodyPartUID
|
|
unUID (BodyPartUID a) = a
|
|
instance IsUID CreatureUID where
|
|
mkUID = CreatureUID
|
|
unUID (CreatureUID a) = a
|
|
instance IsUID StructureUID where
|
|
mkUID = StructureUID
|
|
unUID (StructureUID a) = a
|
|
instance IsUID CellUID where
|
|
mkUID = CellUID
|
|
unUID (CellUID a) = a
|
|
instance IsUID EventUID where
|
|
mkUID = EventUID
|
|
unUID (EventUID a) = a
|
|
instance IsUID TypeUID where
|
|
mkUID = TypeUID
|
|
unUID (TypeUID a) = a
|
|
|
|
instance IsUID OverseerUID where
|
|
mkUID = OverseerUID
|
|
unUID (OverseerUID a) = a
|
|
|
|
newtype ItemUID = ItemUID UID deriving (Show,Read,Eq,Ord,Enum) via Int
|
|
newtype BodyPartUID = BodyPartUID UID deriving (Show,Read,Eq,Ord,Enum) via Int
|
|
newtype CreatureUID = CreatureUID UID deriving (Show,Read,Eq,Ord,Enum) via Int
|
|
newtype StructureUID = StructureUID UID deriving (Show,Read,Eq,Ord,Enum) via Int
|
|
newtype CellUID = CellUID UID deriving (Show,Read,Eq,Ord,Enum) via Int
|
|
newtype EventUID = EventUID UID deriving (Show,Read,Eq,Ord,Enum) via Int
|
|
newtype TypeUID = TypeUID UID deriving (Show,Read,Eq,Ord,Enum) via Int
|
|
newtype OverseerUID = OverseerUID UID deriving (Show, Read, Eq, Ord, Enum) via Int |