on master help sign in
Disallow some language extensions from default use
1367bd6Harendra Kumar
src/Streamly/Internal/Data/Array.hs+1
@@ -1,5 +1,6 @@
1{-# OPTIONS_GHC -fno-warn-orphans #-}
1{-# OPTIONS_GHC -fno-warn-orphans #-}
2
2
3+{-# LANGUAGE UnboxedTuples #-}
3#include "inline.hs"
4#include "inline.hs"
4
5
5-- |
6-- |
src/Streamly/Internal/Data/List.hs+3
@@ -1,3 +1,6 @@
1+{-# LANGUAGE TypeFamilies #-}
2+{-# LANGUAGE UndecidableInstances #-}
3+
1-- |
4-- |
2-- Module : Streamly.Internal.Data.List
5-- Module : Streamly.Internal.Data.List
3-- Copyright : (c) 2018 Composewell Technologies
6-- Copyright : (c) 2018 Composewell Technologies
src/Streamly/Internal/Data/SVar.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE UnboxedTuples #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.SVar
4-- Module : Streamly.Internal.Data.SVar
3-- Copyright : (c) 2017 Harendra Kumar
5-- Copyright : (c) 2017 Harendra Kumar
src/Streamly/Internal/Data/SmallArray.hs+1
@@ -8,6 +8,7 @@
8-- Portability : GHC
8-- Portability : GHC
9
9
10{-# OPTIONS_GHC -fno-warn-orphans #-}
10{-# OPTIONS_GHC -fno-warn-orphans #-}
11+{-# LANGUAGE UnboxedTuples #-}
11
12
12#include "inline.hs"
13#include "inline.hs"
13
14
src/Streamly/Internal/Data/Stream/Ahead.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE UndecidableInstances #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.Ahead
4-- Module : Streamly.Internal.Data.Stream.Ahead
3-- Copyright : (c) 2017 Harendra Kumar
5-- Copyright : (c) 2017 Harendra Kumar
src/Streamly/Internal/Data/Stream/Async.hs+4
@@ -1,3 +1,7 @@
1+{-# LANGUAGE UndecidableInstances #-}
2+
3+#include "inline.hs"
4+
1-- |
5-- |
2-- Module : Streamly.Internal.Data.Stream.Async
6-- Module : Streamly.Internal.Data.Stream.Async
3-- Copyright : (c) 2017 Harendra Kumar
7-- Copyright : (c) 2017 Harendra Kumar
src/Streamly/Internal/Data/Stream/Parallel.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE UndecidableInstances #-}
2+
1#include "inline.hs"
3#include "inline.hs"
2
4
3-- |
5-- |
src/Streamly/Internal/Data/Stream/SVar.hs+2−4
@@ -51,7 +51,7 @@ import Test.Inspection (inspect, hasNoTypeClassesExcept)
51
51
52-- | Pull a stream from an SVar.
52-- | Pull a stream from an SVar.
53{-# NOINLINE fromStreamVar #-}
53{-# NOINLINE fromStreamVar #-}
54−fromStreamVar :: forall m a . MonadAsync m => SVar Stream m a -> Stream m a
54+fromStreamVar :: MonadAsync m => SVar Stream m a -> Stream m a
55fromStreamVar sv = MkStream $ \st yld sng stp -> do
55fromStreamVar sv = MkStream $ \st yld sng stp -> do
56 list <- readOutputQ sv
56 list <- readOutputQ sv
57 -- Reversing the output is important to guarantee that we process the
57 -- Reversing the output is important to guarantee that we process the
@@ -60,7 +60,7 @@ fromStreamVar sv = MkStream $ \st yld sng stp -> do
60 foldStream st yld sng stp $ processEvents $ reverse list
60 foldStream st yld sng stp $ processEvents $ reverse list
61
61
62 where
62 where
63− allDone :: m r -> m r
63+
64 allDone stp = do
64 allDone stp = do
65 when (svarInspectMode sv) $ do
65 when (svarInspectMode sv) $ do
66 t <- liftIO $ getTime Monotonic
66 t <- liftIO $ getTime Monotonic
@@ -69,7 +69,6 @@ fromStreamVar sv = MkStream $ \st yld sng stp -> do
69 stp
69 stp
70
70
71 {-# INLINE processEvents #-}
71 {-# INLINE processEvents #-}
72− processEvents :: [ChildEvent a] -> Stream m a
73 processEvents [] = MkStream $ \st yld sng stp -> do
72 processEvents [] = MkStream $ \st yld sng stp -> do
74 done <- postProcess sv
73 done <- postProcess sv
75 if done
74 if done
@@ -93,7 +92,6 @@ fromStreamVar sv = MkStream $ \st yld sng stp -> do
93 Just ThreadAbort ->
92 Just ThreadAbort ->
94 foldStream st yld sng stp rest
93 foldStream st yld sng stp rest
95 Nothing -> liftIO (cleanupSVar sv) >> throwM ex
94 Nothing -> liftIO (cleanupSVar sv) >> throwM ex
96−
97 shouldStop tid =
95 shouldStop tid =
98 case svarStopStyle sv of
96 case svarStopStyle sv of
99 StopNone -> return False
97 StopNone -> return False
src/Streamly/Internal/Data/Stream/Serial.hs+3
@@ -1,3 +1,6 @@
1+{-# LANGUAGE TypeFamilies #-}
2+{-# LANGUAGE UndecidableInstances #-}
3+
1-- |
4-- |
2-- Module : Streamly.Internal.Data.Stream.Serial
5-- Module : Streamly.Internal.Data.Stream.Serial
3-- Copyright : (c) 2017 Harendra Kumar
6-- Copyright : (c) 2017 Harendra Kumar
src/Streamly/Internal/Data/Stream/StreamK.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE UndecidableInstances #-}
2+
1#include "inline.hs"
3#include "inline.hs"
2
4
3-- |
5-- |
src/Streamly/Internal/Data/Stream/StreamK/Type.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE UndecidableInstances #-}
2+
1#include "inline.hs"
3#include "inline.hs"
2
4
3-- |
5-- |
src/Streamly/Internal/Data/Stream/Zip.hs+3
@@ -1,3 +1,6 @@
1+{-# LANGUAGE TypeFamilies #-}
2+{-# LANGUAGE UndecidableInstances #-}
3+
1-- |
4-- |
2-- Module : Streamly.Internal.Data.Stream.Zip
5-- Module : Streamly.Internal.Data.Stream.Zip
3-- Copyright : (c) 2017 Harendra Kumar
6-- Copyright : (c) 2017 Harendra Kumar
src/Streamly/Internal/Memory/Array.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE UnboxedTuples #-}
2+
1#include "inline.hs"
3#include "inline.hs"
2
4
3-- |
5-- |
src/Streamly/Internal/Memory/Array/Types.hs+3
@@ -1,3 +1,6 @@
1+{-# LANGUAGE TypeFamilies #-}
2+{-# LANGUAGE UnboxedTuples #-}
3+
1#include "inline.hs"
4#include "inline.hs"
2
5
3-- |
6-- |
src/Streamly/Internal/Mutable/Prim/Var.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE UnboxedTuples #-}
2+
1#include "inline.hs"
3#include "inline.hs"
2
4
3-- |
5-- |
src/Streamly/Memory/Malloc.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE TypeFamilies #-}
2+
1#include "inline.hs"
3#include "inline.hs"
2
4
3-- |
5-- |
streamly.cabal+5−3
@@ -310,10 +310,12 @@ library
310 RecordWildCards
310 RecordWildCards
311 ScopedTypeVariables
311 ScopedTypeVariables
312 TupleSections
312 TupleSections
313− TypeFamilies
314− UnboxedTuples
315− UndecidableInstances
316 ViewPatterns
313 ViewPatterns
314+
315+ -- UndecidableInstances -- Does not show any perf impact
316+ -- TypeFamilies -- Causes large regressions and improvements
317+ -- UnboxedTuples -- interferes with (#.)
318+
317 if impl(ghc >= 8.1)
319 if impl(ghc >= 8.1)
318 default-extensions: TypeApplications
320 default-extensions: TypeApplications
319 if impl(ghc >= 8.6)
321 if impl(ghc >= 8.6)