packages feed

hslua-marshalling 2.1.0 → 2.2.0

raw patch · 4 files changed

+19/−6 lines, 4 filesdep ~hslua-coredep ~mtlPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hslua-core, mtl

API changes (from Hackage documentation)

+ HsLua.Marshalling.Peek: instance Data.Foldable.Foldable HsLua.Marshalling.Peek.Result
+ HsLua.Marshalling.Peek: instance Data.Traversable.Traversable HsLua.Marshalling.Peek.Result
+ HsLua.Marshalling.Peek: instance GHC.Base.MonadPlus (HsLua.Marshalling.Peek.Peek e)
+ HsLua.Marshalling.Peek: instance GHC.Base.MonadPlus HsLua.Marshalling.Peek.Result

Files

CHANGELOG.md view
@@ -2,6 +2,15 @@  `hslua-marshalling` uses [PVP Versioning][]. +## hslua-marshalling-2.2.0++Released 2022-02-19.++-   `Result` is now an instance of Foldable and Traversable.+    Both `Result` and `Peek` are made instances of `MonadPlus`.++-   Require hslua-core-2.2.0.+ ## hslua-marshalling-2.1.0  Released 29-01-2022.
hslua-marshalling.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.2 name:                hslua-marshalling-version:             2.1.0+version:             2.2.0 synopsis:            Marshalling of values between Haskell and Lua. description:         Provides functions to marshal values from Haskell                      to Lua, and /vice versa/.@@ -39,7 +39,7 @@   build-depends:       base              >= 4.8    && < 5                      , bytestring        >= 0.10.2 && < 0.12                      , containers        >= 0.5.9  && < 0.7-                     , hslua-core        >= 2.0    && < 2.2+                     , hslua-core        >= 2.2    && < 2.3                      , mtl               >= 2.2    && < 2.3                      , text              >= 1.2    && < 2.1   ghc-options:         -Wall
src/HsLua/Marshalling/Peek.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE CPP                 #-}-{-# LANGUAGE DeriveFunctor       #-}+{-# LANGUAGE DeriveTraversable   #-} {-# LANGUAGE OverloadedStrings   #-} {-# LANGUAGE ScopedTypeVariables #-} {-|@@ -33,7 +33,7 @@   ) where  import Control.Applicative (Alternative (..))-import Control.Monad ((<$!>), (<=<))+import Control.Monad ((<$!>), (<=<), MonadPlus) import Data.ByteString (ByteString) import Data.List (intercalate) import HsLua.Core as Lua@@ -50,7 +50,7 @@ data Result a   = Success !a   | Failure ByteString [Name]       -- ^ Error message and stack of contexts-  deriving (Show, Eq, Functor)+  deriving (Show, Eq, Foldable, Functor, Traversable)  instance Applicative Result where   pure = Success@@ -71,6 +71,8 @@     _          -> x   {-# INLINE (<|>) #-} +instance MonadPlus Result+ -- -- Peek --@@ -123,6 +125,8 @@     Success ra -> return (pure ra)     _          -> runPeek b   {-# INLINE (<|>) #-}++instance MonadPlus (Peek e)  instance MonadFail (Peek e) where   fail = Peek . return . failure . Utf8.fromString
src/HsLua/Marshalling/Userdata.hs view
@@ -58,6 +58,6 @@      pushInitialState :: LuaE e ()     pushInitialState = do-      newhsuserdata @[a] xs+      newhsuserdatauv @[a] xs 0       void (newudmetatable statename)       setmetatable (nth 2)