sindre-0.6: A programming language for simple GUIs
LicenseMIT-style (see LICENSE)
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Sindre.Lib

Description

Library routines and helper functions for the Sindre programming language.

Synopsis

Documentation

stdFunctions :: forall im. MonadBackend im => FuncMap im Source #

A set of pure functions that can work with any Sindre backend. Includes the functions abs, atan2, cos, sin, exp, log, int, sqrt, length, substr, index, match, sub, gsub, tolower, and toupper.

ioFunctions :: (MonadIO m, MonadBackend m) => FuncMap m Source #

A set of impure functions that only work in IO backends. Includes the system function.

ioGlobals :: MonadIO im => Map Identifier (im Value) Source #

Global variables that require an IO backend. Includes the ENVIRON global.

class (MonadBackend im, MonadSindre im m) => LiftFunction im m a where Source #

A class making it easy to adapt Haskell functions as Sindre functions that take and return Values.

Methods

function :: a -> [Value] -> m im Value Source #

function f is a monadic function that accepts a list of Values and returns a Value. If the list does not contain the number, or type, of arguments expected by f, fail will be called with an appropriate error message.

Instances

Instances details
(Mold a, LiftFunction im m b, MonadSindre im m) => LiftFunction im m (a -> b) Source # 
Instance details

Defined in Sindre.Lib

Methods

function :: (a -> b) -> [Value] -> m im Value Source #

(Mold a, MonadSindre im m) => LiftFunction im m (m im a) Source # 
Instance details

Defined in Sindre.Lib

Methods

function :: m im a -> [Value] -> m im Value Source #

class KeyLike a where Source #

Convenience class for writing Chord values.

Methods

chord :: [KeyModifier] -> a -> Chord Source #

Given a list of modifiers and either a char or a String, yield a Chord. If given a character, the Chord will contain a CharKey, if given a string, it will contain a CtrlKey.

Instances

Instances details
KeyLike Char Source # 
Instance details

Defined in Sindre.Lib

Methods

chord :: [KeyModifier] -> Char -> Chord Source #

KeyLike String Source # 
Instance details

Defined in Sindre.Lib

Methods

chord :: [KeyModifier] -> String -> Chord Source #