witch 0.1.0.0 → 0.1.1.0
raw patch · 6 files changed
+17/−9 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Witch.Instances: instance Witch.Cast.Cast (Witch.TryCastException.TryCastException s t0) (Witch.TryCastException.TryCastException s t1)
Files
- src/ghc-8.10/Witch/Lift.hs +2/−2
- src/ghc-8.8/Witch/Lift.hs +2/−2
- src/ghc-9.0/Witch/Lift.hs +2/−2
- src/lib/Witch/Instances.hs +4/−2
- src/test/Main.hs +6/−0
- witch.cabal +1/−1
src/ghc-8.10/Witch/Lift.hs view
@@ -37,7 +37,7 @@ -- > unsafeFrom @s "some literal" -- > -- > -- Prefer this:--- > $$(liftedCast @s "some literal")+-- > $$(liftedFrom @s "some literal") liftedFrom :: forall s target source . ( Identity.Identity s ~ source@@ -58,7 +58,7 @@ -- > unsafeInto @t "some literal" -- > -- > -- Prefer this:--- > $$(liftedCast @t "some literal")+-- > $$(liftedInto @t "some literal") liftedInto :: forall t source target . ( Identity.Identity t ~ target
src/ghc-8.8/Witch/Lift.hs view
@@ -37,7 +37,7 @@ -- > unsafeFrom @s "some literal" -- > -- > -- Prefer this:--- > $$(liftedCast @s "some literal")+-- > $$(liftedFrom @s "some literal") liftedFrom :: forall s target source . ( Identity.Identity s ~ source@@ -58,7 +58,7 @@ -- > unsafeInto @t "some literal" -- > -- > -- Prefer this:--- > $$(liftedCast @t "some literal")+-- > $$(liftedInto @t "some literal") liftedInto :: forall t source target . ( Identity.Identity t ~ target
src/ghc-9.0/Witch/Lift.hs view
@@ -38,7 +38,7 @@ -- > unsafeFrom @s "some literal" -- > -- > -- Prefer this:--- > $$(liftedCast @s "some literal")+-- > $$(liftedFrom @s "some literal") liftedFrom :: forall s target m source . ( Identity.Identity s ~ source@@ -60,7 +60,7 @@ -- > unsafeInto @t "some literal" -- > -- > -- Prefer this:--- > $$(liftedCast @t "some literal")+-- > $$(liftedInto @t "some literal") liftedInto :: forall t source m target . ( Identity.Identity t ~ target
src/lib/Witch/Instances.hs view
@@ -1018,7 +1018,7 @@ -- Text -- | Uses 'Text.pack'. Some 'Char' values cannot be represented in 'Text.Text'--- and will be replaced with '\xFFFD'.+-- and will be replaced with @'\\xFFFD'@. instance Cast.Cast String Text.Text where cast = Text.pack @@ -1037,7 +1037,7 @@ -- LazyText -- | Uses 'LazyText.pack'. Some 'Char' values cannot be represented in--- 'LazyText.Text' and will be replaced with '\xFFFD'.+-- 'LazyText.Text' and will be replaced with @'\\xFFFD'@. instance Cast.Cast String LazyText.Text where cast = LazyText.pack @@ -1052,6 +1052,8 @@ -- | Uses 'LazyText.encodeUtf8'. instance Cast.Cast LazyText.Text LazyByteString.ByteString where cast = LazyText.encodeUtf8++instance Cast.Cast (TryCastException.TryCastException s t0) (TryCastException.TryCastException s t1) fromNonNegativeIntegral :: (Integral s, Num t) => s -> Maybe t fromNonNegativeIntegral x = if x < 0 then Nothing else Just $ fromIntegral x
src/test/Main.hs view
@@ -1637,6 +1637,12 @@ test $ f (LazyText.pack "") `Hspec.shouldBe` LazyByteString.pack [] test $ f (LazyText.pack "a") `Hspec.shouldBe` LazyByteString.pack [0x61] + -- TryCastException++ Hspec.describe "Cast (TryCastException s t0) (TryCastException s t1)" $ do+ let f = Witch.cast @(Witch.TryCastException () Int) @(Witch.TryCastException () Word)+ test $ f (Witch.TryCastException ()) `Hspec.shouldBe` Witch.TryCastException ()+ test :: Hspec.Example a => a -> Hspec.SpecWith (Hspec.Arg a) test = Hspec.it ""
witch.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: witch-version: 0.1.0.0+version: 0.1.1.0 synopsis: Convert values from one type into another. description: Witch converts values from one type into another.