data-default-generics alternatives and similar packages
Based on the "Data" category.
Alternatively, view data-default-generics alternatives based on common mentions on social networks and blogs.
-
compendium-client
DISCONTINUED. Mu (μ) is a purely functional framework for building micro services. -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text.
InfluxDB – Built for High-Performance Time Series Workloads

Do you think we are missing an alternative of data-default-generics or a related project?
README
data-default-generics
A class for types with a default value.
This is a fork of the package originally developed by Lukas Mai, data-default, with the following additions:
- Regrouped everything in a single module
- Added several instances, namely Either, Text, ByteString, etc
- Added Generics support by Jonathan Fischoff, with some additional support for recursive datatypes by me, with the precious help of José Pedro Magalhães
It should be usable as a drop-in replacement.
Usage
Supose you've got a structure:
data TestRec = TestRec
{ bool :: Bool
, txt :: T.Text
, bs :: BSL.ByteString
, lst :: [CInt]
, ut :: UTCTime
} deriving (Eq,Show)
And you want to quickly define a default value for it, in a way that does not require code changes if the structure later gets altered. Modify the previous to:
{-# LANGUAGE DeriveGeneric #-}
(...)
import Data.Default.Generics
import GHC.Generics
(...)
data TestRec = TestRec
{ bool :: Bool
, txt :: T.Text
, bs :: BSL.ByteString
, lst :: [CInt]
, ut :: UTCTime
} deriving (Eq,Show, Generic)
instance Default TestRec
And then you can use the default value for this structure as def
, as long as you import Data.Default.Generics
.
Bugs
Issues and pull requests are most welcome. Any additional instance for data types from the Haskell Platform will be considered.