validated-literals alternatives and similar packages
Based on the "Data" category.
Alternatively, view validated-literals alternatives based on common mentions on social networks and blogs.
-
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
semantic-source
Parsing, analyzing, and comparing source code across many languages -
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. -
unordered-containers
Efficient hashing-based container types -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
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. -
hashable
A class for types that can be converted to a hash value -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
primitive
This package provides various primitive memory-related operations. -
binary
Efficient, pure binary serialisation using ByteStrings in Haskell. -
discrimination
Fast linear time sorting and discrimination for a large class of data types -
json-autotype
Automatic Haskell type inference from JSON input -
hashtables
Mutable hash tables for Haskell, in the ST monad -
reflection
Reifies arbitrary Haskell terms into types that can be reflected back into terms -
audiovisual
Extensible records, variants, structs, effects, tangles -
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 -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation -
bifunctors
Haskell 98 bifunctors, bifoldables and bitraversables -
protobuf
An implementation of Google's Protocol Buffers in Haskell. -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
safecopy
An extension to Data.Serialize with built-in version control -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text. -
uuid-types
A Haskell library for creating, printing and parsing UUIDs
Access the most powerful time series database as a service
Do you think we are missing an alternative of validated-literals or a related project?
README
validated-literals: Compile-time checking for partial smart-constructors
To disallow invalid input it is common to define (new)types with hidden data
constructors. Forcing the user to go through a smart-constructor that enforces
invariants and returns Maybe ResultType
, preventing the construction of data
with invalid values.
However, it is also common to want to include literal values of such types
in source text. Things of textual literals for HTML, HTTP, etc. In such cases
smart-constructors force us to handle potential conversion failures at runtime,
or abusing functions like fromJust
to break away all the safety
smart-constructors provide. All this despite the fact that we can statically
know at compile time that the conversion will always succeed or always fails.
This package provides a typeclasses for using TH to validate the correctness of
provided literals at compile. This lets you define, e.g., newtype Even = Even
Integer
and write:
x :: Even
x = $$(valid 38)
This will check, at compile time, that the provided Integer
is, in fact, even
and unwrap it from Maybe
, avoiding the runtime check.
*Note that all licence references and agreements mentioned in the validated-literals README section above
are relevant to that project's source code only.