stgi-1.0.1: Educational implementation of the STG (Spineless Tagless G-machine)

Safe HaskellSafe
LanguageHaskell2010

Stg.Util

Contents

Description

Useful utilities that don't really fit in a specific location.

Synopsis

Documentation

show' :: Show a => a -> Text Source

show with Text as codomain.

show' = pack . show

data Validate err a Source

Either with an accumulating Applicative instance

Constructors

Failure err 
Success a 

Instances

Bifunctor Validate Source 
Functor (Validate a) Source 
Monoid a => Applicative (Validate a) Source

Return success or the accumulation of all failures

Prettyprinter extensions

commaSep :: [Doc] -> Doc Source

[a,b,c]  ==>  a, b, c

bulletList :: [Doc] -> Doc Source

Prefix all contained documents with a bullet symbol.

pluralS :: [a] -> Doc Source

Add an 's' for non-singleton lists.