module Language.Paraiso.OM.Realm
(
TGlobal(..), TLocal(..), TRealm(..),
Realm(..), Realmable(..),
) where
class TRealm a where
tRealm :: a -> Realm
unitTRealm :: a
data TGlobal = TGlobal
data TLocal = TLocal
instance TRealm TGlobal where
tRealm _ = Global
unitTRealm = TGlobal
instance TRealm TLocal where
tRealm _ = Local
unitTRealm = TLocal
data Realm = Global | Local deriving (Eq, Show)
class Realmable a where
realm :: a -> Realm
instance Realmable Realm where
realm = id
instance TRealm a => Realmable a where
realm = tRealm