dhall-1.42.3: A configuration language guaranteed to terminate

Safe Haskell | None
Language | Haskell2010

Dhall.DirectoryTree

Contents

- Filesystem
- Low-level types and functions

Description

Implementation of the `dhall to-directory-tree` subcommand

Synopsis

- toDirectoryTree :: Bool -> FilePath -> Expr Void Void -> IO ()
- newtype FilesystemError = FilesystemError {
  - unexpectedExpression :: Expr Void Void
  }
- data Mode (f :: Type -> Type) = Mode {
  - modeUser :: f (Access f)
  - modeGroup :: f (Access f)
  - modeOther :: f (Access f)
  }
- setFileMode :: FilePath -> FileMode -> IO ()
- data User
  - = UserId UserID
  - | UserName String
- data FilesystemEntry where
  - DirectoryEntry (Entry (Seq FilesystemEntry))
  - BinaryFileEntry BinaryFileEntry
  - TextFileEntry TextFileEntry
  - pattern FileEntry :: Entry Text -> FilesystemEntry
- type DirectoryEntry = Entry (Seq FilesystemEntry)
- type BinaryFileEntry = Entry ByteString
- type TextFileEntry = Entry Text
- type FileEntry = Entry Text
- data Entry a = Entry {
  - entryName :: String
  - entryContent :: a
  - entryUser :: Maybe User
  - entryGroup :: Maybe Group
  - entryMode :: Maybe (Mode Maybe)
  }
- data Group
  - = GroupId GroupID
  - | GroupName String
- data Access (f :: Type -> Type) = Access {
  - accessExecute :: f Bool
  - accessRead :: f Bool
  - accessWrite :: f Bool
  }
- prettyFileMode :: FileMode -> String
- isMetadataSupported :: Bool
- decodeDirectoryTree :: Expr s Void -> IO (Seq FilesystemEntry)
- directoryTreeType :: Expector (Expr Src Void)

# Filesystem

toDirectoryTree Source #

Arguments

:: Bool | Whether to allow path separators in file names or not
-> FilePath |
-> Expr Void Void |
-> IO () |

Attempt to transform a Dhall record into a directory tree where:

- Records are translated into directories
- `Map`s are also translated into directories
- `Text` values or fields are translated into files
- `Optional` values are omitted if `None`
- There is a more advanced way to construct directory trees using a fixpoint encoding. See the documentation below on that.

For example, the following Dhall record:

    { dir = { `hello.txt` = "Hello\n" }
    , `goodbye.txt`= Some "Goodbye\n"
    , `missing.txt` = None Text
    }

... should translate to this directory tree:

    $ tree result
    result
    ├── dir
    │   └── hello.txt
    └── goodbye.txt

    $ cat result/dir/hello.txt
    Hello

    $ cat result/goodbye.txt
    Goodbye

Use this in conjunction with the Prelude's support for rendering JSON/YAML in "pure Dhall" so that you can generate files containing JSON. For example:

    let JSON =
          https://prelude.dhall-lang.org/v12.0.0/JSON/package.dhall sha256:843783d29e60b558c2de431ce1206ce34bdfde375fcf06de8ec5bf77092fdef7

    in  { `example.json` =
            JSON.render (JSON.array [ JSON.number 1.0, JSON.bool True ])
        , `example.yaml` =
            JSON.renderYAML
              (JSON.object (toMap { foo = JSON.string "Hello", bar = JSON.null }))
        }

... which would generate:

    $ cat result/example.json
    [ 1.0, true ]

    $ cat result/example.yaml
    ! "bar": null
    ! "foo": "Hello"

Advanced construction of directory trees

In addition to the ways described above using "simple" Dhall values to construct the directory tree there is one based on a fixpoint encoding. It works by passing a value of the following type to the interpreter:

    let User = < UserId : Natural | UserName : Text >

    let Group = < GroupId : Natural | GroupName : Text >

    let Access =
          { execute : Optional Bool
          , read : Optional Bool
          , write : Optional Bool
          }

    let Mode =
          { user : Optional Access
          , group : Optional Access
          , other : Optional Access
          }

    let Entry =
          \(content : Type) ->
            { name : Text
            , content : content
            , user : Optional User
            , group : Optional Group
            , mode : Optional Mode
            }

    in  forall (tree : Type) ->
        forall  ( make
                : { directory : Entry (List tree) -> tree
                  , file : Entry Text -> tree
                  }
                ) ->
          List tree

The fact that the metadata for filesystem entries is modeled after the POSIX permission model comes with the unfortunate downside that it might not apply to other systems: There, changes to the metadata (user, group, permissions) might be a no-op and no warning will be issued. This is a leaking abstraction of the unix-compat package used internally.

NOTE: This utility does not take care of type-checking and normalizing the provided expression. This will raise a `FilesystemError` exception or a `DhallErrors` exception upon encountering an expression that cannot be converted as-is.

newtype FilesystemError Source #

This error indicates that you supplied an invalid Dhall expression to the `toDirectoryTree` function. The Dhall expression could not be translated to a directory tree.

Constructors

FilesystemError |

Fields

- unexpectedExpression :: Expr Void Void

#### Instances

Instances details

Exception FilesystemError Source # |
Instance details Defined in Dhall.DirectoryTree Methods toException :: FilesystemError -> SomeException Source # fromException :: SomeException -> Maybe FilesystemError Source # displayException :: FilesystemError -> String Source # backtraceDesired :: FilesystemError -> Bool Source #
Show FilesystemError Source # |
Instance details Defined in Dhall.DirectoryTree Methods showsPrec :: Int -> FilesystemError -> ShowS Source # show :: FilesystemError -> String Source # showList :: [FilesystemError] -> ShowS Source #

# Low-level types and functions

data Mode (f :: Type -> Type) Source #

A filesystem mode. See chmod(1). The parameter is meant to be instantiated by either `Identity` or `Maybe` depending on the completeness of the information: * For data read from the filesystem it will be `Identity`. * For user-supplied data it will be `Maybe` as we want to be able to set only specific bits.

Constructors

Mode |

Fields

- modeUser :: f (Access f)
- modeGroup :: f (Access f)
- modeOther :: f (Access f)

#### Instances

Instances details

FromDhall (Mode Identity) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder (Mode Identity) Source #
FromDhall (Mode Maybe) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder (Mode Maybe) Source #
Generic (Mode f) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Associated Types

type Rep (Mode f) |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep (Mode f) = D1 ('MetaData "Mode" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "Mode" 'PrefixI 'True) (S1 ('MetaSel ('Just "modeUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Access f))) :*: (S1 ('MetaSel ('Just "modeGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Access f))) :*: S1 ('MetaSel ('Just "modeOther") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Access f))))))

Methods

from :: Mode f -> Rep (Mode f) x Source #

to :: Rep (Mode f) x -> Mode f Source #

Show (Mode Identity) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> Mode Identity -> ShowS Source # show :: Mode Identity -> String Source # showList :: [Mode Identity] -> ShowS Source #
Show (Mode Maybe) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> Mode Maybe -> ShowS Source # show :: Mode Maybe -> String Source # showList :: [Mode Maybe] -> ShowS Source #
Eq (Mode Identity) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: Mode Identity -> Mode Identity -> Bool Source # (/=) :: Mode Identity -> Mode Identity -> Bool Source #
Eq (Mode Maybe) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: Mode Maybe -> Mode Maybe -> Bool Source # (/=) :: Mode Maybe -> Mode Maybe -> Bool Source #
Ord (Mode Identity) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Methods

compare :: Mode Identity -> Mode Identity -> Ordering Source #

(<) :: Mode Identity -> Mode Identity -> Bool Source #

(<=) :: Mode Identity -> Mode Identity -> Bool Source #

(>) :: Mode Identity -> Mode Identity -> Bool Source #

(>=) :: Mode Identity -> Mode Identity -> Bool Source #

max :: Mode Identity -> Mode Identity -> Mode Identity Source #

min :: Mode Identity -> Mode Identity -> Mode Identity Source #

Ord (Mode Maybe) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Methods

compare :: Mode Maybe -> Mode Maybe -> Ordering Source #

(<) :: Mode Maybe -> Mode Maybe -> Bool Source #

(<=) :: Mode Maybe -> Mode Maybe -> Bool Source #

(>) :: Mode Maybe -> Mode Maybe -> Bool Source #

(>=) :: Mode Maybe -> Mode Maybe -> Bool Source #

max :: Mode Maybe -> Mode Maybe -> Mode Maybe Source #

min :: Mode Maybe -> Mode Maybe -> Mode Maybe Source #

type Rep (Mode f) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep (Mode f) = D1 ('MetaData "Mode" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "Mode" 'PrefixI 'True) (S1 ('MetaSel ('Just "modeUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Access f))) :*: (S1 ('MetaSel ('Just "modeGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Access f))) :*: S1 ('MetaSel ('Just "modeOther") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Access f))))))

setFileMode :: FilePath -> FileMode -> IO () Source #

A wrapper around `setFileMode`. On Windows, it does check the resulting file mode of the file/directory and emits a warning if it doesn't match the desired file mode. On all other OS it is identical to `setFileMode` as it is assumed to work correctly.

data User Source #

A user identified either by id or name.

Constructors

UserId UserID |
UserName String |

#### Instances

Instances details

FromDhall User Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder User Source #
Generic User Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Associated Types

type Rep User |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep User = D1 ('MetaData "User" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "UserId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UserID)) :+: C1 ('MetaCons "UserName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

Methods

from :: User -> Rep User x Source #

to :: Rep User x -> User Source #

Show User Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> User -> ShowS Source # show :: User -> String Source # showList :: [User] -> ShowS Source #
Eq User Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: User -> User -> Bool Source # (/=) :: User -> User -> Bool Source #
Ord User Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods compare :: User -> User -> Ordering Source # (<) :: User -> User -> Bool Source # (<=) :: User -> User -> Bool Source # (>) :: User -> User -> Bool Source # (>=) :: User -> User -> Bool Source # max :: User -> User -> User Source # min :: User -> User -> User Source #
type Rep User Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep User = D1 ('MetaData "User" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "UserId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UserID)) :+: C1 ('MetaCons "UserName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

data FilesystemEntry Source #

A filesystem entry.

Constructors

DirectoryEntry (Entry (Seq FilesystemEntry)) |
BinaryFileEntry BinaryFileEntry |
TextFileEntry TextFileEntry |

Bundled Patterns

pattern FileEntry :: Entry Text -> FilesystemEntry | Deprecated: `FileEntry` is deprecated and will be removed eventually. Please use `TextFileEntry` instead.

#### Instances

Instances details

FromDhall FilesystemEntry Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder FilesystemEntry Source #
Generic FilesystemEntry Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Associated Types

type Rep FilesystemEntry |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep FilesystemEntry = D1 ('MetaData "FilesystemEntry" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "DirectoryEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Entry (Seq FilesystemEntry)))) :+: (C1 ('MetaCons "BinaryFileEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BinaryFileEntry)) :+: C1 ('MetaCons "TextFileEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextFileEntry))))

Methods

from :: FilesystemEntry -> Rep FilesystemEntry x Source #

to :: Rep FilesystemEntry x -> FilesystemEntry Source #

Show FilesystemEntry Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> FilesystemEntry -> ShowS Source # show :: FilesystemEntry -> String Source # showList :: [FilesystemEntry] -> ShowS Source #
Eq FilesystemEntry Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: FilesystemEntry -> FilesystemEntry -> Bool Source # (/=) :: FilesystemEntry -> FilesystemEntry -> Bool Source #
Ord FilesystemEntry Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Methods

compare :: FilesystemEntry -> FilesystemEntry -> Ordering Source #

(<) :: FilesystemEntry -> FilesystemEntry -> Bool Source #

(<=) :: FilesystemEntry -> FilesystemEntry -> Bool Source #

(>) :: FilesystemEntry -> FilesystemEntry -> Bool Source #

(>=) :: FilesystemEntry -> FilesystemEntry -> Bool Source #

max :: FilesystemEntry -> FilesystemEntry -> FilesystemEntry Source #

min :: FilesystemEntry -> FilesystemEntry -> FilesystemEntry Source #

type Rep FilesystemEntry Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep FilesystemEntry = D1 ('MetaData "FilesystemEntry" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "DirectoryEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Entry (Seq FilesystemEntry)))) :+: (C1 ('MetaCons "BinaryFileEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BinaryFileEntry)) :+: C1 ('MetaCons "TextFileEntry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextFileEntry))))

type DirectoryEntry = Entry (Seq FilesystemEntry) Source #

A directory in the filesystem.

type BinaryFileEntry = Entry ByteString Source #

A binary file in the filesystem.

type TextFileEntry = Entry Text Source #

A text file in the filesystem.

type FileEntry = Entry Text Source #

Deprecated: `FileEntry` is deprecated and will be removed eventually. Please use `TextFileEntry` instead.

A file in the filesystem.

data Entry a Source #

A generic filesystem entry. This type holds the metadata that apply to all entries. It is parametric over the content of such an entry.

Constructors

Entry |

Fields

- entryName :: String
- entryContent :: a
- entryUser :: Maybe User
- entryGroup :: Maybe Group
- entryMode :: Maybe (Mode Maybe)

#### Instances

Instances details

FromDhall a => FromDhall (Entry a) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder (Entry a) Source #
Generic (Entry a) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Associated Types

type Rep (Entry a) |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep (Entry a) = D1 ('MetaData "Entry" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "Entry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "entryName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "entryContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :*: (S1 ('MetaSel ('Just "entryUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe User)) :*: (S1 ('MetaSel ('Just "entryGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Group)) :*: S1 ('MetaSel ('Just "entryMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Mode Maybe)))))))

Methods

from :: Entry a -> Rep (Entry a) x Source #

to :: Rep (Entry a) x -> Entry a Source #

Show a => Show (Entry a) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> Entry a -> ShowS Source # show :: Entry a -> String Source # showList :: [Entry a] -> ShowS Source #
Eq a => Eq (Entry a) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: Entry a -> Entry a -> Bool Source # (/=) :: Entry a -> Entry a -> Bool Source #
Ord a => Ord (Entry a) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods compare :: Entry a -> Entry a -> Ordering Source # (<) :: Entry a -> Entry a -> Bool Source # (<=) :: Entry a -> Entry a -> Bool Source # (>) :: Entry a -> Entry a -> Bool Source # (>=) :: Entry a -> Entry a -> Bool Source # max :: Entry a -> Entry a -> Entry a Source # min :: Entry a -> Entry a -> Entry a Source #
type Rep (Entry a) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep (Entry a) = D1 ('MetaData "Entry" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "Entry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "entryName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "entryContent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :*: (S1 ('MetaSel ('Just "entryUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe User)) :*: (S1 ('MetaSel ('Just "entryGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Group)) :*: S1 ('MetaSel ('Just "entryMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Mode Maybe)))))))

data Group Source #

A group identified either by id or name.

Constructors

GroupId GroupID |
GroupName String |

#### Instances

Instances details

FromDhall Group Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder Group Source #
Generic Group Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Associated Types

type Rep Group |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep Group = D1 ('MetaData "Group" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "GroupId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GroupID)) :+: C1 ('MetaCons "GroupName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

Methods

from :: Group -> Rep Group x Source #

to :: Rep Group x -> Group Source #

Show Group Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> Group -> ShowS Source # show :: Group -> String Source # showList :: [Group] -> ShowS Source #
Eq Group Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: Group -> Group -> Bool Source # (/=) :: Group -> Group -> Bool Source #
Ord Group Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods compare :: Group -> Group -> Ordering Source # (<) :: Group -> Group -> Bool Source # (<=) :: Group -> Group -> Bool Source # (>) :: Group -> Group -> Bool Source # (>=) :: Group -> Group -> Bool Source # max :: Group -> Group -> Group Source # min :: Group -> Group -> Group Source #
type Rep Group Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep Group = D1 ('MetaData "Group" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "GroupId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GroupID)) :+: C1 ('MetaCons "GroupName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

data Access (f :: Type -> Type) Source #

The permissions for a subject (usergroupother).

Constructors

Access |

Fields

- accessExecute :: f Bool
- accessRead :: f Bool
- accessWrite :: f Bool

#### Instances

Instances details

FromDhall (Access Identity) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder (Access Identity) Source #
FromDhall (Access Maybe) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods autoWith :: InputNormalizer -> Decoder (Access Maybe) Source #
Generic (Access f) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Associated Types

type Rep (Access f) |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep (Access f) = D1 ('MetaData "Access" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "Access" 'PrefixI 'True) (S1 ('MetaSel ('Just "accessExecute") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)) :*: (S1 ('MetaSel ('Just "accessRead") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)) :*: S1 ('MetaSel ('Just "accessWrite") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)))))

Methods

from :: Access f -> Rep (Access f) x Source #

to :: Rep (Access f) x -> Access f Source #

Show (Access Identity) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> Access Identity -> ShowS Source # show :: Access Identity -> String Source # showList :: [Access Identity] -> ShowS Source #
Show (Access Maybe) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods showsPrec :: Int -> Access Maybe -> ShowS Source # show :: Access Maybe -> String Source # showList :: [Access Maybe] -> ShowS Source #
Eq (Access Identity) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: Access Identity -> Access Identity -> Bool Source # (/=) :: Access Identity -> Access Identity -> Bool Source #
Eq (Access Maybe) Source # |
Instance details Defined in Dhall.DirectoryTree.Types Methods (==) :: Access Maybe -> Access Maybe -> Bool Source # (/=) :: Access Maybe -> Access Maybe -> Bool Source #
Ord (Access Identity) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Methods

compare :: Access Identity -> Access Identity -> Ordering Source #

(<) :: Access Identity -> Access Identity -> Bool Source #

(<=) :: Access Identity -> Access Identity -> Bool Source #

(>) :: Access Identity -> Access Identity -> Bool Source #

(>=) :: Access Identity -> Access Identity -> Bool Source #

max :: Access Identity -> Access Identity -> Access Identity Source #

min :: Access Identity -> Access Identity -> Access Identity Source #

Ord (Access Maybe) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

Methods

compare :: Access Maybe -> Access Maybe -> Ordering Source #

(<) :: Access Maybe -> Access Maybe -> Bool Source #

(<=) :: Access Maybe -> Access Maybe -> Bool Source #

(>) :: Access Maybe -> Access Maybe -> Bool Source #

(>=) :: Access Maybe -> Access Maybe -> Bool Source #

max :: Access Maybe -> Access Maybe -> Access Maybe Source #

min :: Access Maybe -> Access Maybe -> Access Maybe Source #

type Rep (Access f) Source # |

Instance details

Defined in Dhall.DirectoryTree.Types

type Rep (Access f) = D1 ('MetaData "Access" "Dhall.DirectoryTree.Types" "dhall-1.42.3-EZu4kpogyzhJMovFi16F5D" 'False) (C1 ('MetaCons "Access" 'PrefixI 'True) (S1 ('MetaSel ('Just "accessExecute") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)) :*: (S1 ('MetaSel ('Just "accessRead") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)) :*: S1 ('MetaSel ('Just "accessWrite") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)))))

prettyFileMode :: FileMode -> String Source #

Pretty-print a `FileMode`. The format is similar to the one ls(1): It is display as three blocks of three characters. The first block are the permissions of the user, the second one are the ones of the group and the third one the ones of other subjects. A `r` denotes that the file or directory is readable by the subject, a `w` denotes that it is writable and an `x` denotes that it is executable. Unset permissions are represented by `-`.

isMetadataSupported :: Bool Source #

Is setting metadata supported on this platform or not.

decodeDirectoryTree :: Expr s Void -> IO (Seq FilesystemEntry) Source #

Decode a fixpoint directory tree from a Dhall expression.

directoryTreeType :: Expector (Expr Src Void) Source #

The type of a fixpoint directory tree expression.