on master help sign in
First of many CAFs to be NOINLINEd :-(
commit21a9f211f70a2ef2a735501167dc5b432aa3d82d authorBryan O'Sullivan <bos@serpentine.com> dateWed 24 Oct 2012, 13:03 (14 years ago) parentfd92012
1 file changed+5−1
Data/Text/Fusion/Common.hs+5−1
Data/Text/Fusion/Common.hs+5−1
@@ -218,9 +218,13 @@ head (Stream next s0 _len) = loop_head s0
218218 loop_head !s = case next s of
219219 Yield x _ -> x
220220 Skip s' -> loop_head s'
221− Done -> streamError "head" "Empty stream"
221+ Done -> head_empty
222222{-# INLINE [0] head #-}
223223
224+head_empty :: a
225+head_empty = streamError "head" "Empty stream"
226+{-# NOINLINE head_empty #-}
227+
224228-- | /O(1)/ Returns the first character and remainder of a 'Stream
225229-- Char', or 'Nothing' if empty. Subject to array fusion.
226230uncons :: Stream Char -> Maybe (Char, Stream Char)