definitive-filesystem-2.1.1.1: Filesystem-handling functions that are compatible with the definitive-base library

Safe HaskellNone
LanguageHaskell2010

IO.Filesystem

Contents

Synopsis

Exported modules and functions

module Definitive

createDirectoryIfMissing #

Arguments

:: Bool

Create its parents too?

-> FilePath

The path to the directory you want to make

-> IO () 

createDirectoryIfMissing parents dir creates a new directory dir if it doesn't exist. If the first argument is True the function will also create all parent directories if they are missing.

The File interface

resource :: (?programName :: FilePath) => FilePath -> FilePath Source #

workingDirectory :: IO DirEntry Source #

The working directory, as a DirEntry

data Location Source #

Constructors

Here 
Cache 
Owner 
Shared 

pathTo :: (?programName :: FilePath) => Location -> FilePath Source #

getConfig :: (?programName :: FilePath) => IO File Source #

A useful monad for manipulating the filesystem as a state

newtype FS a Source #

The FS monad is a wrapper around the IO monad that provides a MonadState instance for interacting with the filesystem through the Filesystem type.

Thus, you may use lenses to access the representation of files as though they were variables, like so :

runFS $ (file "x.bmp".bytes.serial.from bmp) ^>= \r ->
    file "foo".bytes.serial.from jpg =- r

Constructors

FS 

Fields

Instances

Functor FS Source # 

Methods

map :: (a -> b) -> FS a -> FS b #

SemiApplicative FS Source # 

Methods

(<*>) :: FS (a -> b) -> FS a -> FS b #

Applicative FS Source # 
Monad FS Source # 

Methods

join :: FS (FS a) -> FS a #

(>>=) :: FS a -> (a -> FS b) -> FS b #

MonadFix FS Source # 

Methods

mfix :: (a -> FS a) -> FS a #

Unit FS Source # 

Methods

pure :: a -> FS a #

MonadState Filesystem FS Source # 

Methods

get :: FS Filesystem #

put :: Filesystem -> FS () #

modify :: (Filesystem -> Filesystem) -> FS () #

Status and PermMask

Useful Lenses