summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistairWard <>2020-08-10 10:38:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-08-10 10:38:00 (GMT)
commit1ff5f1beaf601017c139f89ed24d061100b1f954 (patch)
tree37acea4d2c4207c4fbfa560b3e94dbbf24e0c3db
parent5277c2e6dbfde03ec6bede78c478e1f6c96ecafb (diff)
version 0.0.0.3HEAD0.0.0.3master
-rwxr-xr-x[-rw-r--r--].ghci0
-rwxr-xr-x[-rw-r--r--]README.markdown0
-rwxr-xr-x[-rw-r--r--]changelog.Debian0
-rwxr-xr-x[-rw-r--r--]changelog.markdown3
-rwxr-xr-x[-rw-r--r--]copyright0
-rwxr-xr-x[-rw-r--r--]debian/DEBIAN/control2
-rwxr-xr-x[-rw-r--r--]images/weekdazeControlFlow.pdfbin54192 -> 54192 bytes
-rwxr-xr-x[-rw-r--r--]images/weekdazeIO.pdfbin42458 -> 42458 bytes
-rwxr-xr-x[-rw-r--r--]man/man1/weekdaze.10
-rwxr-xr-x[-rw-r--r--]man/man5/weekdaze.50
-rw-r--r--src-exe/Main.hs3
-rw-r--r--src-lib/WeekDaze/Input/Options.hs4
-rw-r--r--src-lib/WeekDaze/OutputConfiguration/Options.hs7
-rw-r--r--src-lib/WeekDaze/OutputConfiguration/Verbosity.hs33
-rw-r--r--src-test/WeekDaze/Test/QuickCheck/OutputConfiguration/Verbosity.hs8
-rw-r--r--weekdaze.cabal2
-rwxr-xr-x[-rw-r--r--]weekdaze.spec2
-rwxr-xr-x[-rw-r--r--]weekdaze.svg0
18 files changed, 40 insertions, 24 deletions
diff --git a/.ghci b/.ghci
index 5647b0d..5647b0d 100644..100755
--- a/.ghci
+++ b/.ghci
diff --git a/README.markdown b/README.markdown
index 5b3a857..5b3a857 100644..100755
--- a/README.markdown
+++ b/README.markdown
diff --git a/changelog.Debian b/changelog.Debian
index 521402e..521402e 100644..100755
--- a/changelog.Debian
+++ b/changelog.Debian
diff --git a/changelog.markdown b/changelog.markdown
index 6657a55..93c56d2 100644..100755
--- a/changelog.markdown
+++ b/changelog.markdown
@@ -4,3 +4,6 @@
## 0.0.0.2
Updated list of test-compilers.
+
+## 0.0.0.3
+Replaced module **Distribution.Verbosity** with **WeekDaze.OutputConfiguration.Verbosity**.
diff --git a/copyright b/copyright
index e4b6d10..e4b6d10 100644..100755
--- a/copyright
+++ b/copyright
diff --git a/debian/DEBIAN/control b/debian/DEBIAN/control
index 709b212..7621201 100644..100755
--- a/debian/DEBIAN/control
+++ b/debian/DEBIAN/control
@@ -1,5 +1,5 @@
Package: weekdaze
-Version: 0.0.0.2-1
+Version: 0.0.0.3-1
Section: utils
Priority: optional
Architecture: amd64
diff --git a/images/weekdazeControlFlow.pdf b/images/weekdazeControlFlow.pdf
index 17320ad..17320ad 100644..100755
--- a/images/weekdazeControlFlow.pdf
+++ b/images/weekdazeControlFlow.pdf
Binary files differ
diff --git a/images/weekdazeIO.pdf b/images/weekdazeIO.pdf
index 13f7e1a..13f7e1a 100644..100755
--- a/images/weekdazeIO.pdf
+++ b/images/weekdazeIO.pdf
Binary files differ
diff --git a/man/man1/weekdaze.1 b/man/man1/weekdaze.1
index 580179d..580179d 100644..100755
--- a/man/man1/weekdaze.1
+++ b/man/man1/weekdaze.1
diff --git a/man/man5/weekdaze.5 b/man/man5/weekdaze.5
index cb579c6..cb579c6 100644..100755
--- a/man/man5/weekdaze.5
+++ b/man/man5/weekdaze.5
diff --git a/src-exe/Main.hs b/src-exe/Main.hs
index ac8583a..edda55f 100644
--- a/src-exe/Main.hs
+++ b/src-exe/Main.hs
@@ -55,7 +55,6 @@ import qualified Data.Maybe
import qualified Data.Set
import qualified Data.Time.Clock
import qualified Data.Version
-import qualified Distribution.Verbosity
import qualified Factory.Data.Interval
import qualified Paths_weekdaze as Paths -- Either local stub, or package-instance autogenerated by 'Setup build'.
import qualified System.Console.GetOpt as G
@@ -598,7 +597,7 @@ main = do
but regrettably "verbosity" (a command-line option) is needed while doing so.
This is resolved by reading the "verbosity" from the command-line first.
-}
- preVerbosity :: Distribution.Verbosity.Verbosity
+ preVerbosity :: OutputConfiguration.Verbosity.Verbosity
preVerbosity
| null verbosityArgs = Data.Default.def
| otherwise = Input.CommandLineOption.readArg $ head verbosityArgs
diff --git a/src-lib/WeekDaze/Input/Options.hs b/src-lib/WeekDaze/Input/Options.hs
index 7ff91ce..ea3a129 100644
--- a/src-lib/WeekDaze/Input/Options.hs
+++ b/src-lib/WeekDaze/Input/Options.hs
@@ -70,7 +70,6 @@ import qualified Data.Foldable
import qualified Data.Map
import qualified Data.Maybe
import qualified Data.Set
-import qualified Distribution.Verbosity
import qualified Factory.Data.Interval
import qualified System.FilePath
import qualified Text.XML.HXT.Arrow.Pickle as HXT
@@ -97,6 +96,7 @@ import qualified WeekDaze.OutputConfiguration.Format as OutputConfiguration.F
import qualified WeekDaze.OutputConfiguration.Options as OutputConfiguration.Options
import qualified WeekDaze.OutputConfiguration.Style as OutputConfiguration.Style
import qualified WeekDaze.OutputConfiguration.View as OutputConfiguration.View
+import qualified WeekDaze.OutputConfiguration.Verbosity as OutputConfiguration.Verbosity
import qualified WeekDaze.ProblemConfiguration.ProblemParameters as ProblemConfiguration.ProblemParameters
import qualified WeekDaze.ProblemConfiguration.ProblemValidationSwitches as ProblemConfiguration.ProblemValidationSwitches
import qualified WeekDaze.Size as Size
@@ -475,7 +475,7 @@ setTimeslotIdBounds timeslotIdBounds options
timetableCriteriaWeights = ExecutionConfiguration.ExecutionOptions.getTimetableCriteriaWeights $ getExecutionOptions options'
-- | Mutator.
-setVerbosity :: Distribution.Verbosity.Verbosity -> Mutator campus criterionWeight fecundityDecayRatio level locationId minimumContrastRatio populationDiversityRatio stream synchronisationId teacherId teachingRatio timeslotId
+setVerbosity :: OutputConfiguration.Verbosity.Verbosity -> Mutator campus criterionWeight fecundityDecayRatio level locationId minimumContrastRatio populationDiversityRatio stream synchronisationId teacherId teachingRatio timeslotId
setVerbosity verbosity options = options {
getOutputOptions = (getOutputOptions options) {
OutputConfiguration.Options.getVerbosity = verbosity
diff --git a/src-lib/WeekDaze/OutputConfiguration/Options.hs b/src-lib/WeekDaze/OutputConfiguration/Options.hs
index ca5df48..3c5cc8b 100644
--- a/src-lib/WeekDaze/OutputConfiguration/Options.hs
+++ b/src-lib/WeekDaze/OutputConfiguration/Options.hs
@@ -51,18 +51,17 @@ import qualified Control.DeepSeq
import qualified Data.Default
import qualified Data.List.Extra
import qualified Data.Maybe
-import qualified Distribution.Verbosity
import qualified System.FilePath
import qualified Text.XML.HXT.Arrow.Pickle as HXT
import qualified ToolShed.SelfValidate
import qualified WeekDaze.Aggregate.StudentClass as Aggregate.StudentClass
import qualified WeekDaze.OutputConfiguration.FileFormat as OutputConfiguration.FileFormat
+import qualified WeekDaze.OutputConfiguration.Verbosity as OutputConfiguration.Verbosity
#ifdef USE_HDBC
import qualified Database.HDBC
import qualified WeekDaze.Database.Selector as Database.Selector
import qualified WeekDaze.OutputConfiguration.Format as OutputConfiguration.Format
-import qualified WeekDaze.OutputConfiguration.Verbosity as OutputConfiguration.Verbosity
instance (Fractional minimumContrastRatio, Show minimumContrastRatio) => Database.Selector.Selector (Options minimumContrastRatio) where
fromDatabase connection projectIdSql = let
@@ -130,7 +129,7 @@ data Options minimumContrastRatio = MkOptions {
getMaybeOutputConfigFilePath :: Maybe System.FilePath.FilePath, -- ^ Optional path to a file, into which the unprocessed configuration, formatted as XML, should be written (obliterating any existing file-contents).
getNDecimalDigits :: NDecimalDigits, -- ^ The precision to which fractional auxiliary data is displayed.
getStudentBodyMnemonicSeparator :: Aggregate.StudentClass.MnemonicSeparator, -- ^ The separator used when merging the mnemonics of /student-bodies/.
- getVerbosity :: Distribution.Verbosity.Verbosity -- ^ Set the threshold for ancillary information-output.
+ getVerbosity :: OutputConfiguration.Verbosity.Verbosity -- ^ Set the threshold for ancillary information-output.
} deriving (Eq, Show)
instance Show minimumContrastRatio => ToolShed.SelfValidate.SelfValidator (Options minimumContrastRatio) where
@@ -183,7 +182,7 @@ mkOptions
-> Maybe System.FilePath.FilePath -- ^ An optional path to a file, into which the unprocessed configuration, formatted as XML, should be written.
-> NDecimalDigits -- ^ The number of decimal digits with which to log the value of /lesson-criteria/ & /timetable-criteria/.
-> Aggregate.StudentClass.MnemonicSeparator -- ^ The separator to use when /student-bodies/ with identical profiles have been merged automatically during runtime.
- -> Distribution.Verbosity.Verbosity -- ^ The amount of auxiliary data to log.
+ -> OutputConfiguration.Verbosity.Verbosity -- ^ The amount of auxiliary data to log.
-> Options minimumContrastRatio
mkOptions fileFormats maybeOutputConfigFilePath nDecimalDigits studentBodyMnemonicSeparator verbosity
| ToolShed.SelfValidate.isValid options = options
diff --git a/src-lib/WeekDaze/OutputConfiguration/Verbosity.hs b/src-lib/WeekDaze/OutputConfiguration/Verbosity.hs
index 6234213..947aa47 100644
--- a/src-lib/WeekDaze/OutputConfiguration/Verbosity.hs
+++ b/src-lib/WeekDaze/OutputConfiguration/Verbosity.hs
@@ -1,4 +1,3 @@
-{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE CPP, MultiParamTypeClasses #-}
{-
Copyright (C) 2013-2015 Dr. Alistair Ward
@@ -21,10 +20,15 @@
{- |
[@AUTHOR@] Dr. Alistair Ward
- [@DESCRIPTION@] Instance-definitions for 'Distribution.Verbosity.Verbosity'.
+ [@DESCRIPTION@]
+ The levels of program-output.
+ N.B.: the data-type is coincidentally similar to 'Distribution.Verbosity.Internal.VerbosityLevel'.
-}
module WeekDaze.OutputConfiguration.Verbosity(
+-- * Types
+-- ** Data-types
+ Verbosity(),
-- * Constants
tag,
range
@@ -32,7 +36,6 @@ module WeekDaze.OutputConfiguration.Verbosity(
import qualified Control.DeepSeq
import qualified Data.Default
-import qualified Distribution.Verbosity
import qualified Text.XML.HXT.Arrow.Pickle as HXT
import qualified Text.XML.HXT.Arrow.Pickle.Schema
@@ -40,7 +43,7 @@ import qualified Text.XML.HXT.Arrow.Pickle.Schema
import qualified Data.Convertible
import qualified Database.HDBC
-instance Data.Convertible.Convertible Database.HDBC.SqlValue Distribution.Verbosity.Verbosity {-multi-parameter type-class-} where
+instance Data.Convertible.Convertible Database.HDBC.SqlValue Verbosity {-multi-parameter type-class-} where
safeConvert = fmap read . Data.Convertible.safeConvert
#endif /* USE_HDBC */
@@ -48,16 +51,28 @@ instance Data.Convertible.Convertible Database.HDBC.SqlValue Distribution.Verbos
tag :: String
tag = "verbosity"
-instance Data.Default.Default Distribution.Verbosity.Verbosity where
- def = Distribution.Verbosity.normal
+-- | Define the levels of program-output.
+data Verbosity
+ = Silent
+ | Normal
+ | Verbose
+ | Deafening
+ deriving (Enum, Eq, Ord, Read, Show)
-instance HXT.XmlPickler Distribution.Verbosity.Verbosity where
+instance Bounded Verbosity where
+ minBound = Silent
+ maxBound = Deafening
+
+instance Data.Default.Default Verbosity where
+ def = Normal
+
+instance HXT.XmlPickler Verbosity where
-- xpickle = HXT.xpPrim
xpickle = HXT.xpWrap (read, show) . HXT.xpAttr tag . HXT.xpTextDT . Text.XML.HXT.Arrow.Pickle.Schema.scEnum $ map show range -- CAVEAT: whether it'll be used as an XML-attribute or an XML-element isn't currently known.
-instance Control.DeepSeq.NFData Distribution.Verbosity.Verbosity where
+instance Control.DeepSeq.NFData Verbosity where
rnf _ = ()
-- | The constant complete range of values.
-range :: [Distribution.Verbosity.Verbosity]
+range :: [Verbosity]
range = [minBound .. maxBound]
diff --git a/src-test/WeekDaze/Test/QuickCheck/OutputConfiguration/Verbosity.hs b/src-test/WeekDaze/Test/QuickCheck/OutputConfiguration/Verbosity.hs
index 54bb542..2f7d971 100644
--- a/src-test/WeekDaze/Test/QuickCheck/OutputConfiguration/Verbosity.hs
+++ b/src-test/WeekDaze/Test/QuickCheck/OutputConfiguration/Verbosity.hs
@@ -20,13 +20,13 @@
{- |
[@AUTHOR@] Dr. Alistair Ward
- [@DESCRIPTION@] Implements 'Test.QuickCheck.Arbitrary' for 'Distribution.Verbosity.Verbosity'.
+ [@DESCRIPTION@] Implements 'Test.QuickCheck.Arbitrary' for 'OutputConfiguration.Verbosity.Verbosity'.
-}
module WeekDaze.Test.QuickCheck.OutputConfiguration.Verbosity() where
-import qualified Distribution.Verbosity
+import qualified WeekDaze.OutputConfiguration.Verbosity as OutputConfiguration.Verbosity
import qualified Test.QuickCheck
-instance Test.QuickCheck.Arbitrary Distribution.Verbosity.Verbosity where
- arbitrary = Test.QuickCheck.elements [minBound .. maxBound]
+instance Test.QuickCheck.Arbitrary OutputConfiguration.Verbosity.Verbosity where
+ arbitrary = Test.QuickCheck.elements OutputConfiguration.Verbosity.range
diff --git a/weekdaze.cabal b/weekdaze.cabal
index bcc75c9..5ca8b5f 100644
--- a/weekdaze.cabal
+++ b/weekdaze.cabal
@@ -14,7 +14,7 @@
-- along with WeekDaze. If not, see <http://www.gnu.org/licenses/>.
Name: weekdaze
-Version: 0.0.0.2
+Version: 0.0.0.3
Cabal-version: >= 1.10
Copyright: (C) 2013-2015 Dr. Alistair Ward
License: GPL
diff --git a/weekdaze.spec b/weekdaze.spec
index 9e814cd..e36cd2b 100644..100755
--- a/weekdaze.spec
+++ b/weekdaze.spec
@@ -24,7 +24,7 @@
Summary: Attempts to find a timetable satisfying the configured requirements.
Name: weekdaze
-Version: 0.0.0.2
+Version: 0.0.0.3
Release: 1
License: GPLv3
# From '/usr/share/doc/packages/rpm/GROUPS'.
diff --git a/weekdaze.svg b/weekdaze.svg
index 5d64b85..5d64b85 100644..100755
--- a/weekdaze.svg
+++ b/weekdaze.svg