biegunka-core-0.1.0.0: DSL definitions, interpreters, templating

Safe HaskellNone

Biegunka.Script

Description

Configuration script machinery

Synopsis

Documentation

newtype Script s a Source

Newtype used to provide better error messages for type errors in DSL

Constructors

Script 

Instances

data Annotations Source

Script construction state

data family Annotate sc :: *Source

Language Term annotation depending on their Scope

script :: Term Annotate s a -> Script s aSource

Lift DSL term to the Script

annotate :: Script s a -> StateT Annotations (Free (Term Annotate t)) (Free (Term Annotate s) a)Source

Annotate DSL

rewind :: MonadState s m => Lens' s a -> m b -> m aSource

Rewind state part pointed by a 'Lens\'' after monadic action execution

type URI = StringSource

Repository URI (like git@github.com:whoever/whatever.git)

sourced :: String -> URI -> FilePath -> Script Actions () -> (FilePath -> IO ()) -> Script Sources ()Source

Abstract away all plumbing needed to make source

actioned :: (FilePath -> FilePath -> Action) -> Script Actions ()Source

Get Actions scope script from FilePath mangling

constructDestinationFilepath :: FilePath -> FilePath -> FilePath -> FilePathSource

Construct destination FilePath

>>> constructDestinationFilepath "" "" ""
""
>>> constructDestinationFilepath "/root" "from" "to"
"/root/to"
>>> constructDestinationFilepath "/root" "from" "/to"
"/to"
>>> constructDestinationFilepath "/root" "from" "to/"
"/root/to/from"
>>> constructDestinationFilepath "/root" "from" "/to/"
"/to/from"

token :: Lens' Annotations IntSource

Unique token for each 'TP'/'TS'

app :: Lens' Annotations FilePathSource

Biegunka filepath root

profiles :: Lens' Annotations (Set String)Source

All profiles encountered so far

profileName :: Lens' Annotations StringSource

Current profile name

source :: Lens' Annotations FilePathSource

Current source filepath

sourceURL :: Lens' Annotations StringSource

Current source url

order :: Lens' Annotations IntSource

Current action order

runScript :: Annotations -> Script s a -> Free (Term Annotate s) (a, Annotations)Source

Get DSL and resulting state from Script

runScript' :: Annotations -> Script s a -> (Free (Term Annotate s) a, Annotations)Source

Get DSL and resulting state from Script

evalScript :: Annotations -> Script s a -> Free (Term Annotate s) aSource

Get DSL from Script