-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Data Binding -- -- Bind mutable data and lists to IO objects. Wrappers for binding to -- graphical widgets are provided by binding-gtk and binding-wx. @package binding-core @version 0.2.2 -- | Mutable variables in the IO Monad. module Data.Variable class Variable v newVar :: Variable v => a -> IO (v a) readVar :: Variable v => v a -> IO a writeVar :: Variable v => v a -> a -> IO () modifyVar :: Variable v => v a -> (a -> a) -> IO () modifyVar' :: Variable v => v a -> (a -> (a, b)) -> IO b instance Variable TMVar instance Variable TVar instance Variable MVar instance Variable IORef module Data.Binding.Simple -- | Sources for data binding. class Variable b => Bindable b bind :: Bindable b => b a -> (a -> d) -> t -> (t -> d -> IO ()) -> IO () -- | Binding Source data Source v a instance Variable v => Bindable (Source v) instance Variable v => Variable (Source v) module Data.Binding.List -- | Binding List data BindingList v a -- | Create a binding list. toBindingList :: Variable v => [a] -> IO (BindingList v a) -- | Extract the data from a binding list. fromBindingList :: Variable v => BindingList v a -> IO [a] -- | The size of a binding list. length :: Variable v => BindingList v a -> IO Int -- | Get the current position. position :: Variable v => BindingList v a -> IO Int -- | Bind to a new position in a binding list. Returns the new position; -- this is convenient for seekBy and friends. seek :: Variable v => BindingList v a -> Int -> IO Int -- | Bind to a new position in a binding list. seekBy :: Variable v => (Int -> Int) -> BindingList v a -> IO Int -- | Bind to the next item in a binding list. next :: Variable v => BindingList v a -> IO Int -- | Bind to the previous item in a binding list. prev :: Variable v => BindingList v a -> IO Int -- | Remove an element from a list. remove' :: [a] -> Int -> [a] -- | Remove the current element from the list. remove :: BindingList v a -> IO Int -- | Insert an element into a list. insert' :: [a] -> Int -> a -> [a] -- | Insert an element into the list. The new element is inserted after the -- current element. This allows appending, but precludes prepending. insert :: BindingList v a -> a -> IO Int instance Variable v => Bindable (BindingList v) instance Variable v => Variable (BindingList v)