Popularity
5.5
Stable
Activity
0.0
Stable
12
4
1
Monthly Downloads: 6
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags:
Data
Latest version: v0.3.0.4
polyvariadic alternatives and similar packages
Based on the "Data" category.
Alternatively, view polyvariadic 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.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
Promo
www.saashub.com
Do you think we are missing an alternative of polyvariadic or a related project?
README
polyvariadic
Creation and application of polyvariadic functions
For example, the classic printf:
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
import Data.Function.Polyvariadic
import Data.Accumulator
magicChar = '%'
notMagicChar = (/= magicChar)
data PrintfAccum = PrintfAccum { done :: String, todo :: String }
instance Show x => Accumulator PrintfAccum x where
accumulate x (PrintfAccum done (_:todo)) = PrintfAccum
(done ++ show x ++ takeWhile notMagicChar todo)
(dropWhile notMagicChar todo)
accumulate _ acc = acc
printf' str = polyvariadic
(PrintfAccum (takeWhile notMagicChar str) (dropWhile notMagicChar str))
done
>>> printf' "aaa%bbb%ccc%ddd" "TEST" 123 True
"aaa\"TEST\"bbb123cccTrueddd"