Popularity
7.1
Declining
Activity
0.0
Stable
29
4
1
Monthly Downloads: 5
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.
-
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.
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
Promo
getstream.io

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.