on master help sign in
implement new suggestions from hlint 2.1.13
faff25eAgentM
src/bin/ProjectM36/Server/RemoteCallTypes/Json.hs+1−1
@@ -1,5 +1,5 @@
1--create a bunch of orphan instances for use with the websocket server
1--create a bunch of orphan instances for use with the websocket server
2−{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
2+{-# LANGUAGE TypeSynonymInstances #-}
3{-# OPTIONS_GHC -fno-warn-orphans #-}
3{-# OPTIONS_GHC -fno-warn-orphans #-}
4module ProjectM36.Server.RemoteCallTypes.Json where
4module ProjectM36.Server.RemoteCallTypes.Json where
5import ProjectM36.AtomFunctionError
5import ProjectM36.AtomFunctionError
src/bin/TutorialD/Interpreter/TransGraphRelationalOperator.hs+2−2
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
1+{-# LANGUAGE FlexibleInstances #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
3module TutorialD.Interpreter.TransGraphRelationalOperator where
3module TutorialD.Interpreter.TransGraphRelationalOperator where
4import ProjectM36.TransGraphRelationalExpression
4import ProjectM36.TransGraphRelationalExpression
@@ -43,4 +43,4 @@ evalTransGraphRelationalOp sessionId conn (ShowTransGraphRelation expr) = do
43 case res of
43 case res of
44 Left err -> pure $ DisplayErrorResult $ T.pack (show err)
44 Left err -> pure $ DisplayErrorResult $ T.pack (show err)
45 Right rel -> pure $ DisplayRelationResult rel
45 Right rel -> pure $ DisplayRelationResult rel
46−
46+
src/lib/ProjectM36/Base.hs+1−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE ExistentialQuantification,DeriveGeneric,DeriveAnyClass,TypeSynonymInstances,FlexibleInstances,OverloadedStrings #-}
1+{-# LANGUAGE ExistentialQuantification,DeriveGeneric,DeriveAnyClass,FlexibleInstances,OverloadedStrings #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
3
3
4module ProjectM36.Base where
4module ProjectM36.Base where
src/lib/ProjectM36/TransGraphRelationalExpression.hs+1−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
1+{-# LANGUAGE FlexibleInstances #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
3--really, a better name for this module could be "TransTransactionGraphRelationalExpr", but that name is too long
3--really, a better name for this module could be "TransTransactionGraphRelationalExpr", but that name is too long
4module ProjectM36.TransGraphRelationalExpression where
4module ProjectM36.TransGraphRelationalExpression where
src/lib/ProjectM36/Tuple.hs+1−1
@@ -86,7 +86,7 @@ mkRelationTuples attrs = map mapper
86 mapper = mkRelationTuple attrs
86 mapper = mkRelationTuple attrs
87
87
88mkRelationTupleFromMap :: M.Map AttributeName Atom -> RelationTuple
88mkRelationTupleFromMap :: M.Map AttributeName Atom -> RelationTuple
89−mkRelationTupleFromMap attrMap = RelationTuple attrs (V.map (\attrName -> attrMap M.! attrName) attrNames)
89+mkRelationTupleFromMap attrMap = RelationTuple attrs (V.map (attrMap M.!) attrNames)
90 where
90 where
91 attrNames = V.fromList (M.keys attrMap)
91 attrNames = V.fromList (M.keys attrMap)
92 attrs = V.map (\attrName -> Attribute attrName (atomTypeForAtom (attrMap M.! attrName))) attrNames
92 attrs = V.map (\attrName -> Attribute attrName (atomTypeForAtom (attrMap M.! attrName))) attrNames
test/Relation/Tupleable.hs+1−1
@@ -199,4 +199,4 @@ testReorderedTuple = TestCase $ do
199 expected = Test2C {attrB = 3,
199 expected = Test2C {attrB = 3,
200 attrC = 4}
200 attrC = 4}
201 actual = fromTuple . tupleRev . toTuple $ expected
201 actual = fromTuple . tupleRev . toTuple $ expected
202− assertEqual "reordered tuple" (Right expected) actual
202+ assertEqual "reordered tuple" (Right expected) actual
test/TutorialD/Interpreter/DatabaseContextFunctionScript.hs+1−1
@@ -38,7 +38,7 @@ testExceptionDBCFunction = TestCase $ do
38 (sess, conn) <- dateExamplesConnection emptyNotificationCallback
38 (sess, conn) <- dateExamplesConnection emptyNotificationCallback
39 let addfunc = "adddatabasecontextfunction \"bomb\" DatabaseContext -> Either DatabaseContextFunctionError DatabaseContext \"\"\"(\\[] _ -> error \"boom\") :: [Atom] -> DatabaseContext -> Either DatabaseContextFunctionError DatabaseContext\"\"\""
39 let addfunc = "adddatabasecontextfunction \"bomb\" DatabaseContext -> Either DatabaseContextFunctionError DatabaseContext \"\"\"(\\[] _ -> error \"boom\") :: [Atom] -> DatabaseContext -> Either DatabaseContextFunctionError DatabaseContext\"\"\""
40 executeTutorialD sess conn addfunc
40 executeTutorialD sess conn addfunc
41− expectTutorialDErr sess conn (\err -> "UnhandledExceptionError" `T.isPrefixOf` err) "execute bomb()"
41+ expectTutorialDErr sess conn ("UnhandledExceptionError" `T.isPrefixOf`) "execute bomb()"
42
42
43
43
44testDBCFunctionWithAtomArguments :: Test
44testDBCFunctionWithAtomArguments :: Test