module Ribosome.Effect.PersistPath where
import Path (Abs, Dir, Path, Rel)
import Ribosome.Data.Setting (Setting (Setting))
data PersistPath :: Effect where
PersistPath :: Maybe (Path Rel Dir) -> PersistPath m (Path Abs Dir)
makeSem_ ''PersistPath
persistPath ::
∀ r .
Member PersistPath r =>
Maybe (Path Rel Dir) ->
Sem r (Path Abs Dir)
setting :: Setting (Path Abs Dir)
setting :: Setting (Path Abs Dir)
setting =
Text -> Bool -> Maybe (Path Abs Dir) -> Setting (Path Abs Dir)
forall a. Text -> Bool -> Maybe a -> Setting a
Setting Text
"ribosome_persistence_dir" Bool
False Maybe (Path Abs Dir)
forall a. Maybe a
Nothing
persistRoot ::
Member PersistPath r =>
Sem r (Path Abs Dir)
persistRoot :: forall (r :: EffectRow).
Member PersistPath r =>
Sem r (Path Abs Dir)
persistRoot =
Maybe (Path Rel Dir) -> Sem r (Path Abs Dir)
forall (r :: EffectRow).
Member PersistPath r =>
Maybe (Path Rel Dir) -> Sem r (Path Abs Dir)
persistPath Maybe (Path Rel Dir)
forall a. Maybe a
Nothing
persistSubPath ::
Member PersistPath r =>
Path Rel Dir ->
Sem r (Path Abs Dir)
persistSubPath :: forall (r :: EffectRow).
Member PersistPath r =>
Path Rel Dir -> Sem r (Path Abs Dir)
persistSubPath Path Rel Dir
p =
Maybe (Path Rel Dir) -> Sem r (Path Abs Dir)
forall (r :: EffectRow).
Member PersistPath r =>
Maybe (Path Rel Dir) -> Sem r (Path Abs Dir)
persistPath (Path Rel Dir -> Maybe (Path Rel Dir)
forall a. a -> Maybe a
Just Path Rel Dir
p)