Popularity
7.2
Growing
Activity
0.0
Stable
28
5
1
Monthly Downloads: 26
Programming language: Haskell
License: MIT License
Latest version: v0.1.4
compound-types alternatives and similar packages
Based on the "Data" category.
Alternatively, view compound-types 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 -
code-builder
Packages for defining APIs, running them, generating client code and documentation. -
text
Haskell library for space- and time-efficient operations over Unicode text. -
unordered-containers
Efficient hashing-based container types -
cassava
A CSV parsing and encoding library optimized for ease of use and high performance -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
holmes
A reference library for constraint-solving with propagators and CDCL. -
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. -
json-autotype
Automatic Haskell type inference from JSON input -
discrimination
Fast linear time sorting and discrimination for a large class of data types -
audiovisual
Extensible records, variants, structs, effects, tangles -
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-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
dependent-map
Dependently-typed finite maps (partial dependent products) -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
safecopy
An extension to Data.Serialize with built-in version control -
bifunctors
Haskell 98 bifunctors, bifoldables and bitraversables -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation -
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 -
uuid-types
A Haskell library for creating, printing and parsing UUIDs -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text.
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Promo
www.influxdata.com
Do you think we are missing an alternative of compound-types or a related project?
README
Intro
This library provides first-class multi-arity product- and sum-types and neat type-level utilities for their composition. The solution is quite simple and doesn’t require the advanced proficiency in the language to be applied in practice.
Here's an example of what you can do with it:
-- |
-- This function exhibits the benefit of the first-class sum-type
-- being usable as a function parameter.
--
-- It also shows, how we can pattern-match it.
intCharBoolSumToString :: (Int + Char + Bool) -> String
intCharBoolSumToString =
\case
Sum3_1 int -> "Int: " <> show int
Sum3_2 char -> "Char: " <> show char
Sum3_3 bool -> "Bool: " <> show bool
-- |
-- Following is an example of a more complicated composition,
-- which is the same as the following type:
--
-- > Sum3 Int (Product2 Char (Sum2 Bool String)) Char
--
-- Just as in the math, the product operator exhibits a higher priority.
type SumAndProductMixture =
Int + Char * (Bool + String) + Char
-- |
-- Where there is a multiplication and addition,
-- there naturally must be a division and subtraction!
--
-- Following is an example of how we can extract parts of a composite type.
-- Here the type becomes the same as the following:
--
-- > Bool + String
type BoolOrString =
(SumAndProductMixture - Int - Char) / Char
Compatibility
The library supports GHC starting from version 8.6.1 and requires you to enable the NoStarIsType
extension.