module Effectful.Optparse.Utils
( OsPath,
osPath,
validOsPath,
OsString,
osString,
)
where
import FileSystem.OsPath (OsPath)
import FileSystem.OsPath qualified as OsPath
import FileSystem.OsString (OsString)
import FileSystem.OsString qualified as OsString
import Options.Applicative (ReadM)
import Options.Applicative qualified as OA
osPath :: ReadM OsPath
osPath :: ReadM OsPath
osPath = ReadM String
forall s. IsString s => ReadM s
OA.str ReadM String -> (String -> 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
>>= String -> ReadM OsPath
forall (m :: * -> *).
(HasCallStack, MonadFail m) =>
String -> m OsPath
OsPath.encodeFail
validOsPath :: ReadM OsPath
validOsPath :: ReadM OsPath
validOsPath = ReadM String
forall s. IsString s => ReadM s
OA.str ReadM String -> (String -> 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
>>= String -> ReadM OsPath
forall (m :: * -> *).
(HasCallStack, MonadFail m) =>
String -> m OsPath
OsPath.encodeValidFail
osString :: ReadM OsString
osString :: ReadM OsPath
osString = ReadM String
forall s. IsString s => ReadM s
OA.str ReadM String -> (String -> 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
>>= String -> ReadM OsPath
forall (m :: * -> *).
(HasCallStack, MonadFail m) =>
String -> m OsPath
OsString.encodeFail