]> gitweb.michael.orlitzky.com - dead/htsn-import.git/commitdiff
Fix hlint warnings.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 6 Jul 2014 20:15:40 +0000 (16:15 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 6 Jul 2014 20:15:40 +0000 (16:15 -0400)
src/TSN/XML/AutoRacingResults.hs
src/TSN/XML/GameInfo.hs
src/TSN/XML/JFile.hs
src/TSN/XML/Odds.hs
src/TSN/XML/ScheduleChanges.hs
src/TSN/XML/Scores.hs
src/TSN/XML/SportInfo.hs
src/TSN/XML/Weather.hs

index a32d704f355a29c427bfcd2df4c7b057c92a9b98..f9177258e324921c9414beab15e3f9dd6a49ed3c 100644 (file)
@@ -370,8 +370,7 @@ instance DbImport Message where
 
     insert_xml_fk_ msg_id (xml_race_information m)
 
-    forM_ (xml_listings m) $ \listing -> do
-      insert_xml_fk_ msg_id listing
+    forM_ (xml_listings m) $ insert_xml_fk_ msg_id
 
     return ImportSucceeded
 
@@ -398,9 +397,9 @@ mkPersist tsn_codegen_config [groundhog|
           reference:
             onDelete: cascade
 
-# Note the apostrophe in the foreign key. This is to disambiguate
-# it from the AutoRacingResultsListing foreign key of the same name.
-# We strip it out of the dbName.
+  # Note the apostrophe in the foreign key. This is to disambiguate
+  # it from the AutoRacingResultsListing foreign key of the same name.
+  # We strip it out of the dbName.
 - entity: AutoRacingResultsRaceInformation
   dbName: auto_racing_results_race_information
   constructors:
index bc68f42a490aca44dec9154af21c7488f5e80aa7..4f264bb54e629788a30fc0aa7bee9e1148681c81 100644 (file)
@@ -204,7 +204,7 @@ test_dbimport_succeeds = testCase "dbimport succeeds" $ do
   xmltrees <- mapM unsafe_read_document game_info_test_files
   let msgs = rights $ map (parse_xml "dummy") xmltrees
   actual <- withSqliteConn ":memory:" $ runDbConn $ do
-                runMigration silentMigrationLogger $ do
+                runMigration silentMigrationLogger $
                   migrate (undefined :: GameInfo)
                 mapM_ dbimport msgs
                 countAll (undefined :: GameInfo)
index 35768163cbe21eef1a5fbb01e98b973abc605d81..6766374c28e4c7a788de47b4dcbbde43af46cf5a 100644 (file)
@@ -353,8 +353,8 @@ mkPersist tsn_codegen_config [groundhog|
     - name: db_status
       dbName: status
 
-# Many of the JFileGameOddsInfo fields are redundant and have
-# been left out.
+  # Many of the JFileGameOddsInfo fields are redundant and have
+  # been left out.
 - embedded: JFileGameOddsInfo
   fields:
     - name: db_list_date
index 1401c8143905b2ee2e795b8b91059920d7c62eb5..5174ddb927462266e80af42eb45171bb49975f41 100644 (file)
@@ -23,6 +23,7 @@ module TSN.XML.Odds (
 where
 
 -- System imports.
+import Control.Applicative ( (<$>) )
 import Control.Monad ( forM_, join )
 import Data.Time ( UTCTime(..) )
 import Data.Tuple.Curry ( uncurryN )
@@ -308,16 +309,16 @@ instance FromXmlFkTeams OddsGameXml where
         (xml_team_rotation_number xml_home_team),
 
       db_away_team_starter_id =
-        (fmap fst $ xml_team_starter xml_away_team),
+        (fst <$> xml_team_starter xml_away_team),
 
       db_away_team_starter_name =
-        (fmap snd $ xml_team_starter xml_away_team),
+        (snd <$> xml_team_starter xml_away_team),
 
       db_home_team_starter_id =
-        (fmap fst $ xml_team_starter xml_home_team),
+        (fst <$> xml_team_starter xml_home_team),
 
       db_home_team_starter_name =
-        (fmap snd $ xml_team_starter xml_home_team) }
+        (snd <$> xml_team_starter xml_home_team) }
 
 
 -- | This lets us insert the XML representation 'OddsGameXml' directly.
index c447f35158a467be32f64c52b46e67f92662a3a9..151b615357ba7e024feb064c8ad841bfc2067b83 100644 (file)
@@ -303,7 +303,7 @@ mkPersist tsn_codegen_config [groundhog|
           # Prevent multiple imports of the same message.
           fields: [db_xml_file_id]
 
-# Note: we drop the "sc" prefix from the db_sc_sport field.
+  # Note: we drop the "sc" prefix from the db_sc_sport field.
 - entity: ScheduleChangesListing
   dbName: schedule_changes_listings
   constructors:
index 8e9f65f6b2e9689a0ff2071dd72ea324a2d083fe..adbd5cd9badb0e1a9bdb035bc91f698cc76f17dc 100644 (file)
@@ -219,8 +219,8 @@ instance FromXmlFkTeams ScoreGameXml where
       db_home_team_id = fk_home,
       db_away_team_score = xml_away_team_score,
       db_home_team_score = xml_home_team_score,
-      db_away_team_pitcher = (xml_vpitcher $ xml_vteam),
-      db_home_team_pitcher = (xml_hpitcher $ xml_hteam),
+      db_away_team_pitcher = xml_vpitcher xml_vteam,
+      db_home_team_pitcher = xml_hpitcher xml_hteam,
       db_time_r = xml_time_r,
       db_status = xml_status,
       db_notes = xml_notes }
index 0ceba417492ebf4c4cb55d0a57906ee81a952689..a9e1f1a248863a84b13417c5d6c9fc604e05d995 100644 (file)
@@ -318,7 +318,7 @@ test_dbimport_succeeds = testCase "dbimport succeeds" $ do
   xmltrees <- mapM unsafe_read_document sport_info_test_files
   let msgs = rights $ map (parse_xml "dummy") xmltrees
   actual <- withSqliteConn ":memory:" $ runDbConn $ do
-                runMigration silentMigrationLogger $ do
+                runMigration silentMigrationLogger $
                   migrate (undefined :: SportInfo)
                 mapM_ dbimport msgs
                 countAll (undefined :: SportInfo)
index 26935cf83b84068a49001e4f700170ed348dbd2f..47e931f79767b512433d623f94510afc4119997d 100644 (file)
@@ -384,7 +384,8 @@ mkPersist tsn_codegen_config [groundhog|
           reference:
             onDelete: cascade
 
-# We rename the two fields that needed a "dtl" prefix to avoid a name clash.
+  # We rename the two fields that needed a "dtl" prefix to avoid a name
+  # clash.
 - entity: WeatherDetailedWeatherListingItem
   dbName: weather_detailed_items
   constructors:
@@ -714,7 +715,7 @@ unsafe_get_xmltree path =
 --
 test_types_detected_correctly :: TestTree
 test_types_detected_correctly =
-  testGroup "weatherxml types detected correctly" $
+  testGroup "weatherxml types detected correctly"
     [ check "test/xml/weatherxml.xml"
             "first type detected correctly"
             True,