mischief-assets
Safe HaskellNone
LanguageGHC2024

Mischief.Assets.Asset

Documentation

class Component a => Asset a where Source #

Minimal complete definition

Nothing

Associated Types

type Loadable a :: Bool Source #

type Loadable a = 'True

type Saveable a :: Bool Source #

type Saveable a = 'True

Methods

loadAsset :: FilePath -> Text -> IO (Either Text a) Source #

default loadAsset :: Loadable a ~ 'False => FilePath -> Text -> IO (Either Text a) Source #

saveAsset :: a -> FilePath -> Text -> IO (Either Text ()) Source #

default saveAsset :: Saveable a ~ 'False => a -> FilePath -> Text -> IO (Either Text ()) Source #

rec :: a -> Rec () Source #

Instances

Instances details
Asset Image Source # 
Instance details

Defined in Mischief.Assets.Image

Associated Types

type Loadable Image 
Instance details

Defined in Mischief.Assets.Image

type Saveable Image 
Instance details

Defined in Mischief.Assets.Image

newtype OnLoad (a :: k) Source #

Constructors

OnLoad 

Fields

Instances

Instances details
Show (OnLoad a) Source # 
Instance details

Defined in Mischief.Assets.Internal.Asset

Methods

showsPrec :: Int -> OnLoad a -> ShowS #

show :: OnLoad a -> String #

showList :: [OnLoad a] -> ShowS #

(Typeable a, Typeable k) => Event (OnLoad a) Source # 
Instance details

Defined in Mischief.Assets.Internal.Asset

load_ :: (Loadable a ~ 'True, Asset a, Bundle a) => Text -> System () Source #

store :: (Asset a, Bundle a) => Text -> a -> System Entity Source #

save :: (Asset a, Saveable a ~ 'True, Bundle a) => Text -> System () Source #

type Rec = State RecAssets Source #