Copyright | (C) CSIRO 2017-2018 |
---|---|

License | BSD3 |

Maintainer | George Wilson <george.wilson@data61.csiro.au> |

Stability | experimental |

Portability | non-portable |

Safe Haskell | None |

Language | Haskell2010 |

## Synopsis

- data Field s
- type SpacedField a = Spaced (Field a)
- data Spaced a = Spaced Spaces Spaces a
- class HasFields c d s t | c -> s, d -> t, c t -> d, d s -> c where
- class HasFields s s a a => AsField s a | s -> a where
- unescapedField :: Quote -> s -> Field s
- foldField :: (s -> b) -> (Quote -> Unescaped s -> b) -> Field s -> b
- fieldContents :: Lens (Field s) (Field t) s t

# Documentation

A `Field`

is a single cell from a CSV document.

Its value is either `Quoted`

, which indicates the type of quote
surrounding the value, or it is `Unquoted`

, containing only the value.

## Instances

`Spaced`

is a value with zero or many horizontal spaces around it on
both sides.

## Instances

Functor Spaced Source # | |

Applicative Spaced Source # | Appends the right parameter on the inside of the left parameter Spaced " " () " " *> Spaced "\t\t\t" () "\t \t" == Spaced " \t\t\t" () "\t \t " |

Foldable Spaced Source # | |

Defined in Data.Svfactor.Text.Space fold :: Monoid m => Spaced m -> m # foldMap :: Monoid m => (a -> m) -> Spaced a -> m # foldr :: (a -> b -> b) -> b -> Spaced a -> b # foldr' :: (a -> b -> b) -> b -> Spaced a -> b # foldl :: (b -> a -> b) -> b -> Spaced a -> b # foldl' :: (b -> a -> b) -> b -> Spaced a -> b # foldr1 :: (a -> a -> a) -> Spaced a -> a # foldl1 :: (a -> a -> a) -> Spaced a -> a # elem :: Eq a => a -> Spaced a -> Bool # maximum :: Ord a => Spaced a -> a # minimum :: Ord a => Spaced a -> a # | |

Traversable Spaced Source # | |

Eq a => Eq (Spaced a) Source # | |

Ord a => Ord (Spaced a) Source # | |

Defined in Data.Svfactor.Text.Space | |

Show a => Show (Spaced a) Source # | |

Generic (Spaced a) Source # | |

NFData a => NFData (Spaced a) Source # | |

Defined in Data.Svfactor.Text.Space | |

HasSpaced (Spaced a) (Spaced b) a b Source # | |

type Rep (Spaced a) Source # | |

Defined in Data.Svfactor.Text.Space type Rep (Spaced a) = D1 (MetaData "Spaced" "Data.Svfactor.Text.Space" "svfactor-0.1-GDLTyJD8FfREVKdyivwTvx" False) (C1 (MetaCons "Spaced" PrefixI True) (S1 (MetaSel (Just "_before") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Spaces) :*: (S1 (MetaSel (Just "_after") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Spaces) :*: S1 (MetaSel (Just "_value") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))) |

class HasFields c d s t | c -> s, d -> t, c t -> d, d s -> c where Source #

class HasFields s s a a => AsField s a | s -> a where Source #

Classy prisms for `Field`

unescapedField :: Quote -> s -> Field s Source #

Build a quoted field with a normal string