mirror of
https://github.com/Gabriella439/optparse-generic.git
synced 2024-11-27 12:34:54 +03:00
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:
parent
df5544f0a5
commit
fc5c972de4
@ -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")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user