lens-3.0.5: Lenses, Folds and Traversals

PortabilityRank2Types
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellNone

System.FilePath.Lens

Description

 

Synopsis

Documentation

(</>~) :: Setting a b FilePath FilePath -> FilePath -> a -> bSource

Modify the path by adding another path.

>>> :m + Control.Lens
>>> both </>~ "!!!" $ ("hello","world")
("hello/!!!","world/!!!")
 (</>~) :: Setter a b FilePath FilePath -> FilePath -> a -> b
 (</>~) :: Iso a b FilePath FilePath -> FilePath -> a -> b
 (</>~) :: Lens a b FilePath FilePath -> FilePath -> a -> b
 (</>~) :: Traversal a b FilePath FilePath -> FilePath -> a -> b

(<</>~) :: LensLike ((,) FilePath) a b FilePath FilePath -> FilePath -> a -> (FilePath, b)Source

Add a path onto the end of the target of a Lens and return the result

When you do not need the result of the operation, (</>~) is more flexible.

(<.>~) :: Setting a b FilePath FilePath -> String -> a -> bSource

Modify the path by adding extension.

>>> :m + Control.Lens
>>> both <.>~ "!!!" $ ("hello","world")
("hello.!!!","world.!!!")
 (<.>~) :: Setter a b FilePath FilePath -> String -> a -> b
 (<.>~) :: Iso a b FilePath FilePath -> String -> a -> b
 (<.>~) :: Lens a b FilePath FilePath -> String -> a -> b
 (<.>~) :: Traversal a b FilePath FilePath -> String -> a -> b

(<<.>~) :: LensLike ((,) FilePath) a b FilePath FilePath -> String -> a -> (FilePath, b)Source

Add an extension onto the end of the target of a Lens and return the result

When you do not need the result of the operation, (<.>~) is more flexible.

(</>=) :: MonadState a m => SimpleSetting a FilePath -> FilePath -> m ()Source

Modify the target(s) of a Simple Lens, Iso, Setter or Traversal by adding a path.

 (</>=) :: MonadState a m => Simple Setter a FilePath -> FilePath -> m ()
 (</>=) :: MonadState a m => Simple Iso a FilePath -> FilePath -> m ()
 (</>=) :: MonadState a m => Simple Lens a FilePath -> FilePath -> m ()
 (</>=) :: MonadState a m => Simple Traversal a FilePath -> FilePath -> m ()

(<</>=) :: MonadState a m => SimpleLensLike ((,) FilePath) a FilePath -> FilePath -> m FilePathSource

Add a path onto the end of the target of a Lens into your monad's state and return the result.

When you do not need the result of the operation, (</>=) is more flexible.

(<.>=) :: MonadState a m => SimpleSetting a FilePath -> String -> m ()Source

Modify the target(s) of a Simple Lens, Iso, Setter or Traversal by adding an extension.

 (<.>=) :: MonadState a m => Simple Setter a FilePath -> String -> m ()
 (<.>=) :: MonadState a m => Simple Iso a FilePath -> String -> m ()
 (<.>=) :: MonadState a m => Simple Lens a FilePath -> String -> m ()
 (<.>=) :: MonadState a m => Simple Traversal a FilePath -> String -> m ()

(<<.>=) :: MonadState a m => SimpleLensLike ((,) FilePath) a FilePath -> String -> m FilePathSource

Add an extension onto the end of the target of a Lens into your monad's state and return the result.

When you do not need the result of the operation, (<.>=) is more flexible.

basename :: Simple Lens FilePath FilePathSource

A lens reading and writing to the basename.

>>> basename .~ "filename" $ "path/name.png"
"path/filename.png"

directory :: Simple Lens FilePath FilePathSource

A lens reading and writing to the directory.

>>> "long/path/name.txt" ^. directory
"long/path"

extension :: Simple Lens FilePath FilePathSource

A lens reading and writing to the extension.

>>> extension .~ ".png" $ "path/name.txt"
"path/name.png"

filename :: Simple Lens FilePath FilePathSource

A lens reading and writing to the full filename.

>>> filename .~ "name.txt" $ "path/name.png"
"path/name.txt"