Portability | Rank2Types |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | None |
- (</>~) :: ASetter s t FilePath FilePath -> FilePath -> s -> t
- (<</>~) :: LensLike ((,) FilePath) s a FilePath FilePath -> FilePath -> s -> (FilePath, a)
- (<<</>~) :: Optical' (->) q ((,) FilePath) s FilePath -> FilePath -> q s (FilePath, s)
- (<.>~) :: ASetter s a FilePath FilePath -> String -> s -> a
- (<<.>~) :: LensLike ((,) FilePath) s a FilePath FilePath -> String -> s -> (FilePath, a)
- (<<<.>~) :: Optical' (->) q ((,) FilePath) s FilePath -> String -> q s (FilePath, s)
- (</>=) :: MonadState s m => ASetter' s FilePath -> FilePath -> m ()
- (<</>=) :: MonadState s m => LensLike' ((,) FilePath) s FilePath -> FilePath -> m FilePath
- (<<</>=) :: MonadState s m => LensLike' ((,) FilePath) s FilePath -> FilePath -> m FilePath
- (<.>=) :: MonadState s m => ASetter' s FilePath -> String -> m ()
- (<<.>=) :: MonadState s m => LensLike' ((,) FilePath) s FilePath -> String -> m FilePath
- (<<<.>=) :: MonadState s m => LensLike' ((,) FilePath) s FilePath -> String -> m FilePath
- basename :: Lens' FilePath FilePath
- directory :: Lens' FilePath FilePath
- extension :: Lens' FilePath FilePath
- filename :: Lens' FilePath FilePath
Operators
(</>~) :: ASetter s t FilePath FilePath -> FilePath -> s -> tSource
Modify the path by adding another path.
>>>
both </>~ "bin" $ ("hello","world")
("hello/bin","world/bin")
(</>~
) ::Setter
s aFilePath
FilePath
->FilePath
-> s -> a (</>~
) ::Iso
s aFilePath
FilePath
->FilePath
-> s -> a (</>~
) ::Lens
s aFilePath
FilePath
->FilePath
-> s -> a (</>~
) ::Traversal
s aFilePath
FilePath
->FilePath
-> s -> a
(<.>~) :: ASetter s a FilePath FilePath -> String -> s -> aSource
Modify the path by adding extension.
>>>
both <.>~ "txt" $ ("hello","world")
("hello.txt","world.txt")
(<.>~
) ::Setter
s aFilePath
FilePath
->String
-> s -> a (<.>~
) ::Iso
s aFilePath
FilePath
->String
-> s -> a (<.>~
) ::Lens
s aFilePath
FilePath
->String
-> s -> a (<.>~
) ::Traversal
s aFilePath
FilePath
->String
-> s -> a
(</>=) :: MonadState s m => ASetter' s FilePath -> FilePath -> m ()Source
Modify the target(s) of a Simple
Lens
, Iso
, Setter
or Traversal
by adding a path.
>>>
execState (both </>= "bin") ("hello","world")
("hello/bin","world/bin")
(</>=
) ::MonadState
s m =>Setter'
sFilePath
->FilePath
-> m () (</>=
) ::MonadState
s m =>Iso'
sFilePath
->FilePath
-> m () (</>=
) ::MonadState
s m =>Lens'
sFilePath
->FilePath
-> m () (</>=
) ::MonadState
s m =>Traversal'
sFilePath
->FilePath
-> m ()
(<.>=) :: MonadState s m => ASetter' s FilePath -> String -> m ()Source
Modify the target(s) of a Simple
Lens
, Iso
, Setter
or Traversal
by adding an extension.
>>>
execState (both <.>= "txt") ("hello","world")
("hello.txt","world.txt")
(<.>=
) ::MonadState
s m =>Setter'
sFilePath
->String
-> m () (<.>=
) ::MonadState
s m =>Iso'
sFilePath
->String
-> m () (<.>=
) ::MonadState
s m =>Lens'
sFilePath
->String
-> m () (<.>=
) ::MonadState
s m =>Traversal'
sFilePath
->String
-> m ()
Lenses
extension :: Lens' FilePath FilePathSource
A Lens
for reading and writing to the extension
Note: This is not a legal Lens
, unless you are careful to ensure that generated
extension FilePath
components are either null or start with extSeparator
and do not contain any internal extSeparator
s.
>>>
extension .~ ".png" $ "path/name.txt"
"path/name.png"
filename :: Lens' FilePath FilePathSource
A Lens
for reading and writing to the full filename
Note: This is not a legal Lens
, unless you are careful to ensure that generated
filename FilePath
components are not null and do not contain any
elements of pathSeparators
s.
>>>
filename .~ "name.txt" $ "path/name.png"
"path/name.txt"