| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
CabalGild.Action.AttachComments
Synopsis
- run :: (Applicative m, Ord p) => ([Field p], [Comment p]) -> m ([Field (p, [Comment p])], [Comment p])
- fields :: Ord p => [Field p] -> State [Comment p] [Field (p, [Comment p])]
- field :: Ord p => Field p -> State [Comment p] (Field (p, [Comment p]))
- name :: Ord p => Name p -> State [Comment p] (Name (p, [Comment p]))
- fieldLine :: Ord p => FieldLine p -> State [Comment p] (FieldLine (p, [Comment p]))
- sectionArg :: Ord p => SectionArg p -> State [Comment p] (SectionArg (p, [Comment p]))
- toPosition :: Ord p => p -> State [Comment p] (p, [Comment p])
Documentation
run :: (Applicative m, Ord p) => ([Field p], [Comment p]) -> m ([Field (p, [Comment p])], [Comment p]) Source #
High level wrapper around fields that makes this action easier to
compose with other actions.
fields :: Ord p => [Field p] -> State [Comment p] [Field (p, [Comment p])] Source #
Given a bunch of fields and comments, attaches each comment to the field
that it belongs to. It is assumed that both the fields and comments are
already sorted by their position p. This precondition is not checked.
field :: Ord p => Field p -> State [Comment p] (Field (p, [Comment p])) Source #
Attaches comments to a single field. Note that comments actually end up
attached to the field's name. That's because the Field type doesn't
have any annotations directly on it.
name :: Ord p => Name p -> State [Comment p] (Name (p, [Comment p])) Source #
Attaches comments to a name. Note that this could be a field name or a section name.
fieldLine :: Ord p => FieldLine p -> State [Comment p] (FieldLine (p, [Comment p])) Source #
Attach comments to a field line.
sectionArg :: Ord p => SectionArg p -> State [Comment p] (SectionArg (p, [Comment p])) Source #
Attaches comments to a section argument. Note that section arguments cannot actually have comments attached. That's because section arguments must be on -- the same line as the section name, so all comments will end up attached to the name.