stgi-1.1: Educational implementation of the STG (Spineless Tagless G-machine)
Stg.Util
Contents
Description
Useful utilities that don't really fit in a specific location.
Synopsis
show' :: Show a => a -> Text Source #
show with Text as codomain.
show
Text
show' = pack . show
pack
data Validate err a Source #
Either with an accumulating Applicative instance
Either
Applicative
Constructors
Instances
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 #
fmap :: (a -> b) -> Validate a a -> Validate a b #
(<$) :: a -> Validate a b -> Validate a a #
Return success or the accumulation of all failures
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 #
commaSep :: [Doc ann] -> Doc ann Source #
[a,b,c] ==> a, b, c