mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS.Utils

Synopsis

Documentation

class GetRep t where Source #

Methods

getRep :: t -> TypeRep Source #

Instances

Instances details
GetRep ComponentType Source # 
Instance details

Defined in Mischief.ECS.Components

GetRep DefaultComponentType Source # 
Instance details

Defined in Mischief.ECS.Components

GetRep ErasedComponent Source # 
Instance details

Defined in Mischief.ECS.Components

findM :: forall m a t. (Monad m, Foldable t) => (a -> m Bool) -> t a -> m (Maybe a) Source #

class Functor f => Unwrappable (f :: Type -> Type) where Source #

Methods

unwrap' :: HasCallStack => Text -> f a -> a Source #

Instances

Instances details
Unwrappable Maybe Source # 
Instance details

Defined in Mischief.ECS.Utils

Methods

unwrap' :: HasCallStack => Text -> Maybe a -> a Source #

Unwrappable (Either a) Source # 
Instance details

Defined in Mischief.ECS.Utils

Methods

unwrap' :: HasCallStack => Text -> Either a a0 -> a0 Source #

unwrap :: (HasCallStack, Unwrappable f) => f a -> a Source #

Unwrap a Maybe or Either, panicking if it doesn't contain a value.

expect :: (HasCallStack, Unwrappable f) => Text -> f a -> a Source #

Unwrap a Maybe or Either, throwing the given error if it doesn't contain a value.

andM :: (Traversable t, Applicative f) => t (f Bool) -> f Bool Source #

orM :: (Traversable t, Applicative f) => t (f Bool) -> f Bool Source #

anyM :: (Traversable t, Monad f) => (a -> f Bool) -> t a -> f Bool Source #

mapLeft :: (a -> c) -> Either a b -> Either c b Source #

data ErasedValue where Source #

Constructors

ErasedValue :: forall a. Typeable a => a -> ErasedValue 

fromMaybeM :: Applicative m => m a -> Maybe a -> m a Source #