@@ -77,8 +77,7 @@ pattern WS { unWS } <- WindowsString unWS where
77
77
78
78
79
79
instance Lift WindowsString where
80
- lift (WindowsString bs)
81
- = [| WindowsString (BS. pack $ (lift $ BS. unpack bs)) :: WindowsString | ]
80
+ lift (WindowsString bs) = TH. AppE (TH. ConE 'WindowsString) <$> (lift bs)
82
81
#if MIN_VERSION_template_haskell(2,17,0)
83
82
liftTyped = TH. unsafeCodeCoerce . TH. lift
84
83
#elif MIN_VERSION_template_haskell(2,16,0)
@@ -103,8 +102,7 @@ pattern PS { unPS } <- PosixString unPS where
103
102
#endif
104
103
105
104
instance Lift PosixString where
106
- lift (PosixString bs)
107
- = [| PosixString (BS. pack $ (lift $ BS. unpack bs)) :: PosixString | ]
105
+ lift (PosixString bs) = TH. AppE (TH. ConE 'PosixString) <$> (lift bs)
108
106
#if MIN_VERSION_template_haskell(2,17,0)
109
107
liftTyped = TH. unsafeCodeCoerce . TH. lift
110
108
#elif MIN_VERSION_template_haskell(2,16,0)
@@ -197,9 +195,9 @@ instance Semigroup OsString where
197
195
instance Lift OsString where
198
196
lift xs = case coercionToPlatformTypes of
199
197
Left (_, co) ->
200
- [ | OsString ( WindowsString ( BS. pack $ (lift $ BS. unpack $ coerce $ coerceWith co xs))) :: OsString | ]
201
- Right (_, co) ->
202
- [ | OsString ( PosixString ( BS. pack $ (lift $ BS. unpack $ coerce $ coerceWith co xs))) :: OsString | ]
198
+ TH. AppE ( TH. ConE 'OsString) <$> (lift $ coerceWith co xs)
199
+ Right (_, co) -> do
200
+ TH. AppE ( TH. ConE 'OsString) <$> (lift $ coerceWith co xs)
203
201
#if MIN_VERSION_template_haskell(2,17,0)
204
202
liftTyped = TH. unsafeCodeCoerce . TH. lift
205
203
#elif MIN_VERSION_template_haskell(2,16,0)
0 commit comments