Skip to content

Commit

Permalink
Merge pull request #168 from ambiata/topic/more
Browse files Browse the repository at this point in the history
Cleanup to bring in line with guidelines
  • Loading branch information
olorin authored Jun 29, 2016
2 parents 041ad4b + 0d36ba9 commit 3d0f0d0
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 17 deletions.
6 changes: 2 additions & 4 deletions ambiata-warden.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ test-suite test

main-is: test.hs

ghc-options: -Wall -threaded -O2 -fsimpl-tick-factor=200
ghc-options: -Wall -threaded -O2

hs-source-dirs:
test
Expand Down Expand Up @@ -226,9 +226,7 @@ test-suite test-io

main-is: test-io.hs

-- Simplifier tick increase needed due to extensive use of vector-algorithms
-- in sampling-related tests.
ghc-options: -Wall -threaded -O2 -fsimpl-tick-factor=200
ghc-options: -Wall -threaded -O2

hs-source-dirs:
test
Expand Down
2 changes: 1 addition & 1 deletion mafia
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ case "$MODE" in
upgrade) shift; run_upgrade "$@" ;;
*) exec_mafia "$@"
esac
# Version: 90cf62f24007515d61be573e8b350b1ad4d1608c
# Version: dbbe635d8f98be1815130f04465c155f414985bf
1 change: 1 addition & 0 deletions src/Warden/Data/Check.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Check (
CheckDescription(..)
Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/Chunk.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Chunk (
Chunk(..)
Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/Field.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

{- This module will probably live in brandix soon. -}

Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/FieldAnomaly.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.FieldAnomaly (
AnomalousField(..)
Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/Inference.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

{- This module will probably end up in brandix. -}

Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/Marker.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Marker (
CheckResultSummary(..)
Expand Down
15 changes: 8 additions & 7 deletions src/Warden/Data/Numeric.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Numeric (
FieldNumericState(..)
Expand Down Expand Up @@ -45,7 +46,7 @@ import GHC.Generics (Generic)
import P

data Minimum =
Minimum {-# UNPACK #-} !Double
Minimum !Double
| NoMinimum
deriving (Eq, Show, Generic)

Expand All @@ -68,7 +69,7 @@ instance Monoid Minimum where
{-# INLINE mappend #-}

data Maximum =
Maximum {-# UNPACK #-} !Double
Maximum !Double
| NoMaximum
deriving (Eq, Show, Generic)

Expand Down Expand Up @@ -126,7 +127,7 @@ instance AEq MeanAcc where
-- | Final mean.
data Mean =
NoMean
| Mean {-# UNPACK #-} !Double
| Mean !Double
deriving (Eq, Show, Generic)

instance NFData Mean where rnf = genericRnf
Expand All @@ -143,7 +144,7 @@ instance AEq Mean where
(Mean x) ~== (Mean y) = x ~== y

data Median =
Median {-# UNPACK #-} !Double
Median !Double
| NoMedian
deriving (Eq, Show, Generic)

Expand Down Expand Up @@ -181,7 +182,7 @@ instance AEq StdDevAcc where
-- | Possibly-uninitialized 'StdDevAcc'.
data MStdDevAcc =
NoStdDevAcc
| MStdDevAcc {-# UNPACK #-} !StdDevAcc
| MStdDevAcc !StdDevAcc
deriving (Eq, Show, Generic)

instance NFData MStdDevAcc where rnf = genericRnf
Expand All @@ -203,7 +204,7 @@ instance NFData Variance where rnf = genericRnf

data StdDev =
NoStdDev
| StdDev {-# UNPACK #-} !Double
| StdDev !Double
deriving (Eq, Show, Generic)

instance NFData StdDev where rnf = genericRnf
Expand Down Expand Up @@ -249,7 +250,7 @@ instance NFData NumericFieldSummary where rnf = genericRnf

data MeanDevAcc =
MeanDevInitial
| MeanDevAcc {-# UNPACK #-} !MeanAcc !MStdDevAcc {-# UNPACK #-} !KAcc
| MeanDevAcc !MeanAcc !MStdDevAcc !KAcc
deriving (Eq, Show, Generic)

instance NFData MeanDevAcc where rnf = genericRnf
Expand Down
3 changes: 2 additions & 1 deletion src/Warden/Data/PII.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.PII (
MaxPIIObservations(..)
Expand Down Expand Up @@ -43,7 +44,7 @@ renderPIIType DateOfBirth = "date of birth"
renderPIIType CreditCard = "credit card"

data PotentialPII =
PotentialPII !PIIType {-# UNPACK #-} !FieldIndex
PotentialPII !PIIType !FieldIndex
deriving (Eq, Show, Ord, Generic)

instance NFData PotentialPII where rnf = genericRnf
Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/Param.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Param (
CheckParams(..)
Expand Down
5 changes: 3 additions & 2 deletions src/Warden/Data/Row.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Row (
FieldCount(..)
Expand Down Expand Up @@ -181,8 +182,8 @@ instance NFData FieldReservoirAcc where rnf = genericRnf

data SVParseState =
SVParseState {
_badRows :: {-# UNPACK #-} !RowCount
, _totalRows :: {-# UNPACK #-} !RowCount
_badRows :: !RowCount
, _totalRows :: !RowCount
-- | Unique counts of fields per row.
, _numFields :: !(Set FieldCount)
-- | Table of guesses of data type for each field.
Expand Down
3 changes: 2 additions & 1 deletion src/Warden/Data/Sampling.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Sampling(
Sample(..)
Expand All @@ -17,7 +18,7 @@ import P

data Sample =
NoSample
| Sample {-# UNPACK #-} !(VU.Vector Double)
| Sample !(VU.Vector Double)
deriving (Eq, Show, Generic)

instance NFData Sample where rnf = genericRnf
3 changes: 2 additions & 1 deletion src/Warden/Data/Sampling/Reservoir.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.Sampling.Reservoir(
Reservoir(..)
Expand All @@ -21,7 +22,7 @@ import P

data ReservoirAcc =
NoReservoirAcc
| ReservoirAcc {-# UNPACK #-} !Reservoir {-# UNPACK #-} !SampleCount
| ReservoirAcc !Reservoir !SampleCount
deriving Generic

instance NFData ReservoirAcc where rnf = genericRnf
Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

{- This module will probably end up in brandix. -}

Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/TextCounts.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

{-
Keep track of the number of Text values we've seen in a field by hashing them
Expand Down
1 change: 1 addition & 0 deletions src/Warden/Data/View.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}

module Warden.Data.View(
DirTree(..)
Expand Down

0 comments on commit 3d0f0d0

Please sign in to comment.