Merge pull request #8 from wereHamster/ghc-7.10

Add support for GHC 7.10
This commit is contained in:
Justin S. Leitgeb 2015-04-08 08:36:33 -05:00
commit 78a44e9859
11 changed files with 67 additions and 6 deletions

View File

@ -1,4 +1,47 @@
language: haskell
ghc:
- 7.6
- 7.8
env:
- CABALVER=1.16 GHCVER=7.0.1
- CABALVER=1.16 GHCVER=7.0.2
- CABALVER=1.16 GHCVER=7.0.3
- CABALVER=1.16 GHCVER=7.0.4
- CABALVER=1.16 GHCVER=7.2.1
- CABALVER=1.16 GHCVER=7.2.2
- CABALVER=1.16 GHCVER=7.4.1
- CABALVER=1.16 GHCVER=7.4.2
- CABALVER=1.16 GHCVER=7.6.1
- CABALVER=1.16 GHCVER=7.6.2
- CABALVER=1.18 GHCVER=7.6.3
- CABALVER=1.18 GHCVER=7.8.1
- CABALVER=1.18 GHCVER=7.8.2
- CABALVER=1.18 GHCVER=7.8.3
- CABALVER=1.18 GHCVER=7.8.4
- CABALVER=1.22 GHCVER=7.10.1
- CABALVER=head GHCVER=head
matrix:
allow_failures:
- env: CABALVER=head GHCVER=head
install:
- travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update
- cabal install --only-dependencies --enable-tests --enable-benchmarks
script:
- cabal configure --enable-tests --enable-benchmarks -v2
- cabal build
- cabal test
- cabal check
- cabal sdist
- export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
cd dist/;
if [ -f "$SRC_TGZ" ]; then
cabal install --force-reinstalls "$SRC_TGZ";
else
echo "expected '$SRC_TGZ' not found";
exit 1;
fi

View File

@ -4,6 +4,8 @@ import Text.Inflections.Parse.Types (Word(..))
import Data.Char (toUpper, toLower)
import Prelude (String, Bool(..), concatMap, (.), zip, ($), repeat)
-- |Turns a an input Word List in into CamelCase. Returns the CamelCase String.
camelize
:: [Word] -- ^ Input Words to separate with underscores

View File

@ -4,6 +4,8 @@ import Text.Inflections.Parse.Types (Word(..))
import Data.List (intercalate)
import Prelude (String, (.), map)
-- | Replaces underscores in a snake_cased string with dashes (hyphens).
dasherize
:: [Word] -- ^ Input Words to separate with dashes

View File

@ -5,6 +5,8 @@ import Text.Inflections.Parse.Types (Word(..))
import Data.List (intercalate)
import Data.Char (toUpper)
import Prelude (String, Bool(..), (.), map, zip, ($), unwords, repeat)
-- |Capitalizes the first word and turns underscores into spaces. Like titleize,
-- this is meant for creating pretty output.
humanize

View File

@ -10,5 +10,7 @@ import Text.Inflections.Parse.Types
import Control.Applicative ((<$>))
import Prelude (Char, String, (.), map)
acronym :: P.Stream s m Char => [String] -> P.ParsecT s u m Word
acronym as = Acronym <$> P.choice (map (Prim.try . C.string) as)

View File

@ -8,6 +8,8 @@ import Text.Parsec
import Text.Inflections.Parse.Types (Word(..))
import Text.Inflections.Parse.Acronym (acronym)
import Prelude (Char, String, Either, return, ($))
parseCamelCase :: [String] -> String -> Either ParseError [Word]
parseCamelCase acronyms = parse (parser acronyms) "(unknown)"

View File

@ -9,6 +9,8 @@ import Text.Parsec
import Text.Inflections.Parse.Types (Word(..))
import Text.Inflections.Parse.Acronym (acronym)
import Prelude (Char, String, Either, return)
parseSnakeCase :: [String] -> String -> Either ParseError [Word]
parseSnakeCase acronyms = parse (parser acronyms) "(unknown)"

View File

@ -1,5 +1,7 @@
module Text.Inflections.Parse.Types ( Word(..), mapWord ) where
import Prelude (String, Show, Eq, ($))
-- | A 'String' that should be kept whole through applied inflections
data Word

View File

@ -5,6 +5,8 @@ import Text.Inflections.Parse.Types (Word(..))
import Data.List (intercalate)
import Data.Char (toUpper)
import Prelude (String, unwords, map, ($))
-- | Capitalizes all the Words in the input 'Data.List'.
titleize
:: [Word] -- ^ List of Words, first of which will be capitalized

View File

@ -5,6 +5,8 @@ import Text.Inflections.Parse.Types (Word(..))
import Data.Char (toLower)
import Data.List (intercalate)
import Prelude (String, (.), map)
-- |Turns a CamelCase string into an underscore_separated String.
underscore
:: [Word] -- ^ Input Words to separate with underscores

View File

@ -41,7 +41,7 @@ library
, Text.Inflections.Parse.CamelCase
ghc-options: -Wall
build-depends: base >=4.5 && <4.8, parsec, containers
build-depends: base >=4.2 && <4.9, parsec, containers
default-language: Haskell2010
test-suite test
@ -50,7 +50,7 @@ test-suite test
main-is: Suite.hs
build-depends:
inflections
, base >=4.5 && <4.8
, base >=4.2 && <4.9
, test-framework
, HUnit
, QuickCheck