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