more OsPath conversion (639/749)
Sponsored-by: k0ld
This commit is contained in:
parent
a5d48edd94
commit
c74c75b352
28 changed files with 147 additions and 132 deletions
|
@ -8,6 +8,7 @@
|
|||
-}
|
||||
|
||||
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Utility.Aeson (
|
||||
module X,
|
||||
|
@ -32,6 +33,9 @@ import qualified Data.Vector
|
|||
import Prelude
|
||||
|
||||
import Utility.FileSystemEncoding
|
||||
#ifdef WITH_OSPATH
|
||||
import Utility.OsPath
|
||||
#endif
|
||||
|
||||
-- | Use this instead of Data.Aeson.encode to make sure that the
|
||||
-- below String instance is used.
|
||||
|
@ -60,6 +64,11 @@ instance ToJSON' String where
|
|||
instance ToJSON' S.ByteString where
|
||||
toJSON' = toJSON . packByteString
|
||||
|
||||
#ifdef WITH_OSPATH
|
||||
instance ToJSON' OsPath where
|
||||
toJSON' p = toJSON' (fromOsPath p :: S.ByteString)
|
||||
#endif
|
||||
|
||||
-- | Pack a String to Text, correctly handling the filesystem encoding.
|
||||
--
|
||||
-- Use this instead of Data.Text.pack.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue