Streamly.Internal.Data.Path
Exceptions
newtype PathException Source #
Exceptions thrown by path operations.
Constructors
InvalidPath String |
Instances
Exception PathException Source # | |
Defined in Streamly.Internal.Data.Path Methods toException :: PathException -> SomeException Source # fromException :: SomeException -> Maybe PathException Source # | |
Show PathException Source # | |
Defined in Streamly.Internal.Data.Path | |
Eq PathException Source # | |
Defined in Streamly.Internal.Data.Path Methods (==) :: PathException -> PathException -> Bool Source # (/=) :: PathException -> PathException -> Bool Source # |
Conversions
class IsPath a b where Source #
If the type a b
is a member of IsPath
it means we know how to convert
the type b
to and from the base type a
.
Methods
unsafeFromPath :: a -> b Source #
Like fromPath
but does not check the properties of Path
. The user
is responsible to maintain the invariants enforced by the type b
otherwise surprising behavior may result.
This operation provides performance and simplicity when we know that the properties of the path are already verified, for example, when we get the path from the file system or from the OS APIs.
fromPath :: MonadThrow m => a -> m b Source #
Convert a base path type to other forms of well-typed paths. It may fail if the path does not satisfy the properties of the target type.
Convert a well-typed path to the base path type. Never fails.