@@ -55,7 +55,10 @@ import qualified Language.Haskell.TH.Syntax as TH
55
55
56
56
-- | Commonly used windows string as UTF16 bytes.
57
57
newtype WindowsString = WindowsString { getWindowsString :: BS. ShortByteString }
58
- deriving (Eq , Ord , Show , Semigroup , Monoid , Typeable , Generic , NFData )
58
+ deriving (Eq , Ord , Semigroup , Monoid , Typeable , Generic , NFData )
59
+
60
+ instance Show WindowsString where
61
+ show (WindowsString ws) = show ws
59
62
60
63
-- | Just a short bidirectional synonym for 'WindowsString' constructor.
61
64
pattern WS :: BS. ShortByteString -> WindowsString
@@ -76,7 +79,10 @@ instance Lift WindowsString where
76
79
-- | Commonly used Posix string as uninterpreted @char[]@
77
80
-- array.
78
81
newtype PosixString = PosixString { getPosixString :: BS. ShortByteString }
79
- deriving (Eq , Ord , Show , Semigroup , Monoid , Typeable , Generic , NFData )
82
+ deriving (Eq , Ord , Semigroup , Monoid , Typeable , Generic , NFData )
83
+
84
+ instance Show PosixString where
85
+ show (PosixString ps) = show ps
80
86
81
87
-- | Just a short bidirectional synonym for 'PosixString' constructor.
82
88
pattern PS :: BS. ShortByteString -> PosixString
@@ -101,9 +107,16 @@ type PlatformString = PosixString
101
107
#endif
102
108
103
109
newtype WindowsChar = WindowsChar { getWindowsChar :: Word16 }
104
- deriving (Eq , Ord , Show , Typeable , Generic , NFData )
110
+ deriving (Eq , Ord , Typeable , Generic , NFData )
111
+
112
+ instance Show WindowsChar where
113
+ show (WindowsChar wc) = show wc
114
+
105
115
newtype PosixChar = PosixChar { getPosixChar :: Word8 }
106
- deriving (Eq , Ord , Show , Typeable , Generic , NFData )
116
+ deriving (Eq , Ord , Typeable , Generic , NFData )
117
+
118
+ instance Show PosixChar where
119
+ show (PosixChar pc) = show pc
107
120
108
121
-- | Just a short bidirectional synonym for 'WindowsChar' constructor.
109
122
pattern WW :: Word16 -> WindowsChar
@@ -134,7 +147,10 @@ type PlatformChar = PosixChar
134
147
-- dealing with the internals isn't generally recommended, but supported
135
148
-- in case you need to write platform specific code.
136
149
newtype OsString = OsString { getOsString :: PlatformString }
137
- deriving (Show , Typeable , Generic , NFData )
150
+ deriving (Typeable , Generic , NFData )
151
+
152
+ instance Show OsString where
153
+ show (OsString os) = show os
138
154
139
155
-- | Byte equality of the internal representation.
140
156
instance Eq OsString where
@@ -201,7 +217,10 @@ instance Lift OsString where
201
217
-- On Windows, this is restricted to two-octet codepoints 'Word16',
202
218
-- on POSIX one-octet ('Word8').
203
219
newtype OsChar = OsChar { getOsChar :: PlatformChar }
204
- deriving (Show , Typeable , Generic , NFData )
220
+ deriving (Typeable , Generic , NFData )
221
+
222
+ instance Show OsChar where
223
+ show (OsChar pc) = show pc
205
224
206
225
-- | Byte equality of the internal representation.
207
226
instance Eq OsChar where
0 commit comments