mirror of
https://github.com/typeable/inflections-hs.git
synced 2024-09-11 06:05:33 +03:00
Merge pull request #8 from wereHamster/ghc-7.10
Add support for GHC 7.10
This commit is contained in:
commit
78a44e9859
51
.travis.yml
51
.travis.yml
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)"
|
||||
|
||||
|
@ -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)"
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user