sindre-0.4: A programming language for simple GUIs

Portabilityportable
Stabilityprovisional
Safe HaskellSafe-Infered

Sindre.Lib

Description

Library routines and helper functions for the Sindre programming language.

Synopsis

Documentation

stdFunctions :: forall im. MonadBackend im => FuncMap imSource

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 mSource

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 whereSource

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

Methods

function :: a -> [Value] -> m im ValueSource

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

(Mold a, LiftFunction im m b, MonadSindre im m) => LiftFunction im m (a -> b) 
(Mold a, MonadSindre im m) => LiftFunction im m (m im a) 

class KeyLike a whereSource

Convenience class for writing Chord values.

Methods

chord :: [KeyModifier] -> a -> ChordSource

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.