Data is:module

This module provides the Data class with its primitives for generic programming, along with instances for many datatypes. It corresponds to a merge between the previous Data.Generics.Basics and almost all of Data.Generics.Instances. The instances that are not present in this module were moved to the Data.Generics.Instances module in the syb package. "Scrap your boilerplate" --- Generic programming in Haskell. See https://wiki.haskell.org/Research_papers/Generics#Scrap_your_boilerplate.21.
Handle conversion of CmmData to LLVM code.
This module provides functions for creation and manipulation of vectors and matrices, IO, and other utilities.
Access to pandoc's data files.
This module defines Uniplate / Biplate instances for every type with a Data instance. Using GHC, Data can be derived automatically with:
data Expr = Var Int | Neg Expr | Add Expr Expr
deriving (Data,Typeable)
All the Uniplate operations defined in Data.Generics.Uniplate.Operations can be used. If you are working with abstract data types, such as Map or Set from the containers package, you may also need to use the data types defined in Data.Generics.Uniplate.Data.Instances. For faster performance (5x faster, but requires writing instances) switch to Data.Generics.Uniplate.Direct. If you get instance conflicts when using both Data and Direct, switch to Data.Generics.Uniplate.DataOnly. The instances are faster than GHC because they precompute a table of useful information, then use this information when performing the traversals. Sometimes it is not possible to compute the table, in which case this library will perform about the same speed as SYB. Setting the environment variable $UNIPLATE_VERBOSE has the following effects:
  • -1 - raise a program error every time construction of the table fails
  • 0 (or unset) - never print any messages or raise any errors
  • 1 - give a message every time a table is computed
  • 2 - give a message when table computation fails
The $UNIPLATE_VERBOSE environment variable must be set before the first call to uniplate.
An opaque data structure that represents a keyed data list. See also: Keyed data lists.
TextShow instances for data types in the Data.Data module. Since: 2
Generic combinators to derive type class instances.

Orphans

The Orphans module should be imported to derive the following classes using this library:

Minor discrepancies

Here are documented some corner cases of deriving, both by GHC and generic-data. They are all minor and unlikely to cause problems in practice.

Empty types

  • Some of the derived methods are lazy, which might result in errors being silenced, though unlikely.
  • The only generic-data implementation which differs from GHC stock instances is gfoldMap.
TODO: table

Single-constructor single-field types

data types with one constructor and one field are extremely rare. newtype is almost always more appropriate (for which there is no issue). That said, for data types both strict and lazy, all generic-data implementations are lazy (they don't even force the constructor), whereas GHC stock implementations, when they exist, are strict.

Functor composition

Fields of functors involving the composition of two or more functors f (g (h a)) result in some overhead using GHC.Generics.Generic1. This is due to a particular encoding choice of GHC.Generics, where composition are nested to the right instead of to the left. f (g (h _)) is represented by the functor f :.: (g :.: Rec1 h), so one must use fmap on f to convert that back to f (g (h _)). A better choice would have been to encode it as (Rec1 f :.: g) :.: h, because that is coercible back to f (g (h _)).
Generic representations as data types.

Warning

This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time. If something here seems useful, please report it or create a pull request to export it from an external module.
Common data types for Language.C: Identifiers, unique names, source code locations, ast node attributes and extensible errors.
This module re-exports the GitHub.Data. and GitHub.Auth submodules.
The Hledger.Data library allows parsing and querying of C++ ledger-style journal files. It generally provides a compatible subset of C++ ledger's functionality. This package re-exports all the Hledger.Data.* modules (except UTF8, which requires an explicit import.)
This module provides the Data class with its primitives for generic programming, along with instances for many datatypes. It corresponds to a merge between the previous Data.Generics.Basics and almost all of Data.Generics.Instances. The instances that are not present in this module were moved to the Data.Generics.Instances module in the syb package. "Scrap your boilerplate" --- Generic programming in Haskell. See https://wiki.haskell.org/Research_papers/Generics#Scrap_your_boilerplate.21.
Basic data types used throughout the package.
Wrappers and adaptors for various data structures common in the Haskell ecosystem. This is intended to be used directly:
import Core.Data
as this module re-exports all of its various components.
Maintainer : jgoerzen@complete.org Stability : provisional Portability: portable Haskell types for libmagic constants Written by John Goerzen, jgoerzen@complete.org
Data primitives and utilities Whilst the library makes use of numhask, it does not re-export, to avoid clashes with Prelude, with the exception of zero, one, angle & abs. Rect and Point, from numhask-space, make up the base elements of many chart primitives.
This module provides compatibility definitions of data-type declaration templates for before temaplate-haskell-2.11