2-- Module : Streamly.Internal.Data.Strict
3-- Copyright : (c) 2019 Composewell Technologies
4-- (c) 2013 Gabriel Gonzalez
6-- Maintainer : streamly@composewell.com
7-- Stability : experimental
10-- | Strict data types to be used as accumulator for strict left folds and
11-- scans. For more comprehensive strict data types see
12-- https://hackage.haskell.org/package/strict-base-types . The names have been
13-- suffixed by a prime so that programmers can easily distinguish the strict
14-- versions from the lazy ones.
16-- One major advantage of strict data structures as accumulators in folds and
17-- scans is that it helps the compiler optimize the code much better by
18-- unboxing. In a big tight loop the difference could be huge.
20module Streamly.Internal.Data.Strict
31-------------------------------------------------------------------------------
33-------------------------------------------------------------------------------
35data Tuple' a b = Tuple' !a !b deriving Show
36data Tuple3' a b c = Tuple3' !a !b !c deriving Show
37data Tuple4' a b c d = Tuple4' !a !b !c !d deriving Show
39-------------------------------------------------------------------------------
41-------------------------------------------------------------------------------
44data Maybe' a = Just' !a | Nothing' deriving Show
46-- XXX perhaps we can use a type class having fromStrict/toStrict operations.
48-- | Convert strict Maybe' to lazy Maybe
49{-# INLINABLE toMaybe #-}
50toMaybe :: Maybe' a -> Maybe a
51toMaybe Nothing' = Nothing
52toMaybe (Just' a) = Just a
54-------------------------------------------------------------------------------
56-------------------------------------------------------------------------------
59data Either' a b = Left' !a | Right' !b deriving Show
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list