Module "Global.curry"

Library for handling global entities. A global entity has a name declared in the program. Its value can be accessed and modified by IO actions. Furthermore, global entities can be declared as persistent so that their values are stored across different program executions.
Currently, it is still experimental so that its interface might be slightly changed in the future.
A global entity g with an initial value v of type t must be declared by:
g :: Global t
g = global v spec
Here, the type t must not contain type variables and spec specifies the storage mechanism for the global entity (see type GlobalSpec).

Author: Michael Hanus

Version: June 2007


 Exported names:

Datatypes:
Global | GlobalSpec

Constructors:
Persistent | Temporary

Functions:
global | readGlobal | writeGlobal


 Summary of exported functions:

global  :: a -> GlobalSpec -> Global a  deterministic 
          global is only used for the declaration of a global value and should not be used elsewhere.
readGlobal  :: Global a -> IO a  deterministic 
          Reads the current value of a global.
writeGlobal  :: Global a -> a -> IO ()  deterministic 
          Updates the value of a global.

 Imported modules:

Prelude

 Exported datatypes:

Global

The general type of dynamic predicates.

Constructors:


GlobalSpec

The storage mechanism for the global entity.

Constructors:

Temporary :: GlobalSpec

Temporary - the global value exists only during a single execution of a program

Persistent :: String -> GlobalSpec

Persistent f - the global value is stored persisently in file f (which is created and initialized if it does not exists)



 Exported functions:

global :: a -> GlobalSpec -> Global a  deterministic 

global is only used for the declaration of a global value and should not be used elsewhere. In the future, it might become a keyword.

Further infos:
  • solution complete, i.e., able to compute all solutions

readGlobal :: Global a -> IO a  deterministic 

Reads the current value of a global.


writeGlobal :: Global a -> a -> IO ()  deterministic 

Updates the value of a global. The value is evaluated to a ground constructor term before it is updated.



Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Aug 28 15:25:55 2008