@@ -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.
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.
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.
31+ -- XXX Remove these, use isJust . toMaybe etc instead.
24 , fromJust'
33 , fromJust'