bishbosh-0.1.1.0: Plays chess.
Safe HaskellSafe-Inferred
LanguageHaskell2010

BishBosh.Property.Switchable

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Defines a class to which IO data-types which can be switched between binary states, can conform.
Synopsis

Type-classes

class Switchable a where Source #

For data which operate like binary switches.

Minimal complete definition

on, toggle, isOn

Methods

on Source #

Arguments

:: IO a

Returns a switch in the on state, regardless of any previous state.

toggle Source #

Arguments

:: a 
-> IO a

Switch the binary state.

switchOff Source #

Arguments

:: a 
-> IO a

Turn the switch off, which has no effect if already in the off state.

isOn Source #

Arguments

:: a 
-> Bool

Predicate: whether the switch is currently in the on state.

isOff Source #

Arguments

:: a 
-> Bool

Predicate: whether the switch is currently in the off state.

Functions

flick :: Switchable switchable => Int -> switchable -> IO switchable Source #

Toggle the switch the specified number of times.