Portability | portable |
---|---|
Stability | provisional |
Definitions for the Sindre runtime environment.
- data Sindre m a
- execSindre :: MonadBackend m => SindreEnv m -> Sindre m a -> m ExitCode
- quitSindre :: MonadBackend m => ExitCode -> Sindre m ()
- class (MonadBackend im, Monad (m im)) => MonadSindre im m where
- broadcast :: MonadBackend im => Event -> ObjectM o im ()
- changed :: MonadBackend im => Identifier -> Value -> Value -> ObjectM o im ()
- redraw :: (MonadBackend im, Widget im s) => ObjectM s im ()
- fullRedraw :: MonadSindre im m => m im ()
- setRootPosition :: MonadBackend m => Value -> Sindre m ()
- class (Monad m, Functor m, Applicative m, Mold (RootPosition m)) => MonadBackend m where
- type BackEvent m :: *
- type RootPosition m :: *
- redrawRoot :: Sindre m ()
- redrawRegion :: [Rectangle] -> Sindre m ()
- getBackEvent :: Sindre m (Maybe Event)
- waitForBackEvent :: Sindre m Event
- printVal :: String -> m ()
- class MonadBackend m => Object m s where
- callMethodI :: Identifier -> [Value] -> ObjectM s m Value
- fieldSetI :: Identifier -> Value -> ObjectM s m Value
- fieldGetI :: Identifier -> ObjectM s m Value
- recvEventI :: Event -> ObjectM s m ()
- data ObjectM o m a
- fieldSet :: MonadSindre im m => ObjectRef -> Identifier -> Value -> m im Value
- fieldGet :: MonadSindre im m => ObjectRef -> Identifier -> m im Value
- callMethod :: MonadSindre im m => ObjectRef -> Identifier -> [Value] -> m im Value
- class Object m s => Widget m s where
- draw :: MonadSindre im m => WidgetRef -> Maybe Rectangle -> m im SpaceUse
- compose :: MonadSindre im m => WidgetRef -> m im SpaceNeed
- recvEvent :: MonadSindre im m => WidgetRef -> Event -> m im ()
- data DataSlot m
- = forall s . Widget m s => WidgetSlot s WidgetState
- | forall s . Object m s => ObjectSlot s
- data WidgetState = WidgetState {}
- data SindreEnv m = SindreEnv {}
- newEnv :: WidgetRef -> Arguments -> SindreEnv m
- globalVal :: MonadBackend m => Key -> Sindre m Value
- setGlobal :: MonadBackend m => Key -> Value -> Sindre m ()
- data Execution m a
- execute :: MonadBackend m => Execution m Value -> Sindre m Value
- execute_ :: MonadBackend m => Execution m a -> Sindre m ()
- returnHere :: MonadBackend m => Execution m Value -> Execution m Value
- doReturn :: MonadBackend m => Value -> Execution m ()
- nextHere :: MonadBackend m => Execution m () -> Execution m ()
- doNext :: MonadBackend m => Execution m ()
- breakHere :: MonadBackend m => Execution m () -> Execution m ()
- doBreak :: MonadBackend m => Execution m ()
- contHere :: MonadBackend m => Execution m () -> Execution m ()
- doCont :: MonadBackend m => Execution m ()
- setScope :: MonadBackend m => [Value] -> Execution m a -> Execution m a
- enterScope :: MonadBackend m => [Value] -> Execution m a -> Execution m a
- lexicalVal :: MonadBackend m => Key -> Execution m Value
- setLexical :: MonadBackend m => Key -> Value -> Execution m ()
- eventLoop :: MonadBackend m => EventHandler m -> Sindre m ()
- type EventHandler m = Event -> Execution m ()
- class Mold a where
Documentation
The main monad in which a Sindre program executes. More
specialised monads, such as Execution
are used for specific
purposes, but they all run on top of the Sindre monad.
MonadTrans Sindre | |
MonadBackend im => MonadSindre im Sindre | |
Monad (Sindre m) | |
Functor (Sindre m) | |
Applicative (Sindre m) | |
MonadIO m => MonadIO (Sindre m) | |
MonadCont (Sindre m) | |
MonadReader (QuitFun m) (Sindre m) | |
MonadState (SindreEnv m) (Sindre m) | |
Monoid (Sindre m ()) |
execSindre :: MonadBackend m => SindreEnv m -> Sindre m a -> m ExitCodeSource
execSindre e m
executes the action m
in environment e
,
returning the exit code of m
.
quitSindre :: MonadBackend m => ExitCode -> Sindre m ()Source
Immediately return from execSindre
, returning the given exit
code.
class (MonadBackend im, Monad (m im)) => MonadSindre im m whereSource
MonadSindre im m
is the class of monads m
that run on top of
Sindre
with backend im
, and can thus access Sindre
functionality.
sindre :: Sindre im a -> m im aSource
Lift a Sindre
operation into this monad.
Lift a backend operation into this monad.
MonadBackend im => MonadSindre im Execution | |
MonadBackend im => MonadSindre im Sindre | |
MonadBackend im => MonadSindre im ConstructorM | |
MonadBackend im => MonadSindre im (ObjectM o) |
changed :: MonadBackend im => Identifier -> Value -> Value -> ObjectM o im ()Source
fullRedraw :: MonadSindre im m => m im ()Source
setRootPosition :: MonadBackend m => Value -> Sindre m ()Source
class (Monad m, Functor m, Applicative m, Mold (RootPosition m)) => MonadBackend m whereSource
A monad that can be used as the layer beneath Sindre
.
type RootPosition m :: *Source
redrawRoot :: Sindre m ()Source
redrawRegion :: [Rectangle] -> Sindre m ()Source
getBackEvent :: Sindre m (Maybe Event)Source
class MonadBackend m => Object m s whereSource
callMethodI :: Identifier -> [Value] -> ObjectM s m ValueSource
fieldSetI :: Identifier -> Value -> ObjectM s m ValueSource
fieldGetI :: Identifier -> ObjectM s m ValueSource
recvEventI :: Event -> ObjectM s m ()Source
MonadBackend m => Object m Oriented | |
(MonadIO m, MonadBackend m) => Object m InStream | |
Object SindreX11M List | |
Object SindreX11M TextField | |
Object SindreX11M Blank | |
Object SindreX11M Label | |
Object SindreX11M Dial |
MonadBackend im => MonadSindre im (ObjectM o) | |
MonadReader ObjectRef (ObjectM o m) | |
MonadState o (ObjectM o m) | |
Monad (ObjectM o m) | |
Functor (ObjectM o m) | |
Applicative (ObjectM o m) | |
(MonadIO m, MonadBackend m) => MonadIO (ObjectM o m) |
fieldSet :: MonadSindre im m => ObjectRef -> Identifier -> Value -> m im ValueSource
fieldGet :: MonadSindre im m => ObjectRef -> Identifier -> m im ValueSource
callMethod :: MonadSindre im m => ObjectRef -> Identifier -> [Value] -> m im ValueSource
class Object m s => Widget m s whereSource
MonadBackend m => Widget m Oriented | |
Widget SindreX11M List | |
Widget SindreX11M TextField | |
Widget SindreX11M Blank | |
Widget SindreX11M Label | |
Widget SindreX11M Dial |
compose :: MonadSindre im m => WidgetRef -> m im SpaceNeedSource
forall s . Widget m s => WidgetSlot s WidgetState | |
forall s . Object m s => ObjectSlot s |
MonadState (SindreEnv m) (Sindre m) |
MonadBackend im => MonadSindre im Execution | |
Monad (Execution m) | |
Functor (Execution m) | |
Applicative (Execution m) | |
MonadCont (Execution m) | |
MonadReader (ExecutionEnv m) (Execution m) |
returnHere :: MonadBackend m => Execution m Value -> Execution m ValueSource
doNext :: MonadBackend m => Execution m ()Source
doBreak :: MonadBackend m => Execution m ()Source
doCont :: MonadBackend m => Execution m ()Source
enterScope :: MonadBackend m => [Value] -> Execution m a -> Execution m aSource
lexicalVal :: MonadBackend m => Key -> Execution m ValueSource
setLexical :: MonadBackend m => Key -> Value -> Execution m ()Source
eventLoop :: MonadBackend m => EventHandler m -> Sindre m ()Source
type EventHandler m = Event -> Execution m ()Source