constrained-some: Existential type that can be constrained

[ data, dependent-types, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

This library provides utilities for working with existential types and type-level constraints. It allows you to enforce multiple constraints on polymorphic types and containers complementing the package some.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1, 0.1.2
Change log CHANGELOG.md
Dependencies base (>=4.12 && <4.21) [details]
Tested with ghc ==8.10.4 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1
License MIT
Copyright © 2024 Julian Bruder
Author Julian Bruder
Maintainer julian.bruder@outlook.com
Category Data, Dependent Types
Home page https://github.com/bruderj15/constrained-some
Bug tracker https://github.com/bruderj15/constrained-some/issues
Uploaded by bruderj15 at 2024-11-29T15:00:48Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 47 total (47 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for constrained-some-0.1.1

[back to package description]

Hackage Static Badge Haskell-CI License: GPL v3

constrained-some

This library provides utilities for working with existential types and type-level constraints. It allows you to enforce multiple constraints on polymorphic types and containers complementing some.

Core

  • Existential Types: Somes and Somes1 provide existential wrappers for types with multiple constraints.
  • Convenient Aliases: Simplified types Some and Some1 for scenarios where just one constraint is needed.

Usage

import Data.Some.Constraint

someShowableOrd :: Somes '[Show, Ord]
someShowableOrd = Some (mempty :: [Double])

someNumFunctor :: Some1 Functor Num
someNumFunctor = Some1 $ [1, 2, 3 :: Int]

Contact information

Contributions, critics and bug reports are welcome!

Please feel free to contact me through GitHub.