module Effectful.Optparse.Utils
( OsPath,
osPath,
validOsPath,
)
where
import FileSystem.OsPath (OsPath)
import FileSystem.OsPath qualified as OsPath
import Options.Applicative (ReadM)
import Options.Applicative qualified as OA
osPath :: ReadM OsPath
osPath :: ReadM OsPath
osPath = ReadM FilePath
forall s. IsString s => ReadM s
OA.str ReadM FilePath -> (FilePath -> ReadM OsPath) -> ReadM OsPath
forall a b. ReadM a -> (a -> ReadM b) -> ReadM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FilePath -> ReadM OsPath
forall (m :: * -> *).
(HasCallStack, MonadFail m) =>
FilePath -> m OsPath
OsPath.encodeFail
validOsPath :: ReadM OsPath
validOsPath :: ReadM OsPath
validOsPath = ReadM FilePath
forall s. IsString s => ReadM s
OA.str ReadM FilePath -> (FilePath -> ReadM OsPath) -> ReadM OsPath
forall a b. ReadM a -> (a -> ReadM b) -> ReadM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FilePath -> ReadM OsPath
forall (m :: * -> *).
(HasCallStack, MonadFail m) =>
FilePath -> m OsPath
OsPath.encodeValidFail