boop-0.1.0.0: OOP primitives for Haskell

Safe HaskellSafe
LanguageHaskell2010

Control.OOP

Contents

Synopsis

Classes, Methods, and Interfaces

class a :> b where Source #

The instance-of typeclass. a :> b means that a is an instance of b.

Minimal complete definition

cast

Methods

cast :: a -> b Source #

Instances

a :> a Source #

Every interface is trivially an instance of itself.

Methods

cast :: a -> a Source #

Applicative m => Double :> (ToString m) Source # 

Methods

cast :: Double -> ToString m Source #

Applicative m => Int :> (ToString m) Source # 

Methods

cast :: Int -> ToString m Source #

Applicative m => Integer :> (ToString m) Source # 

Methods

cast :: Integer -> ToString m Source #

Applicative m => Rational :> (ToString m) Source # 

Methods

cast :: Rational -> ToString m Source #

Applicative m => String :> (ToString m) Source # 

Methods

cast :: String -> ToString m Source #

Applicative m => Text :> (ToString m) Source # 

Methods

cast :: Text -> ToString m Source #

Applicative m => LText :> (ToString m) Source # 

Methods

cast :: LText -> ToString m Source #

Properties Fields Methods

member :: cls :> inst => (inst -> inst -> a) -> cls -> a Source #

Member accessor: get an object member through an interface.

imember :: (inst -> inst -> a) -> inst -> a Source #

pureMember :: (cls :> inst, Applicative m) => (inst -> inst -> a) -> cls -> m a Source #

Applicative accessor for a pure member.

mapMember :: (cls :> inst, Functor m) => (inst -> inst -> a) -> m cls -> m a Source #

Accessing a pure member through a Functor

(-->) :: cls :> inst => cls -> (inst -> inst -> a) -> a infixl 8 Source #

Flipped operator alias for member.

(==>) :: inst -> (inst -> inst -> a) -> a infixl 8 Source #

Flipped operator alias for imember.

Mutable State

class Monad m => MonadConstVar v m | m -> v where Source #

Generalized read-only access to mutable variables

Minimal complete definition

readVar

Methods

readVar :: v a -> m a Source #

Instances

MonadIO m => MonadConstVar IORef m Source # 

Methods

readVar :: IORef a -> m a Source #

class (Monad m, MonadConstVar v m) => MonadVar v m | m -> v where Source #

Generalized mutable variables

Minimal complete definition

newVar, writeVar, transaction

Methods

newVar :: a -> m (v a) Source #

writeVar :: a -> v a -> m () Source #

modifyVar :: (a -> a) -> v a -> m () Source #

swapVar :: a -> v a -> m a Source #

modifySwapVar :: (a -> a) -> v a -> m a Source #

transaction :: Proxy v -> m a -> m a Source #

Instances

MonadIO m => MonadVar IORef m Source # 

Methods

newVar :: a -> m (IORef a) Source #

writeVar :: a -> IORef a -> m () Source #

modifyVar :: (a -> a) -> IORef a -> m () Source #

swapVar :: a -> IORef a -> m a Source #

modifySwapVar :: (a -> a) -> IORef a -> m a Source #

transaction :: Proxy (* -> *) IORef -> m a -> m a Source #

Standard interfaces

data ToString m Source #

Objects that can be converted to string

Constructors

ToString 

Fields