HCL 1.3 → 1.4
raw patch · 3 files changed
+19/−5 lines, 3 filesdep ~QuickCheckPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: QuickCheck
API changes (from Hackage documentation)
- System.Console.HCL: instance (Arbitrary a) => Arbitrary (RandomRequest a)
- System.Console.HCL: instance (Arbitrary a) => Arbitrary (Request a)
- System.Console.HCL: instance (Show a) => Show (RandomRequest a)
- System.Console.HCL: instance (Show a) => Show (Request a)
+ System.Console.HCL: instance Arbitrary a => Arbitrary (RandomRequest a)
+ System.Console.HCL: instance Arbitrary a => Arbitrary (Request a)
+ System.Console.HCL: instance Show a => Show (RandomRequest a)
+ System.Console.HCL: instance Show a => Show (Request a)
- System.Console.HCL: prompt1 :: (Show a) => String -> Request a -> a -> Request a
+ System.Console.HCL: prompt1 :: Show a => String -> Request a -> a -> Request a
- System.Console.HCL: promptWithDefault :: (Show a) => String -> Request a -> a -> Request a
+ System.Console.HCL: promptWithDefault :: Show a => String -> Request a -> a -> Request a
- System.Console.HCL: reqRead :: (Read a) => Request String -> Request a
+ System.Console.HCL: reqRead :: Read a => Request String -> Request a
Files
- HCL.cabal +5/−3
- LICENSE +10/−0
- hangman/Hangman.hs +4/−2
HCL.cabal view
@@ -1,11 +1,13 @@ Name: HCL-Version: 1.3+Version: 1.4 License: BSD3 Author: Justin Bailey-Homepage: +Homepage: http://github.com/m4dc4p/hcl/tree/master Maintainer: jgbailey _ gmail _ com Category: User Interfaces-Build-Depends: base, QuickCheck, mtl, random, containers+License-File: LICENSE+License: BSD3+Build-Depends: base, QuickCheck < 2, mtl, random, containers Build-type: Simple Synopsis: High-level library for building command line interfaces. Description:
+ LICENSE view
@@ -0,0 +1,10 @@+Copyright (c) 2009, Justin Bailey <jgbailey@gmail.com>+All rights reserved.++Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.+ * The authors name may not be used to endorse or promote products derived from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hangman/Hangman.hs view
@@ -35,13 +35,15 @@ do sz <- hFileSize f wordList <- hGetContents f - pickLine (sz `div` 2) (lines wordList) + pickLine (sz `div` 2) . lines $ wordList pickLine max words = do whichLine <- getStdRandom (randomR (0, max)) if null $ genericDrop (whichLine - 1) words then pickLine (max `div` 2) words - else return $ head (genericDrop (whichLine - 1) words) + -- On UNIX platforms, \r at end of each word is not + -- filtered, thus takeWhile + else return $! (takeWhile isAlpha . head . genericDrop (whichLine - 1) $ words) -- Add a guess to the hangman game. addGuess :: Hangman -> Char -> Hangman