possibly alternatives and similar packages
Based on the "Data" category.
Alternatively, view possibly alternatives based on common mentions on social networks and blogs.
-
semantic-source
Parsing, analyzing, and comparing source code across many languages -
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
text
Haskell library for space- and time-efficient operations over Unicode text. -
code-builder
Packages for defining APIs, running them, generating client code and documentation. -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
unordered-containers
Efficient hashing-based container types -
cassava
A CSV parsing and encoding library optimized for ease of use and high performance -
holmes
A reference library for constraint-solving with propagators and CDCL. -
binary
Efficient, pure binary serialisation using ByteStrings in Haskell. -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
primitive
This package provides various primitive memory-related operations. -
discrimination
Fast linear time sorting and discrimination for a large class of data types -
reflection
Reifies arbitrary Haskell terms into types that can be reflected back into terms -
IORefCAS
A collection of different packages for CAS based data structures. -
dependent-map
Dependently-typed finite maps (partial dependent products) -
dependent-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text. -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation -
uuid-types
A Haskell library for creating, printing and parsing UUIDs
Static code analysis for 29 languages.
Do you think we are missing an alternative of possibly or a related project?
README
enum-text
A simple toolkit for rendering enumerated types into Text
Builder
(used by
the fmt
package) and parsing them
back again into Text with the provided TextParsable
type class.
To get the Buildable
and TextParsable
instances for an enumerated data type
the following pattern can be used without any language extensions:
import Fmt
import Text.Enum.Text
data Foo = FOO_bar | FOO_bar_baz
deriving (Bounded,Enum,Eq,Ord,Show)
instance EnumText Foo
instance Buildable Foo where build = buildEnumText
instance TextParsable Foo where parseText = parseEnumText
With the DeriveAnyClass
language extension you can list EnumText
in the
deriving
clause, and with DerivingVia
(available from GHC 8.6.1) you can
derive via
UsingEnumText
as follows:
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingVia #-}
import Fmt
import Text.Enum.Text
data Foo = FOO_bar | FOO_bar_baz
deriving (Bounded,Enum,EnumText,Eq,Ord,Show)
deriving (Buildable,TextParsable) via UsingEnumText Foo
This will use the default configuration for generating the text of each
enumeration from the derived show
text, namely:
- removing the prefix upto and including the first underscore (
_
); - converting each subsequent underscore (
_
) into a dash (-
).
See the Haddocks for details on how to override this default configuration for any given enumeration type.
Functions for rendering text, generating and parsing UTF-8 encoded ByteStrings
(suitable for cassava) and Hashable
functions are also provided EnumText
.