Use explicit imports from Prelude

To avoid ambigous references due to Prelude in 7.10 re-exporting 'Word'.
This commit is contained in:
Tomas Carnecky 2015-04-07 22:10:41 +00:00
parent 0dce9ad128
commit 2fa7fc2c15
9 changed files with 18 additions and 0 deletions

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