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
|
---------------------------------------------------------------------
RUN --find=tests/find.hs
FILE tests/find.hs
{-# LANGUAGE CPP, ExistentialQuantification, Rank2Types #-}
module Util where
import Control.Arrow
import Control.Monad.Trans.State
import Data.Char
import Data.Function
infixr 4 %^&, `wheeeee`
instance Foo a where
bar = baz + qux
listM' :: Monad m => [a] -> m [a]
listM' x = length x `seq` return x
notNull = not . null
headDef :: a -> [a] -> a
headDef x [] = x
headDef x (y:ys) = y
isLeft Left{} = True; isLeft _ = False
isRight = not . isLeft
swap :: (a,b) -> (b,a)
swap (a,b) = (b,a)
defaultExtensions = knownExtensions \\ badExtensions
OUTPUT
# hints found in tests/find.hs
- fixity: "infixr 4 %^&"
- fixity: "infixr 4 `wheeeee`"
- warn: {lhs: "baz + qux", rhs: "bar"}
- warn: {lhs: "length a `seq` return a", rhs: "listM' a"}
- warn: {lhs: "not (null a)", rhs: "notNull a"}
- warn: {lhs: "not (isLeft a)", rhs: "isRight a"}
- warn: {lhs: "knownExtensions \\\\ badExtensions", rhs: "defaultExtensions"}
|