monomorphic alternatives and similar packages
Based on the "Data" category.
Alternatively, view monomorphic alternatives based on common mentions on social networks and blogs.
-
semantic-source
Parsing, analyzing, and comparing source code across many languages -
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
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. -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
unordered-containers
Efficient hashing-based container types -
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. -
binary
Efficient, pure binary serialisation using ByteStrings in Haskell. -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
primitive
This package provides various primitive memory-related operations. -
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-map
Dependently-typed finite maps (partial dependent products) -
dependent-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text. -
safecopy
An extension to Data.Serialize with built-in version control -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation -
uuid-types
A Haskell library for creating, printing and parsing UUIDs
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of monomorphic or a related project?
README
The monomorphic
library
What is this?
This library provides the type-class and functions to convert polymorphic data-types to/from its monomorphic representation types. It is convenient to provide a monomorphic interface for dependently-typed programs.
Usage
Consider the following example:
data Nat = Z | S Nat
data SNat (n :: Nat) where
SZ :: SNat Z
SS :: SNat n -> SNat (S n)
instance Monomorphicable SNat where
type MonomorphicRep SNat = Int
promote 0 = Monomorphic SZ
promote n
| n < 0 = error "negative number"
| otherwise =
case promote (n - 1) of
Monomorphic sn -> Monomorphic (SS sn)
demote (Monomorphic sn) = toInt sn
data Vector (a :: *) (n :: Nat) where
VNil :: Vector a Z
(:-) :: a -> Vector a n -> Vector a (S n)
instance Monomorphicable (Vector a) whre
type MonomorphicRep (Vector a) = [a]
demote (Monomorphic n) = toList n
promote [] = Monomorphic Nil
promote (x:xs) =
case promote xs of
Monomorphic xs' -> Monomorphic $ x :- xs'
Monomorphic k
is the wrapper type to eliminate the polymorphic part of the types.
The Monomorphicable
type-class provides the functions to convert polymorphic value from/to its monomorphic representation, say MonomorphicRep k
associated type.
In the example above, SNat n
can be monomorphically represented by Int
.
There are some convenient functions to manipulate monomorphic types and functions. For more detail, see API documentation.