| Portability | Rank2Types |
|---|---|
| Stability | experimental |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Safe Haskell | None |
System.FilePath.Lens
Description
- (</>~) :: Setting s t FilePath FilePath -> FilePath -> s -> t
- (<</>~) :: LensLike ((,) FilePath) s a FilePath FilePath -> FilePath -> s -> (FilePath, a)
- (<.>~) :: Setting s a FilePath FilePath -> String -> s -> a
- (<<.>~) :: LensLike ((,) FilePath) s a FilePath FilePath -> String -> s -> (FilePath, a)
- (</>=) :: MonadState s m => SimpleSetting s FilePath -> FilePath -> m ()
- (<</>=) :: MonadState s m => SimpleLensLike ((,) FilePath) s FilePath -> FilePath -> m FilePath
- (<.>=) :: MonadState s m => SimpleSetting s FilePath -> String -> m ()
- (<<.>=) :: MonadState s m => SimpleLensLike ((,) FilePath) s FilePath -> String -> m FilePath
- basename :: Simple Lens FilePath FilePath
- directory :: Simple Lens FilePath FilePath
- extension :: Simple Lens FilePath FilePath
- filename :: Simple Lens FilePath FilePath
Operators
(</>~) :: Setting s t FilePath FilePath -> FilePath -> s -> tSource
Modify the path by adding another path.
>>>both </>~ "bin" $ ("hello","world")("hello/bin","world/bin")
(</>~) ::Setters aFilePathFilePath->FilePath-> s -> a (</>~) ::Isos aFilePathFilePath->FilePath-> s -> a (</>~) ::Lenss aFilePathFilePath->FilePath-> s -> a (</>~) ::Traversals aFilePathFilePath->FilePath-> s -> a
(<.>~) :: Setting s a FilePath FilePath -> String -> s -> aSource
Modify the path by adding extension.
>>>both <.>~ "txt" $ ("hello","world")("hello.txt","world.txt")
(<.>~) ::Setters aFilePathFilePath->String-> s -> a (<.>~) ::Isos aFilePathFilePath->String-> s -> a (<.>~) ::Lenss aFilePathFilePath->String-> s -> a (<.>~) ::Traversals aFilePathFilePath->String-> s -> a
(</>=) :: MonadState s m => SimpleSetting 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")
(</>=) ::MonadStates m =>SimpleSettersFilePath->FilePath-> m () (</>=) ::MonadStates m =>SimpleIsosFilePath->FilePath-> m () (</>=) ::MonadStates m =>SimpleLenssFilePath->FilePath-> m () (</>=) ::MonadStates m =>SimpleTraversalsFilePath->FilePath-> m ()
(<</>=) :: MonadState s m => SimpleLensLike ((,) FilePath) s FilePath -> FilePath -> m FilePathSource
(<.>=) :: MonadState s m => SimpleSetting 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")
(<.>=) ::MonadStates m =>SimpleSettersFilePath->String-> m () (<.>=) ::MonadStates m =>SimpleIsosFilePath->String-> m () (<.>=) ::MonadStates m =>SimpleLenssFilePath->String-> m () (<.>=) ::MonadStates m =>SimpleTraversalsFilePath->String-> m ()
(<<.>=) :: MonadState s m => SimpleLensLike ((,) FilePath) s FilePath -> String -> m FilePathSource
Lenses
basename :: Simple Lens FilePath FilePathSource
A Lens for reading and writing to the basename
>>>basename .~ "filename" $ "path/name.png""path/filename.png"
directory :: Simple Lens FilePath FilePathSource
A Lens for reading and writing to the directory
>>>"long/path/name.txt" ^. directory"long/path"