Popularity
3.6
Stable
Activity
3.0
Stable
3
3
2
Monthly Downloads: 25
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags:
Data
Latest version: v0.0.1
HSet alternatives and similar packages
Based on the "Data" category.
Alternatively, view HSet 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
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
Promo
coderabbit.ai
Do you think we are missing an alternative of HSet or a related project?
README
HSet
A simple implementation of heterogeneous sets
in Haskell, assuming they implement Typeable
:
{-# LANGUAGE
DeriveDataTypeable
, ScopedTypeVariables
#-}
import Data.Typeable
import Data.HSet.Mutable as HSet
import Control.Monad.ST
data Foo = Foo
{ foo1 :: Int
, foo2 :: Int
} deriving (Typeable)
data Bar = Bar
{ bar1 :: Double
} deriving (Typeable)
mySet :: ST s (HSet s)
mySet = do
xs <- HSet.new
(fooKey :: HKey Foo) <- HSet.insert (Foo 1 2) xs
(barKey :: HKey Bar) <- HSet.insert (Bar 3.45) xs
You can then do lookups and deletions with the
fooKey
and barKey
mutable references.