1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
|
From 7eae0e500fb5762a2f09939a43fcbb8f6e4ef8af Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Tue, 15 Oct 2013 10:03:28 -0400
Last-Update: 2014-04-14
Subject: [PATCH 3/3] guard ANNotations
Index: haskell-lens-4.1.2/src/Control/Lens.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens.hs
+++ haskell-lens-4.1.2/src/Control/Lens.hs
@@ -95,6 +95,8 @@ import Control.Lens.Type
import Control.Lens.Wrapped
import Control.Lens.Zoom
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Use import/export shortcut" #-}
#endif
+#endif
Index: haskell-lens-4.1.2/src/Control/Lens/Equality.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Equality.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Equality.hs
@@ -31,10 +31,12 @@ module Control.Lens.Equality
import Control.Lens.Type
import Data.Functor.Identity
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Use id" #-}
{-# ANN module "HLint: ignore Eta reduce" #-}
#endif
+#endif
-- $setup
-- >>> import Control.Lens
@@ -86,4 +88,4 @@ simply = id
-- type of a used argument and avoid @ScopedTypeVariables@ or other ugliness.
simple :: Equality' a a
simple = id
-{-# INLINE simple #-}
\ No newline at end of file
+{-# INLINE simple #-}
Index: haskell-lens-4.1.2/src/Control/Lens/Fold.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Fold.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Fold.hs
@@ -178,11 +178,13 @@ import Data.Traversable
-- >>> let g :: Expr -> Expr; g = Debug.SimpleReflect.Vars.g
-- >>> let timingOut :: NFData a => a -> IO a; timingOut = fmap (fromMaybe (error "timeout")) . timeout (5*10^6) . evaluate . force
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Eta reduce" #-}
{-# ANN module "HLint: ignore Use camelCase" #-}
{-# ANN module "HLint: ignore Use curry" #-}
#endif
+#endif
infixl 8 ^.., ^?, ^?!, ^@.., ^@?, ^@?!
Index: haskell-lens-4.1.2/src/Control/Exception/Lens.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Exception/Lens.hs
+++ haskell-lens-4.1.2/src/Control/Exception/Lens.hs
@@ -119,9 +119,11 @@ import Prelude
, Maybe(..), Either(..), String
)
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Use Control.Exception.catch" #-}
#endif
+#endif
-- $setup
-- >>> :set -XNoOverloadedStrings
Index: haskell-lens-4.1.2/src/Control/Lens/Cons.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Cons.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Cons.hs
@@ -55,7 +55,9 @@ import Data.Vector.Unboxed (Un
import qualified Data.Vector.Unboxed as Unbox
import Data.Word
+#ifndef DISABLE_TEMPLATE_HASKELL
{-# ANN module "HLint: ignore Eta reduce" #-}
+#endif
-- $setup
-- >>> :set -XNoOverloadedStrings
Index: haskell-lens-4.1.2/src/Control/Lens/Internal/Fold.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Internal/Fold.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Internal/Fold.hs
@@ -37,7 +37,9 @@ import Data.Maybe
import Data.Semigroup hiding (Min, getMin, Max, getMax)
import Data.Reflection
+#ifndef DISABLE_TEMPLATE_HASKELL
{-# ANN module "HLint: ignore Avoid lambda" #-}
+#endif
------------------------------------------------------------------------------
-- Folding
Index: haskell-lens-4.1.2/src/Control/Lens/Internal.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Internal.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Internal.hs
@@ -44,6 +44,8 @@ import Control.Lens.Internal.Review
import Control.Lens.Internal.Setter
import Control.Lens.Internal.Zoom
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Use import/export shortcut" #-}
#endif
+#endif
Index: haskell-lens-4.1.2/src/Control/Lens/Iso.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Iso.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Iso.hs
@@ -88,9 +88,11 @@ import Data.Maybe
import Data.Profunctor
import Data.Profunctor.Unsafe
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Use on" #-}
#endif
+#endif
-- $setup
-- >>> :set -XNoOverloadedStrings
Index: haskell-lens-4.1.2/src/Control/Lens/Lens.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Lens.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Lens.hs
@@ -136,9 +136,11 @@ import Data.Profunctor.Rep
import Data.Profunctor.Unsafe
import Data.Void
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Use ***" #-}
#endif
+#endif
-- $setup
-- >>> :set -XNoOverloadedStrings
Index: haskell-lens-4.1.2/src/Control/Lens/Plated.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Plated.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Plated.hs
@@ -106,9 +106,11 @@ import Data.Data.Lens
import Data.Monoid
import Data.Tree
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Reduce duplication" #-}
#endif
+#endif
-- | A 'Plated' type is one where we know how to extract its immediate self-similar children.
--
Index: haskell-lens-4.1.2/src/Control/Lens/Prism.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Prism.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Prism.hs
@@ -59,7 +59,9 @@ import Unsafe.Coerce
import Data.Profunctor.Unsafe
#endif
+#ifndef DISABLE_TEMPLATE_HASKELL
{-# ANN module "HLint: ignore Use camelCase" #-}
+#endif
-- $setup
-- >>> :set -XNoOverloadedStrings
Index: haskell-lens-4.1.2/src/Control/Lens/Setter.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Setter.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Setter.hs
@@ -91,9 +91,11 @@ import Data.Profunctor
import Data.Profunctor.Rep
import Data.Profunctor.Unsafe
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Avoid lambda" #-}
#endif
+#endif
-- $setup
-- >>> import Control.Lens
Index: haskell-lens-4.1.2/src/Control/Monad/Primitive/Lens.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Monad/Primitive/Lens.hs
+++ haskell-lens-4.1.2/src/Control/Monad/Primitive/Lens.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE TypeFamilies #-}
@@ -20,7 +21,9 @@ import Control.Lens
import Control.Monad.Primitive (PrimMonad(..))
import GHC.Prim (State#)
+#ifndef DISABLE_TEMPLATE_HASKELL
{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-}
+#endif
prim :: (PrimMonad m) => Iso' (m a) (State# (PrimState m) -> (# State# (PrimState m), a #))
prim = iso internal primitive
Index: haskell-lens-4.1.2/src/Data/Data/Lens.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Data/Data/Lens.hs
+++ haskell-lens-4.1.2/src/Data/Data/Lens.hs
@@ -65,12 +65,14 @@ import Data.IORef
import Data.Monoid
import GHC.Exts (realWorld#)
+#ifndef DISABLE_TEMPLATE_HASKELL
#ifdef HLINT
{-# ANN module "HLint: ignore Eta reduce" #-}
{-# ANN module "HLint: ignore Use foldl" #-}
{-# ANN module "HLint: ignore Reduce duplication" #-}
{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-}
#endif
+#endif
-- $setup
-- >>> :set -XNoOverloadedStrings
Index: haskell-lens-4.1.2/src/Control/Lens/Internal/Reflection.hs
===================================================================
--- haskell-lens-4.1.2.orig/src/Control/Lens/Internal/Reflection.hs
+++ haskell-lens-4.1.2/src/Control/Lens/Internal/Reflection.hs
@@ -64,7 +64,9 @@ import Data.Word
import Data.Typeable
import Data.Reflection
+#ifndef DISABLE_TEMPLATE_HASKELL
{-# ANN module "HLint: ignore Avoid lambda" #-}
+#endif
class Typeable s => B s where
reflectByte :: proxy s -> IntPtr
|