Safe Haskell | None |
---|
Configuration script machinery
- newtype Script s a = Script {}
- data Annotations
- data family Annotate sc :: *
- script :: Term Annotate s a -> Script s a
- annotate :: Script s a -> StateT Annotations (Free (Term Annotate t)) (Free (Term Annotate s) a)
- rewind :: MonadState s m => Lens' s a -> m b -> m a
- type URI = String
- sourced :: String -> URI -> FilePath -> Script Actions () -> (FilePath -> IO ()) -> Script Sources ()
- actioned :: (FilePath -> FilePath -> Action) -> Script Actions ()
- constructDestinationFilepath :: FilePath -> FilePath -> FilePath -> FilePath
- token :: Lens' Annotations Int
- app :: Lens' Annotations FilePath
- profiles :: Lens' Annotations (Set String)
- profileName :: Lens' Annotations String
- source :: Lens' Annotations FilePath
- sourceURL :: Lens' Annotations String
- order :: Lens' Annotations Int
- runScript :: Annotations -> Script s a -> Free (Term Annotate s) (a, Annotations)
- runScript' :: Annotations -> Script s a -> (Free (Term Annotate s) a, Annotations)
- evalScript :: Annotations -> Script s a -> Free (Term Annotate s) a
Documentation
Newtype used to provide better error messages for type errors in DSL
data Annotations Source
Script construction state
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
sourced :: String -> URI -> FilePath -> Script Actions () -> (FilePath -> IO ()) -> Script Sources ()Source
Abstract away all plumbing needed to make source
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
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