summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistairWard <>2020-08-10 10:41:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-08-10 10:41:00 (GMT)
commit369dba9a0854e89fd42c39469c9536972906a1c3 (patch)
treed10ed872389ddd12ad77436fb21814b9103da2b3
parent79bfdb47c49087044fe9f0e946d9feacd6c0eea6 (diff)
version 0.0.0.6HEAD0.0.0.6master
-rwxr-xr-x[-rw-r--r--].ghci0
-rwxr-xr-x[-rw-r--r--]README.markdown0
-rw-r--r--bishbosh.cabal2
-rwxr-xr-x[-rw-r--r--]bishbosh.spec2
-rwxr-xr-x[-rw-r--r--]bishbosh.svg0
-rwxr-xr-x[-rw-r--r--]changelog.markdown5
-rw-r--r--config/CECP/bishbosh_black.xml4
-rw-r--r--config/Raw/bishbosh_black.xml5
-rw-r--r--config/Raw/bishbosh_prof.xml2
-rw-r--r--config/bishbosh.dtd2
-rw-r--r--config/bishbosh.rng2
-rwxr-xr-x[-rw-r--r--]copyright0
-rwxr-xr-x[-rw-r--r--]man/man1/bishbosh.10
-rwxr-xr-x[-rw-r--r--]man/man5/bishbosh.50
-rw-r--r--src-exe/BishBosh/UI/CECP.hs19
-rw-r--r--src-exe/BishBosh/UI/Raw.hs34
-rw-r--r--src-exe/Main.hs3
-rw-r--r--src-lib/BishBosh/Input/IOOptions.hs4
-rw-r--r--src-lib/BishBosh/Input/Options.hs4
-rw-r--r--src-lib/BishBosh/Input/UIOptions.hs5
-rw-r--r--src-lib/BishBosh/Input/Verbosity.hs31
-rw-r--r--src-lib/BishBosh/Text/Encoding.hs21
-rw-r--r--src-lib/BishBosh/UI/Command.hs6
-rw-r--r--src-test/BishBosh/Test/QuickCheck/Input/Verbosity.hs3
-rw-r--r--src-test/BishBosh/Test/QuickCheck/Text/Encoding.hs6
25 files changed, 104 insertions, 56 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 748b415..748b415 100644..100755
--- a/README.markdown
+++ b/README.markdown
diff --git a/bishbosh.cabal b/bishbosh.cabal
index b1dda2d..fc93807 100644
--- a/bishbosh.cabal
+++ b/bishbosh.cabal
@@ -14,7 +14,7 @@
-- along with BishBosh. If not, see <http://www.gnu.org/licenses/>.
Name: bishbosh
-Version: 0.0.0.5
+Version: 0.0.0.6
Cabal-version: >= 1.10
Copyright: (C) 2018 Dr. Alistair Ward
License: GPL
diff --git a/bishbosh.spec b/bishbosh.spec
index 836715f..78e378e 100644..100755
--- a/bishbosh.spec
+++ b/bishbosh.spec
@@ -24,7 +24,7 @@
Summary: BishBosh is a chess-game.
Name: bishbosh
-Version: 0.0.0.5
+Version: 0.0.0.6
Release: 1
License: GPLv3
# From '/usr/share/doc/packages/rpm/GROUPS'.
diff --git a/bishbosh.svg b/bishbosh.svg
index a738e9e..a738e9e 100644..100755
--- a/bishbosh.svg
+++ b/bishbosh.svg
diff --git a/changelog.markdown b/changelog.markdown
index a2140f2..e2e9cd5 100644..100755
--- a/changelog.markdown
+++ b/changelog.markdown
@@ -15,3 +15,8 @@ Changed references to author's domain-name.
## 0.0.0.5
Added ability to specify the text-encoding used in a PGN-database file.
Updated list of test-compilers.
+
+## 0.0.0.6
+Fixed failure to persist game-state after requesting that the game be restarted.
+Fixed parsing of **TextEncoding** in **PGNOptions**.
+Replaced module **Distribution.Verbosity** with **BishBosh.Input.Verbosity**.
diff --git a/config/CECP/bishbosh_black.xml b/config/CECP/bishbosh_black.xml
index 73100e0..4881b7a 100644
--- a/config/CECP/bishbosh_black.xml
+++ b/config/CECP/bishbosh_black.xml
@@ -52,10 +52,10 @@
<identificationTag tag="ECO"/>
<identificationTag tag="Variation"/>
<!--
- </pgnOptions><pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="False" textEncoding="ISO8859-1">
+ </pgnOptions><pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="False" textEncoding="ISO-8859-1">
<identificationTag tag="ECO"/>
<identificationTag tag="Variation"/>
- </pgnOptions><pgnOptions databaseFilePath="pgn/bundesliga2000.pgn" validateMoves="False" textEncoding="ISO8859-1">
+ </pgnOptions><pgnOptions databaseFilePath="pgn/bundesliga2000.pgn" validateMoves="False" textEncoding="ISO-8859-1">
<identificationTag tag="Event"/>
<identificationTag tag="Round"/>
</pgnOptions><pgnOptions databaseFilePath="pgn/ficsgamesdb_201601_standard2000_nomovetimes_1403205.pgn" validateMoves="False" minimumPlies="8">
diff --git a/config/Raw/bishbosh_black.xml b/config/Raw/bishbosh_black.xml
index 90f4278..ef3f2ca 100644
--- a/config/Raw/bishbosh_black.xml
+++ b/config/Raw/bishbosh_black.xml
@@ -53,10 +53,11 @@
<identificationTag tag="Variation"/>
</pgnOptions>
<!--
- <pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="False" textEncoding="ISO8859-1">
+ <pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="False" textEncoding="ISO-8859-1">
<identificationTag tag="ECO"/>
<identificationTag tag="Variation"/>
- </pgnOptions><pgnOptions databaseFilePath="pgn/bundesliga2000.pgn" validateMoves="False" textEncoding="ISO8859-1">
+ </pgnOptions>
+ <pgnOptions databaseFilePath="pgn/bundesliga2000.pgn" validateMoves="False" textEncoding="ISO-8859-1">
<identificationTag tag="Event"/>
<identificationTag tag="Round"/>
</pgnOptions><pgnOptions databaseFilePath="pgn/ficsgamesdb_201601_standard2000_nomovetimes_1403205.pgn" validateMoves="False" minimumPlies="8">
diff --git a/config/Raw/bishbosh_prof.xml b/config/Raw/bishbosh_prof.xml
index 03eb503..0f2eaf8 100644
--- a/config/Raw/bishbosh_prof.xml
+++ b/config/Raw/bishbosh_prof.xml
@@ -56,7 +56,7 @@
</searchDepthByLogicalColour>
</searchOptions>
<ioOptions maximumPGNNames="8">
- <pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="True" textEncoding="ISO8859-1">
+ <pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="True" textEncoding="ISO-8859-1">
<identificationTag tag="ECO"/>
<identificationTag tag="Variation"/>
</pgnOptions>
diff --git a/config/bishbosh.dtd b/config/bishbosh.dtd
index 24909de..d9d053c 100644
--- a/config/bishbosh.dtd
+++ b/config/bishbosh.dtd
@@ -96,7 +96,7 @@
minimumPlies CDATA #IMPLIED
isStrictlySequential (False | True) #IMPLIED
validateMoves (False | True) #IMPLIED
- textEncoding (ISO8859-1 | UTF-8 | UTF-16 | UTF-32) #IMPLIED
+ textEncoding (ISO-8859-1 | UTF-8 | UTF-16 | UTF-32) #IMPLIED
>
<!ELEMENT identificationTag EMPTY>
<!ATTLIST identificationTag
diff --git a/config/bishbosh.rng b/config/bishbosh.rng
index 84ac80d..127c7d2 100644
--- a/config/bishbosh.rng
+++ b/config/bishbosh.rng
@@ -155,7 +155,7 @@
<optional>
<attribute name="textEncoding">
<choice>
- <value>ISO8859-1</value>
+ <value>ISO-8859-1</value>
<value>UTF-8</value>
<value>UTF-16</value>
<value>UTF-32</value>
diff --git a/copyright b/copyright
index 6e7efc1..6e7efc1 100644..100755
--- a/copyright
+++ b/copyright
diff --git a/man/man1/bishbosh.1 b/man/man1/bishbosh.1
index 007117e..007117e 100644..100755
--- a/man/man1/bishbosh.1
+++ b/man/man1/bishbosh.1
diff --git a/man/man5/bishbosh.5 b/man/man5/bishbosh.5
index 7fb02d9..7fb02d9 100644..100755
--- a/man/man5/bishbosh.5
+++ b/man/man5/bishbosh.5
diff --git a/src-exe/BishBosh/UI/CECP.hs b/src-exe/BishBosh/UI/CECP.hs
index 568d69c..ddde880 100644
--- a/src-exe/BishBosh/UI/CECP.hs
+++ b/src-exe/BishBosh/UI/CECP.hs
@@ -315,7 +315,20 @@ readMove positionHashQualifiedMoveTree randomGen = slave where
else showString " & leaving " . shows modeNames
) "."
- return {-to IO-monad-} $ State.PlayState.reconstructPositionHashQuantifiedGameTree Data.Default.def {-game-} playState {
+ let game'' = Data.Default.def
+
+ Data.Maybe.maybe (
+ return {-to IO-monad-} ()
+ ) (
+ \(filePath, _) -> Control.Exception.catch (
+ do
+ System.IO.withFile filePath System.IO.WriteMode (`System.IO.hPrint` game'')
+
+ Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "the game-state has been saved in " $ shows filePath "."
+ ) $ \e -> System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsErrorPrefix $ show (e :: Control.Exception.SomeException)
+ ) $ Input.IOOptions.getMaybePersistence ioOptions
+
+ return {-to IO-monad-} $ State.PlayState.reconstructPositionHashQuantifiedGameTree game'' playState {
State.PlayState.getOptions = options {
Input.Options.getIOOptions = ioOptions {
Input.IOOptions.getUIOptions = uiOptions {
@@ -323,7 +336,7 @@ readMove positionHashQualifiedMoveTree randomGen = slave where
}
}
}
- } -- By exiting the event-loop, the new game will be persisted where appropriate.
+ }
onCommand (UI.Command.RollBack maybeNPlies) = let
rollBack :: Component.Move.NMoves -> IO (State.PlayState.PlayState column criterionValue criterionWeight pieceSquareValue positionHash rankValue row weightedMean x y)
rollBack nPlies
@@ -1262,7 +1275,7 @@ takeTurns positionHashQualifiedMoveTree randomGen playState = do
) (
\(filePath, automatic) -> let
game'' = State.PlayState.getGame playState''
- in Control.Monad.when (automatic && show game'' /= show game') . Control.Exception.catch (
+ in Control.Monad.when automatic . Control.Exception.catch (
System.IO.withFile filePath System.IO.WriteMode (`System.IO.hPrint` game'')
) $ \e -> System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsErrorPrefix $ show (e :: Control.Exception.SomeException)
) $ Input.IOOptions.getMaybePersistence ioOptions
diff --git a/src-exe/BishBosh/UI/Raw.hs b/src-exe/BishBosh/UI/Raw.hs
index 4c5f5ff..390d781 100644
--- a/src-exe/BishBosh/UI/Raw.hs
+++ b/src-exe/BishBosh/UI/Raw.hs
@@ -52,7 +52,6 @@ import qualified BishBosh.Input.UIOptions as Input.UIOptions
import qualified BishBosh.Model.Game as Model.Game
import qualified BishBosh.Notation.MoveNotation as Notation.MoveNotation
import qualified BishBosh.Property.ForsythEdwards as Property.ForsythEdwards
-import qualified BishBosh.Property.Null as Property.Null
import qualified BishBosh.Property.ShowFloat as Property.ShowFloat
import qualified BishBosh.Search.Search as Search.Search
import qualified BishBosh.Search.SearchState as Search.SearchState
@@ -207,23 +206,31 @@ readMove positionHashQualifiedMoveTree randomGen startUTCTime playState = let
UI.PrintObject.PGN -> ContextualNotation.PGN.showsGame game >>= putStrLn . ($ "")
eventLoop
- onCommand UI.Command.Quit = do
+ onCommand UI.Command.Quit = do
Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr $ Text.Show.showsInfoPrefix "quitting on request."
return {-to IO-monad-} playState { State.PlayState.getMaybeApplicationTerminationReason = Just State.ApplicationTerminationReason.byRequest }
- onCommand UI.Command.Resign = do
+ onCommand UI.Command.Resign = do
Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr $ Text.Show.showsInfoPrefix "resigning."
return {-to IO-monad-} $ State.PlayState.resign playState
- onCommand UI.Command.Restart
- | Property.Null.isNull game = do
- Control.Monad.when (verbosity >= Data.Default.def) . System.IO.hPutStrLn System.IO.stderr $ Text.Show.showsWarningPrefix "the game is unstarted."
+ onCommand UI.Command.Restart = do
+ Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr $ Text.Show.showsInfoPrefix "restarting game."
- return {-to IO-monad-} playState
- | otherwise = do
- Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr $ Text.Show.showsInfoPrefix "restarting game."
+ let game'' = Data.Default.def
+
+ Data.Maybe.maybe (
+ return {-to IO-monad-} ()
+ ) (
+ \(filePath, _) -> Control.Exception.catch (
+ do
+ System.IO.withFile filePath System.IO.WriteMode (`System.IO.hPrint` game'')
+
+ Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.Show.showsInfoPrefix . showString "the game-state has been saved in " $ shows filePath "."
+ ) $ \e -> System.IO.hPutStrLn System.IO.stderr . Text.Show.showsErrorPrefix $ show (e :: Control.Exception.SomeException)
+ ) $ Input.IOOptions.getMaybePersistence ioOptions
- return {-to IO-monad-} $ State.PlayState.reconstructPositionHashQuantifiedGameTree Data.Default.def {-game-} playState -- By exiting the event-loop, the new game will be persisted where appropriate.
+ return {-to IO-monad-} $ State.PlayState.reconstructPositionHashQuantifiedGameTree game'' playState
onCommand (UI.Command.RollBack maybeNPlies) = let
rollBack :: Component.Move.NMoves -> IO (State.PlayState.PlayState column criterionValue criterionWeight pieceSquareValue positionHash rankValue row weightedMean x y)
rollBack nPlies
@@ -577,8 +584,11 @@ takeTurns positionHashQualifiedMoveTree randomGen playState = let
) (
\(filePath, automatic) -> let
game'' = State.PlayState.getGame playState''
- in Control.Monad.when (automatic && show game'' /= show game') . Control.Exception.catch (
- System.IO.withFile filePath System.IO.WriteMode (`System.IO.hPrint` game'')
+ in Control.Monad.when automatic . Control.Exception.catch (
+ do
+ System.IO.withFile filePath System.IO.WriteMode (`System.IO.hPrint` game'')
+
+ Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.Show.showsInfoPrefix . showString "the game-state has been saved in " $ shows filePath "."
) $ \e -> System.IO.hPutStrLn System.IO.stderr . Text.Show.showsErrorPrefix $ show (e :: Control.Exception.SomeException)
) $ Input.IOOptions.getMaybePersistence ioOptions
diff --git a/src-exe/Main.hs b/src-exe/Main.hs
index 00c37ec..26637d4 100644
--- a/src-exe/Main.hs
+++ b/src-exe/Main.hs
@@ -59,7 +59,6 @@ import qualified Data.Default
import qualified Data.List
import qualified Data.Maybe
import qualified Data.Version
-import qualified Distribution.Verbosity
import qualified Paths_bishbosh as Paths -- Either local stub, or package-instance auto-generated by 'Setup build'.
import qualified System.Console.GetOpt as G
import qualified System.Directory
@@ -269,7 +268,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 :: Input.Verbosity.Verbosity
preVerbosity
| null verbosityArgs = Data.Default.def
| otherwise = Input.CommandLineOption.readArg $ head verbosityArgs
diff --git a/src-lib/BishBosh/Input/IOOptions.hs b/src-lib/BishBosh/Input/IOOptions.hs
index 187df9a..3e59865 100644
--- a/src-lib/BishBosh/Input/IOOptions.hs
+++ b/src-lib/BishBosh/Input/IOOptions.hs
@@ -59,6 +59,7 @@ import qualified BishBosh.Data.Exception as Data.Exception
import qualified BishBosh.Input.CECPFeatures as Input.CECPFeatures
import qualified BishBosh.Input.PGNOptions as Input.PGNOptions
import qualified BishBosh.Input.UIOptions as Input.UIOptions
+import qualified BishBosh.Input.Verbosity as Input.Verbosity
import qualified BishBosh.Property.Tree as Property.Tree
import qualified BishBosh.Text.ShowList as Text.ShowList
import qualified Control.Arrow
@@ -66,7 +67,6 @@ import qualified Control.DeepSeq
import qualified Control.Exception
import qualified Data.Default
import qualified Data.Maybe
-import qualified Distribution.Verbosity
import qualified System.FilePath
import qualified Text.XML.HXT.Arrow.Pickle as HXT
import qualified ToolShed.Data.Foldable
@@ -261,7 +261,7 @@ deleteCECPFeature feature ioOptions@MkIOOptions { getUIOptions = uiOptions } = i
}
-- | Mutator.
-setVerbosity :: Distribution.Verbosity.Verbosity -> Transformation row column
+setVerbosity :: Input.Verbosity.Verbosity -> Transformation row column
setVerbosity verbosity ioOptions@MkIOOptions { getUIOptions = uiOptions } = ioOptions {
getUIOptions = uiOptions {
Input.UIOptions.getVerbosity = verbosity
diff --git a/src-lib/BishBosh/Input/Options.hs b/src-lib/BishBosh/Input/Options.hs
index 3666a88..42e3f30 100644
--- a/src-lib/BishBosh/Input/Options.hs
+++ b/src-lib/BishBosh/Input/Options.hs
@@ -61,6 +61,7 @@ import qualified BishBosh.Input.EvaluationOptions as Input.EvaluationOptions
import qualified BishBosh.Input.IOOptions as Input.IOOptions
import qualified BishBosh.Input.SearchOptions as Input.SearchOptions
import qualified BishBosh.Input.UIOptions as Input.UIOptions
+import qualified BishBosh.Input.Verbosity as Input.Verbosity
import qualified BishBosh.Property.ShowFloat as Property.ShowFloat
import qualified BishBosh.Property.Tree as Property.Tree
import qualified BishBosh.Text.ShowList as Text.ShowList
@@ -68,7 +69,6 @@ import qualified Control.DeepSeq
import qualified Control.Exception
import qualified Data.Default
import qualified Data.Maybe
-import qualified Distribution.Verbosity
import qualified System.FilePath
import qualified Text.XML.HXT.Arrow.Pickle as HXT
@@ -252,7 +252,7 @@ setMaybePersistence maybePersistence options@MkOptions { getIOOptions = ioOption
}
-- | Mutator.
-setVerbosity :: Distribution.Verbosity.Verbosity -> Transformation column criterionWeight pieceSquareValue rankValue row x y
+setVerbosity :: Input.Verbosity.Verbosity -> Transformation column criterionWeight pieceSquareValue rankValue row x y
setVerbosity verbosity options@MkOptions { getIOOptions = ioOptions } = options {
getIOOptions = Input.IOOptions.setVerbosity verbosity ioOptions
}
diff --git a/src-lib/BishBosh/Input/UIOptions.hs b/src-lib/BishBosh/Input/UIOptions.hs
index 452ad0f..abd8f54 100644
--- a/src-lib/BishBosh/Input/UIOptions.hs
+++ b/src-lib/BishBosh/Input/UIOptions.hs
@@ -67,7 +67,6 @@ import qualified Control.DeepSeq
import qualified Control.Exception
import qualified Data.Default
import qualified Data.Maybe
-import qualified Distribution.Verbosity
import qualified Text.XML.HXT.Arrow.Pickle as HXT
-- | Used to qualify XML.
@@ -99,7 +98,7 @@ data UIOptions row column = MkUIOptions {
getMaybePrintMoveTree :: Maybe Property.Tree.Depth, -- ^ Print the move-tree to the specified depth.
getNDecimalDigits :: Property.ShowFloat.NDecimalDigits, -- ^ The precision to which fractional auxiliary data is displayed.
getEitherNativeUIOrCECPOptions :: EitherNativeUIOrCECPOptions row column, -- ^ When a native display is configured some additional style-parameters are required.
- getVerbosity :: Distribution.Verbosity.Verbosity -- ^ Set the threshold for ancillary information-output.
+ getVerbosity :: Input.Verbosity.Verbosity -- ^ Set the threshold for ancillary information-output.
} deriving Eq
instance (
@@ -196,7 +195,7 @@ mkUIOptions
-> Maybe Property.Tree.Depth
-> Property.ShowFloat.NDecimalDigits -- ^ The precision to which fractional auxiliary data is displayed.
-> EitherNativeUIOrCECPOptions row column
- -> Distribution.Verbosity.Verbosity -- ^ Set the threshold for logging.
+ -> Input.Verbosity.Verbosity -- ^ Set the threshold for logging.
-> UIOptions row column
mkUIOptions moveNotation maybePrintMoveTree nDecimalDigits eitherNativeUIOrCECPOptions verbosity
| Just depth <- maybePrintMoveTree
diff --git a/src-lib/BishBosh/Input/Verbosity.hs b/src-lib/BishBosh/Input/Verbosity.hs
index fa8b9ca..b9ed77b 100644
--- a/src-lib/BishBosh/Input/Verbosity.hs
+++ b/src-lib/BishBosh/Input/Verbosity.hs
@@ -1,4 +1,3 @@
-{-# OPTIONS_GHC -fno-warn-orphans #-}
{-
Copyright (C) 2018 Dr. Alistair Ward
@@ -20,10 +19,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 BishBosh.Input.Verbosity(
+-- * Types
+-- ** Data-types
+ Verbosity(),
-- * Constants
tag,
range
@@ -31,7 +35,6 @@ module BishBosh.Input.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
@@ -39,16 +42,28 @@ import qualified Text.XML.HXT.Arrow.Pickle.Schema
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.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-lib/BishBosh/Text/Encoding.hs b/src-lib/BishBosh/Text/Encoding.hs
index 99018ad..09bb7af 100644
--- a/src-lib/BishBosh/Text/Encoding.hs
+++ b/src-lib/BishBosh/Text/Encoding.hs
@@ -43,13 +43,20 @@ instance Eq System.IO.TextEncoding where
instance Read System.IO.TextEncoding where
readsPrec _ s = case Data.List.Extra.trimStart s of
- 'I':'S':'O':'8':'8':'5':'9':'-':'1':remainder -> return {-to List-monad-} . (,) System.IO.latin1 $ case remainder of
- '(':'c':'h':'e':'c':'k':'e':'d':')':remainder2 -> remainder2 -- Junk.
- _ -> remainder
- 'U':'T':'F':'-':'8':remainder -> [(System.IO.utf8, remainder)]
- 'U':'T':'F':'-':'1':'6':remainder -> [(System.IO.utf16, remainder)]
- 'U':'T':'F':'-':'3':'2':remainder -> [(System.IO.utf32, remainder)]
- _ -> [] -- No parse.
+ 'I':'S':'O':remainder -> case remainder of
+ '8':'8':'5':'9':'-':'1':remainder2 -> return {-to List-monad-} . (,) System.IO.latin1 $ case remainder2 of
+ '(':'c':'h':'e':'c':'k':'e':'d':')':remainder3 -> remainder3
+ _ -> remainder2
+ '-':'8':'8':'5':'9':'-':'1':remainder2 -> return {-to List-monad-} . (,) System.IO.latin1 $ case remainder2 of
+ '(':'c':'h':'e':'c':'k':'e':'d':')':remainder3 -> remainder3
+ _ -> remainder2
+ _ -> [] -- No parse.
+ 'U':'T':'F':'-':remainder -> case remainder of
+ '8':remainder2 -> [(System.IO.utf8, remainder2)]
+ '1':'6':remainder2 -> [(System.IO.utf16, remainder2)]
+ '3':'2':remainder2 -> [(System.IO.utf32, remainder2)]
+ _ -> [] -- No parse.
+ _ -> [] -- No parse.
instance HXT.XmlPickler System.IO.TextEncoding where
xpickle = HXT.xpDefault Data.Default.def . HXT.xpWrap (read, show) . HXT.xpAttr tag . HXT.xpTextDT . Text.XML.HXT.Arrow.Pickle.Schema.scEnum $ map show range
diff --git a/src-lib/BishBosh/UI/Command.hs b/src-lib/BishBosh/UI/Command.hs
index 7895d97..a40314e 100644
--- a/src-lib/BishBosh/UI/Command.hs
+++ b/src-lib/BishBosh/UI/Command.hs
@@ -147,11 +147,11 @@ commands = [
), (
quitTag,
Nothing,
- "Quit"
+ "Terminate ths application"
), (
resignTag,
Nothing,
- "Resign"
+ "Admit defeat"
), (
restartTag,
Nothing,
@@ -163,7 +163,7 @@ commands = [
), (
saveTag,
Nothing,
- "Save"
+ "Persist the current game-state"
), (
setTag,
Just setArgs,
diff --git a/src-test/BishBosh/Test/QuickCheck/Input/Verbosity.hs b/src-test/BishBosh/Test/QuickCheck/Input/Verbosity.hs
index fd30349..cea7783 100644
--- a/src-test/BishBosh/Test/QuickCheck/Input/Verbosity.hs
+++ b/src-test/BishBosh/Test/QuickCheck/Input/Verbosity.hs
@@ -26,8 +26,7 @@
module BishBosh.Test.QuickCheck.Input.Verbosity() where
import qualified BishBosh.Input.Verbosity as Input.Verbosity
-import qualified Distribution.Verbosity
import qualified Test.QuickCheck
-instance Test.QuickCheck.Arbitrary Distribution.Verbosity.Verbosity where
+instance Test.QuickCheck.Arbitrary Input.Verbosity.Verbosity where
arbitrary = Test.QuickCheck.elements Input.Verbosity.range
diff --git a/src-test/BishBosh/Test/QuickCheck/Text/Encoding.hs b/src-test/BishBosh/Test/QuickCheck/Text/Encoding.hs
index 8c0d4a5..f8f301d 100644
--- a/src-test/BishBosh/Test/QuickCheck/Text/Encoding.hs
+++ b/src-test/BishBosh/Test/QuickCheck/Text/Encoding.hs
@@ -42,16 +42,16 @@ results = sequence [
let
f :: System.IO.TextEncoding -> Test.QuickCheck.Property
f = Test.QuickCheck.label "Text.Encoding.prop_readPrependedWhiteSpace" . ToolShed.Test.ReversibleIO.readPrependedWhiteSpace
- in Test.QuickCheck.quickCheckWithResult Test.QuickCheck.stdArgs { Test.QuickCheck.maxSuccess = 256 } f,
+ in Test.QuickCheck.quickCheckWithResult Test.QuickCheck.stdArgs { Test.QuickCheck.maxSuccess = 1024 } f,
let
f :: String -> Test.QuickCheck.Property
f garbage = Test.QuickCheck.label "Text.Encoding.prop_read" $ case (reads garbage :: [(System.IO.TextEncoding, String)]) of
[_] -> True
_ -> True -- Unless the read-implementation throws an exception.
- in Test.QuickCheck.quickCheckWithResult Test.QuickCheck.stdArgs { Test.QuickCheck.maxSuccess = 256 } f,
+ in Test.QuickCheck.quickCheckWithResult Test.QuickCheck.stdArgs { Test.QuickCheck.maxSuccess = 1024 } f,
let
f :: System.IO.TextEncoding -> String -> Test.QuickCheck.Property
f textEncoding = Test.QuickCheck.label "Text.Encoding.prop_readTrailingGarbage" . ToolShed.Test.ReversibleIO.readTrailingGarbage (const False) textEncoding
- in Test.QuickCheck.quickCheckWithResult Test.QuickCheck.stdArgs { Test.QuickCheck.maxSuccess = 256 } f
+ in Test.QuickCheck.quickCheckWithResult Test.QuickCheck.stdArgs { Test.QuickCheck.maxSuccess = 1024 } f
]