biegunka-0.2: DSL definitions, interpreters, templating, git support

Safe HaskellNone

Control.Biegunka.Groups

Description

Groups data control

Uses acid-state to store data before script invocations.

Interpreters can modify (create/update/delete) data any way they want:

  • First, interpreter must call open to get data handle
  • Next, interpreter changes these and call commit
  • Last, interpreter says close

Synopsis

Documentation

data Partitioned a Source

Groups data state

Consists of acid-state handle and two parts: relevant groups and irrelevant groups

Relevant groups (or these) are groups mentioned in script so interpreter won't deal with others (or those)

data Groups Source

All groups data

A mapping from group names to GroupRecords

Instances

Show Groups 
Typeable Groups 
Monoid Groups 
IsAcidic Groups 
SafeCopy Groups 
ToJSON Groups 

newtype GroupRecord Source

Group data record

A mapping from Source data to set of FileRecords

Constructors

GR 

data SourceRecord Source

Source data record

Instances

Eq SourceRecord

Only destination filepath matters for equality

Ord SourceRecord

Only destination filepath matters for ordering

Read SourceRecord 
Show SourceRecord 
SafeCopy SourceRecord 
ToJSON SourceRecord 
Migrate SourceRecord 

data FileRecord Source

File data record

Instances

Eq FileRecord

Only destination filepath matters for equality

Ord FileRecord

Only destination filepath matters for ordering

Show FileRecord 
SafeCopy FileRecord 
ToJSON FileRecord 
Migrate FileRecord 

these :: Lens' (Partitioned a) aSource

Groups targeted by script

those :: Lens' (Partitioned a) aSource

All other groups

groups :: Lens' Groups (Map String GroupRecord)Source

All groups data

open :: Settings () -> IO (Partitioned Groups)Source

Open groups data from disk

Searches appData/groups path for groups data. Starts empty if nothing is found

commit :: Partitioned Groups -> IO ()Source

Update groups data

Combines these and those to get full state

close :: Partitioned Groups -> IO ()Source

Save groups data to disk

fromScript :: Free (Term Annotate Sources) a -> GroupsSource

Extract groups data from script

Won't get all mentioned groups but only those for which there is some useful action to do.

diff :: Eq b => (a -> [b]) -> a -> a -> [b]Source

Get groups difference

files :: Groups -> [FilePath]Source

Get all destination filepaths in Groups

sources :: Groups -> [FilePath]Source

Get all sources location in Groups