Get rid of ParseField instance for String

This is to encourage people to use the instance for `Text` instead and to
avoid overlap with the instance for lists
This commit is contained in:
Gabriel Gonzalez 2016-02-26 21:55:38 -08:00
parent df5544f0a5
commit fc5c972de4

View File

@ -49,6 +49,7 @@ import Prelude hiding (FilePath)
import Options.Applicative (Parser, ReadM)
import qualified Data.Text
import qualified Data.Text.Lazy
import qualified Data.Typeable
import qualified Filesystem.Path.CurrentOS as Filesystem
import qualified Options.Applicative as Options
@ -126,12 +127,12 @@ parseString metavar m =
<> Options.long (Data.Text.unpack name)
Options.option Options.str fs
instance ParseField String where
parseField = parseString "STRING"
instance ParseField Text where
instance ParseField Data.Text.Text where
parseField = fmap (fmap Data.Text.pack) (parseString "TEXT")
instance ParseField Data.Text.Lazy.Text where
parseField = fmap (fmap Data.Text.Lazy.pack) (parseString "TEXT")
instance ParseField FilePath where
parseField = fmap (fmap Filesystem.decodeString) (parseString "FILEPATH")