refined with HLint 0.1
Sat Dec 20 11:40:04 WET 2008 hpacheco@di.uminho.pt
* refined with HLint 0.1
{
hunk ./DrHylo.cabal 2
-Version: 0.0.1
+Version: 0.0.2
hunk ./Sample.hs 4
-comp (f,g) y = f (g y)
+comp (f,g) = f . g
hunk ./Sample.hs 49
-cat (h:t) l = h:(cat t l)
+cat (h:t) l = h : cat t l
hunk ./Sample.hs 55
-inorder (Node x l r) = cat (inorder l) (x:(inorder r))
+inorder (Node x l r) = cat (inorder l) (x : inorder r)
hunk ./lib/Language/Pointfree/Parser.hs 5
+import Control.Monad
hunk ./lib/Language/Pointfree/Parser.hs 38
- = hs2pf e >>= return . Curry
+ = liftM Curry (hs2pf e)
hunk ./lib/Language/Pointfree/Parser.hs 80
- = hs2func e >>= return . Fix
+ = liftM Fix (hs2func e)
hunk ./lib/Language/Pointfree/Parser.hs 84
- = hs2type e >>= return . Const
+ = liftM Const (hs2type e)
hunk ./lib/Language/Pointfree/Pretty.hs 43
- (showsPrec 10 aa . showString (" "++(init sym)++" ") . showsPrec 10 ab)
+ (showsPrec 10 aa . showString (" " ++ init sym ++ " ") . showsPrec 10 ab)
hunk ./lib/Language/Pointfree/Pretty.hs 58
- show (Fix (Const One :++: (Const a :**: Id))) = "["++(show a)++"]"
- show (Fix t) = "Fix ("++(show t)++")"
- show (t :*: u) = "("++(show t)++","++(show u)++")"
- show (t :+: u) = "Either ("++(show t)++") ("++(show u)++")"
- show (t :-> u) = "("++(show t)++" -> "++(show u)++")"
+ show (Fix (Const One :++: (Const a :**: Id))) = "[" ++ show a ++ "]"
+ show (Fix t) = "Fix (" ++ show t ++ ")"
+ show (t :*: u) = "(" ++ show t ++ "," ++ show u ++ ")"
+ show (t :+: u) = "Either (" ++ show t ++ ") (" ++ show u ++ ")"
+ show (t :-> u) = "(" ++ show t ++ " -> " ++ show u ++ ")"
hunk ./lib/Language/Pointfree/Pretty.hs 67
- show (Const t) = "Const ("++(show t)++")"
- show (f :**: g) = "("++(show f)++" :*: "++(show g)++")"
- show (f :++: g) = "("++(show f)++" :+: "++(show g)++")"
+ show (Const t) = "Const (" ++ show t ++ ")"
+ show (f :**: g) = "(" ++ show f ++ " :*: " ++ show g ++ ")"
+ show (f :++: g) = "(" ++ show f ++ " :+: " ++ show g ++ ")"
hunk ./lib/Language/Pointwise/Matching.hs 4
-import Data.Generics hiding (Unit,(:*:),Inl,Inr)
+import Data.Generics hiding (Unit,Inl,Inr)
hunk ./lib/Language/Pointwise/Matching.hs 20
- return (x ++ (show seed))
+ return (x ++ show seed)
hunk ./lib/Language/Pointwise/Matching.hs 33
- guard (null (free e `intersect` concat (map free (map fst l))))
+ guard (null (free e `intersect` concatMap (free . fst) l))
hunk ./lib/Language/Pointwise/Matching.hs 36
- rightmatch = map (nomatch . (Match (Snd e)) . map (pwSnd . fst /\ snd)) aux
+ rightmatch = map (nomatch . Match (Snd e) . map (pwSnd . fst /\ snd)) aux
hunk ./lib/Language/Pointwise/Matching.hs 63
-mygroup f (h:t) = (h : filter (\x -> f x h) t):(mygroup f (filter (\x -> not (f x h)) t))
+mygroup f (h:t) = (h : filter (\x -> f x h) t) : mygroup f (filter (\x -> not (f x h)) t)
hunk ./lib/Language/Pointwise/Parser.hs 7
+import Control.Monad
hunk ./lib/Language/Pointwise/Parser.hs 28
-hs2pw (Exts.Var(UnQual(Ident "undefined"))) = return $ Unit
-hs2pw (Exts.Var(UnQual(Ident "_L"))) = return $ Unit
+hs2pw (Exts.Var(UnQual(Ident "undefined"))) = return Unit
+hs2pw (Exts.Var(UnQual(Ident "_L"))) = return Unit
hunk ./lib/Language/Pointwise/Parser.hs 33
- = hs2pw exp >>= return . In
+ = liftM In (hs2pw exp)
hunk ./lib/Language/Pointwise/Parser.hs 35
- = hs2pw exp >>= return . Out
+ = liftM Out (hs2pw exp)
hunk ./lib/Language/Pointwise/Parser.hs 41
- return $ ((Const ":") :@: t1) :@: t2
+ return $ (Const ":" :@: t1) :@: t2
hunk ./lib/Language/Pointwise/Parser.hs 46
- return $ ((Const ":") :@: e) :@: es
+ return $ (Const ":" :@: e) :@: es
hunk ./lib/Language/Pointwise/Syntax.hs 3
-import Data.Generics hiding (Unit,(:*:),Inl,Inr)
+import Data.Generics hiding (Unit,Inl,Inr)
hunk ./lib/Language/Pointwise/Syntax.hs 68
- let x = concat (concat (map free (e : map snd s)))
+ let x = concat (concatMap free (e : map snd s))
hunk ./lib/Language/Pointwise/Syntax.hs 90
-distr = Lam "x" (Match (Var "x") [(Var "y" :&: (Inl (Var "z")),Inl (Var "y" :&: Var "z")),(Var "y" :&: (Inr (Var "z")),Inr (Var "y" :&: Var "z"))])
+distr = Lam "x" (Match (Var "x") [(Var "y" :&: Inl (Var "z"),Inl (Var "y" :&: Var "z")),(Var "y" :&: Inr (Var "z"),Inr (Var "y" :&: Var "z"))])
hunk ./src/DrHylo.hs 32
-options = [Option ['o'] ["output"] (OptArg outp "FILE") "output FILE",
- Option ['i'] ["input"] (OptArg inp "FILE") "input FILE",
- Option ['f'] ["fix"] (NoArg Fixify) "use fixpoints instead of hylomorphisms",
- Option ['w'] ["pointwise"] (NoArg Pointwise) "do not convert to point-free",
- Option ['O'] ["observable"] (NoArg Observable) "generate observable hylomorphisms"
+options = [Option "o" ["output"] (OptArg outp "FILE") "output FILE",
+ Option "i" ["input"] (OptArg inp "FILE") "input FILE",
+ Option "f" ["fix"] (NoArg Fixify) "use fixpoints instead of hylomorphisms",
+ Option "w" ["pointwise"] (NoArg Pointwise) "do not convert to point-free",
+ Option "O" ["observable"] (NoArg Observable) "generate observable hylomorphisms"
hunk ./src/DrHylo.hs 44
-parseOpts opts = case (getOpt Permute options opts) [_$_]
+parseOpts opts = case getOpt Permute options opts
hunk ./src/DrHylo.hs 73
-parse s = case (parseModule s) [_$_]
+parse s = case parseModule s
hunk ./src/DrHylo.hs 75
- ParseFailed l d -> fail ((show l)++": "++d)
+ ParseFailed l d -> fail (show l ++ ": " ++ d)
hunk ./src/DrHylo.hs 95
- inst cl a b = map (mkInsVar cl) (vars a b)
+ inst cl a = map (mkInsVar cl) . vars a
hunk ./src/DrHylo.hs 111
- decls'' = if (obrequired f) then foldr addTypeableObservableIns decls' obs else decls'
- pragmaNames = if (obrequired f) then ["TypeFamilies,","DeriveDataTypeable"] else ["TypeFamilies"]
+ decls'' = if obrequired f then foldr addTypeableObservableIns decls' obs else decls'
+ pragmaNames = if obrequired f then ["TypeFamilies,","DeriveDataTypeable"] else ["TypeFamilies"]
hunk ./src/DrHylo.hs 126
- pw2 <- return (if (name `elem` free pw1) [_$_]
+ pw2 <- return (if name `elem` free pw1
hunk ./src/DrHylo.hs 130
- (rhs',ob) <- return (if (pwrequired f)
+ (rhs',ob) <- return (if pwrequired f
hunk ./src/DrHylo.hs 132
- else if (not (fixrequired f)) && (derivable pw3)
+ else if not (fixrequired f) && derivable pw3
hunk ./src/DrHylo.hs 137
- hyl = if (obrequired f) then HyloO else Hylo
+ hyl = if obrequired f then HyloO else Hylo
hunk ./src/DrHylo.hs 159
- aux' = aux b \\ (map getImportName imports) [_$_]
- imports' = imports++(map mkImportDecl aux')
+ aux' = aux b \\ map getImportName imports
+ imports' = imports ++ map mkImportDecl aux'
hunk ./src/FunctorOf.hs 17
-import Data.Generics hiding (Unit,(:*:),Inl,Inr)
+import Data.Generics hiding (Unit,Inl,Inr)
hunk ./src/FunctorOf.hs 48
-buildArgs f n = let v = "x"++(show n)
+buildArgs f n = let v = 'x' : show n
hunk ./src/FunctorOf.hs 63
- in Module a b c d e i (newDecls)
+ in Module a b c d e i newDecls
hunk ./src/FunctorOf.hs 72
-gCon arg (ConDecl _ lBangType) = mapM (h arg) lBangType >>= return . foldr1 timesType
+gCon arg (ConDecl _ lBangType) = liftM (foldr1 timesType) (mapM (h arg) lBangType)
hunk ./src/FunctorOf.hs 83
-i arg (TyTuple _ lType) = mapM (ii arg) lType >>= return . foldr1 timesType
-i arg (TyApp hsType1 hsType2) = i arg hsType2 >>= return . appType hsType1
+i arg (TyTuple _ lType) = liftM (foldr1 timesType) (mapM (ii arg) lType)
+i arg (TyApp hsType1 hsType2) = liftM (appType hsType1) (i arg hsType2)
hunk ./src/FunctorOf.hs 95
-genInOut arg l = mapM (g' arg) l >>= return . genPat
+genInOut arg l = liftM genPat (mapM (g' arg) l)
hunk ./src/FunctorOf.hs 186
-opType op a b = TyApp (TyApp (TyVar $ Symbol op) a ) b
+opType op = TyApp . TyApp (TyVar $ Symbol op)
hunk ./src/FunctorOf.hs 206
- modify (\_->((seed,n+1),l))
+ modify (const ((seed,n+1),l))
hunk ./src/Hylos.hs 14
- (f `notElem` free m) && (branch n) && (branch o)
+ (f `notElem` free m) && branch n && branch o
hunk ./src/Hylos.hs 35
- return (x ++ (show seed))
+ return (x ++ show seed)
hunk ./src/Hylos.hs 45
- aux (Var x) = getVar "a" >>= return . Pointfree.Const . Base
+ aux (Var x) = liftM (Pointfree.Const . Base) (getVar "a")
hunk ./src/Hylos.hs 69
- in (Case l (Lam x (Inl f)) (Lam y (Inr g)))
+ in Case l (Lam x (Inl f)) (Lam y (Inr g))
hunk ./src/Hylos.hs 78
- in (f :&: g)
+ in f :&: g
hunk ./src/Hylos.hs 83
- in (f :&: g)
+ in f :&: g
hunk ./src/Hylos.hs 98
- in (Case (Var p) (Lam vl f) (Lam vr g))
+ in Case (Var p) (Lam vl f) (Lam vr g)
hunk ./src/Hylos.hs 105
- in (f :@: g)
+ in f :@: g
hunk ./src/Hylos.hs 108
- in (f :@: g)
+ in f :@: g
hunk ./src/Hylos.hs 111
- in (f :@: g)
+ in f :@: g
hunk ./src/Hylos.hs 114
- in (f :&: g)
+ in f :&: g
hunk ./src/Hylos.hs 117
- in (f :&: g)
+ in f :&: g
hunk ./src/Hylos.hs 120
- in (f :&: g)
+ in f :&: g
hunk ./src/Matching.hs 36
- buildPVars n v = Lambda mkLoc [mkPVar $ v ++ show n] . (buildPVars (n-1) v)
+ buildPVars n v = Lambda mkLoc [mkPVar $ v ++ show n] . buildPVars (n-1) v
}