on master help sign in
Add some todo notes for strict-data modules
a810243Harendra Kumar
core/src/Streamly/Internal/Data/Either/Strict.hs+2
@@ -19,6 +19,8 @@
19--
19--
20module Streamly.Internal.Data.Either.Strict
20module Streamly.Internal.Data.Either.Strict
21 ( Either' (..)
21 ( Either' (..)
22+ -- XXX Remove these and add lazyEither/strictEither to convert to and from
23+ -- lazy Either type.
22 , isLeft'
24 , isLeft'
23 , isRight'
25 , isRight'
24 , fromLeft'
26 , fromLeft'
core/src/Streamly/Internal/Data/Maybe/Strict.hs+9
@@ -16,10 +16,19 @@
16-- One major advantage of strict data structures as accumulators in folds and
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
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.
18-- unboxing. In a big tight loop the difference could be huge.
19+
20+-- Notes: The purpose of the strict Maybe type is to force storing an evaluated
21+-- value instead of a lazy thunk. To enforce that we use a strict Maybe type in
22+-- a data structure. If we need to operate on such strict values, the simplest
23+-- way to do that is to convert it to a lazy type and operate on that.
24+-- Therefore, we do not provide any other operations other than ways to
25+-- construct a strict type and convert it to a lazy type.
19--
26--
20module Streamly.Internal.Data.Maybe.Strict
27module Streamly.Internal.Data.Maybe.Strict
21 ( Maybe' (..)
28 ( Maybe' (..)
29+ -- XXX rename to lazyMaybe, also supply a strictMaybe function.
22 , toMaybe
30 , toMaybe
31+ -- XXX Remove these, use isJust . toMaybe etc instead.
23 , isJust'
32 , isJust'
24 , fromJust'
33 , fromJust'
25 )
34 )
core/src/Streamly/Internal/Data/Tuple/Strict.hs+2
@@ -21,6 +21,8 @@ module Streamly.Internal.Data.Tuple.Strict
21 (
21 (
22 Tuple' (..)
22 Tuple' (..)
23 , Tuple3' (..)
23 , Tuple3' (..)
24+ -- XXX Remove this type, use a fuse annotation in Tuple3' itself or use a
25+ -- custom type where fuse annotation is needed.
24 , Tuple3Fused' (..)
26 , Tuple3Fused' (..)
25 , Tuple4' (..)
27 , Tuple4' (..)
26 )
28 )