streamly-core-0.2.2: Streaming, parsers, arrays, serialization and more
Copyright(c) 2019 Composewell Technologies
(c) 2013 Gabriel Gonzalez
LicenseBSD3
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.Data.Either.Strict

Description

| Strict data types to be used as accumulator for strict left folds and scans. For more comprehensive strict data types see https://hackage.haskell.org/package/strict-base-types . The names have been suffixed by a prime so that programmers can easily distinguish the strict versions from the lazy ones.

One major advantage of strict data structures as accumulators in folds and scans is that it helps the compiler optimize the code much better by unboxing. In a big tight loop the difference could be huge.

Synopsis

Documentation

data Either' a b Source #

A strict Either

Constructors

Left' !a 
Right' !b 

Instances

Instances details
(Show a, Show b) => Show (Either' a b) Source # 
Instance details

Defined in Streamly.Internal.Data.Either.Strict

Methods

showsPrec :: Int -> Either' a b -> ShowS Source #

show :: Either' a b -> String Source #

showList :: [Either' a b] -> ShowS Source #

isLeft' :: Either' a b -> Bool Source #

Return True if the given value is a Left', False otherwise.

isRight' :: Either' a b -> Bool Source #

Return True if the given value is a Right', False otherwise.

fromLeft' :: Either' a b -> a Source #

Return the contents of a Left'-value or errors out.

fromRight' :: Either' a b -> b Source #

Return the contents of a Right'-value or errors out.