lgtk-0.4: lens-based API for Gtk

Safe HaskellSafe-Inferred

Control.MLens.Unsafe

Contents

Description

This module exports unsafe definitions, like the NewRef instance for IO which does not fulfil the NewRef laws in a multi-threaded environment.

Synopsis

Unsafe references

fileRef :: FilePath -> IO (Ref IO String)Source

Using fileRef is safe if the file is not used concurrently.

fileRef_ :: FilePath -> IO (Ref IO (Maybe String))Source

Note that if you write Nothing, the file is deleted.

logConsoleLens :: Show a => MLens IO a aSource

logConsoleLens logs elementary get and set operations.

Note that with the current representation of MLens, every set operation involves a get operation.

logMLens :: Monad m => (a -> m ()) -> (a -> m ()) -> MLens m a aSource

Auxiliary definitions