stgi-1.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 # 

Methods

bimap :: (a -> b) -> (c -> d) -> Validate a c -> Validate b d #

first :: (a -> b) -> Validate a c -> Validate b c #

second :: (b -> c) -> Validate a b -> Validate a c #

Functor (Validate a) Source # 

Methods

fmap :: (a -> b) -> Validate a a -> Validate a b #

(<$) :: a -> Validate a b -> Validate a a #

Monoid a => Applicative (Validate a) Source #

Return success or the accumulation of all failures

Methods

pure :: a -> Validate a a #

(<*>) :: Validate a (a -> b) -> Validate a a -> Validate a b #

(*>) :: Validate a a -> Validate a b -> Validate a b #

(<*) :: Validate a a -> Validate a b -> Validate a a #

Prettyprinter extensions

commaSep :: [Doc ann] -> Doc ann Source #

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