Skip to content

Commit

Permalink
Make OsString Lift instance compatible with GHC-8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Jun 24, 2024
1 parent 7d4a574 commit 802265c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions System/OsString/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ instance Semigroup OsString where
instance Lift OsString where
lift xs = case coercionToPlatformTypes of
Left (_, co) ->
[| OsString (WindowsString (BS.pack $(lift $ BS.unpack $ coerce $ coerceWith co xs))) :: OsString |]
let x = lift $ unWS $ coerceWith co xs
in TH.AppE (TH.ConE (TH.mkName "OsString")) <$> x
Right (_, co) ->
[| OsString (PosixString (BS.pack $(lift $ BS.unpack $ coerce $ coerceWith co xs))) :: OsString |]
let x = lift $ unPS $ coerceWith co xs
in TH.AppE (TH.ConE (TH.mkName "OsString")) <$> x
#if MIN_VERSION_template_haskell(2,17,0)
liftTyped = TH.unsafeCodeCoerce . TH.lift
#elif MIN_VERSION_template_haskell(2,16,0)
Expand Down

0 comments on commit 802265c

Please sign in to comment.