packages feed

hslua 1.0.1 → 1.0.2

raw patch · 29 files changed

+65/−38 lines, 29 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Foreign.Lua.Core.Error: instance GHC.Exception.Exception Foreign.Lua.Core.Error.Exception
+ Foreign.Lua.Core.Error: instance GHC.Exception.Type.Exception Foreign.Lua.Core.Error.Exception
- Foreign.Lua: callFunc :: (LuaCallFunc a) => String -> a
+ Foreign.Lua: callFunc :: LuaCallFunc a => String -> a
- Foreign.Lua.Core: State :: (Ptr ()) -> State
+ Foreign.Lua.Core: State :: Ptr () -> State
- Foreign.Lua.Core.Types: State :: (Ptr ()) -> State
+ Foreign.Lua.Core.Types: State :: Ptr () -> State
- Foreign.Lua.FunctionCalling: callFunc :: (LuaCallFunc a) => String -> a
+ Foreign.Lua.FunctionCalling: callFunc :: LuaCallFunc a => String -> a

Files

CHANGELOG.md view
@@ -1,5 +1,21 @@ ## Changelog +### 1.0.2++Released 2019-01-05.++- Fixed cross-compilation: placement of C import declarations+  were fixed, thereby resolving issues with cross-compilation.+  (Vanessa McHale and Faraz Maleknia)++- Added .gitattributes file, fixing the wrong language+  classification of the GitHub repository. (Vanessa McHale)++- Improved `toHaskellFunction` documentation. The documentation+  is now more specific on which Haskell exceptions are caught and+  which will lead to crashes.++ ### 1.0.1  - Exposed more functions from Lua's `lauxlib` library:
LICENSE view
@@ -1,7 +1,7 @@ Copyright (C) 1994-2018 Lua.org, PUC-Rio. Copyright (C) 2007-2012 Gracjan Polak Copyright (C) 2012-2015 Ömer Sinan Ağacan-Copyright (C) 2016-2018 Albert Krewinkel+Copyright (C) 2016-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
hslua.cabal view
@@ -1,5 +1,5 @@ name:                hslua-version:             1.0.1+version:             1.0.2 synopsis:            Bindings to Lua, an embeddable scripting language description:         HsLua provides bindings, wrappers, types, and helper                      functions to bridge Haskell and <https://www.lua.org/ Lua>.@@ -18,7 +18,7 @@ maintainer:          albert+hslua@zeitkraut.de copyright:           © 2007–2012 Gracjan Polak                      © 2012–2016 Ömer Sinan Ağacan-                     © 2016–2018 Albert Krewinkel+                     © 2016–2019 Albert Krewinkel category:            Foreign build-type:          Simple extra-source-files:  cbits/lua-5.3.5/*.h
src/Foreign/Lua.hs view
@@ -1,7 +1,7 @@ {- Copyright © 2007-2012 Gracjan Polak Copyright © 2012-2016 Ömer Sinan Ağacan-Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal@@ -25,7 +25,7 @@ Module      : Foreign.Lua Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Core.hs view
@@ -2,7 +2,7 @@ Module      : Foreign.Lua.Core Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Core/Auxiliary.hsc view
@@ -3,7 +3,7 @@ Module      : Foreign.Lua.Core.Auxiliary Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Core/Constants.hsc view
@@ -2,7 +2,7 @@ Module      : Foreign.Lua.Core.Constants Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Core/Error.hs view
@@ -3,7 +3,7 @@ {-# OPTIONS_GHC -fno-warn-orphans       #-} {-| Module      : Foreign.Lua.Core.Error-Copyright   : © 2017-2018 Albert Krewinkel+Copyright   : © 2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Core/Functions.hs view
@@ -2,7 +2,7 @@ Module      : Foreign.Lua.Core.Functions Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Core/RawBindings.hsc view
@@ -3,7 +3,7 @@ Module      : Foreign.Lua.Core.RawBindings Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Core/Types.hsc view
@@ -4,7 +4,7 @@ Module      : Foreign.Lua.Core.Types Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta@@ -52,6 +52,10 @@   , toReference   ) where +#include "lua.h"+-- required only for LUA_ERRFILE+#include "lauxlib.h"+ import Prelude hiding (Integer, EQ, LT)  import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow)@@ -61,10 +65,6 @@ import Foreign.Ptr (FunPtr, Ptr) import Foreign.Storable (Storable) import GHC.Generics (Generic)--#include "lua.h"--- required only for LUA_ERRFILE-#include "lauxlib.h"  -- | A Lua computation. This is the base type used to run Lua programs of any -- kind. The Lua state is handled automatically, but can be retrieved via
src/Foreign/Lua/FunctionCalling.hsc view
@@ -6,7 +6,7 @@ Module      : Foreign.Lua.FunctionCalling Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta@@ -73,8 +73,19 @@ --   * return type is @Lua a@, where @a@ is an instance of --     @'Pushable'@ ----- Any Haskell exception will be converted to a string and returned+-- Any @'Lua.Exception'@ will be converted to a string and returned -- as Lua error.+--+-- /Important/: this does __not__ catch exceptions other than+-- @'Lua.Exception'@; exception handling must be done by the converted+-- Haskell function. Failure to do so will cause the program to crash.+--+-- E.g., the following code could be used to handle an Exception of type+-- FooException, if that type is an instance of @'MonadCatch'@ and+-- @'Pushable'@:+--+-- > toHaskellFunction (myFun `catchM` (\e -> raiseError (e :: FooException)))+-- toHaskellFunction :: ToHaskellFunction a => a -> HaskellFunction toHaskellFunction a = toHsFun 1 a `catchException` \(Lua.Exception msg) ->   raiseError ("Error during function call: " <> msg)
src/Foreign/Lua/Types.hs view
@@ -1,6 +1,6 @@ {-| Module      : Foreign.Lua.Types-Copyright   : © 2017-2018 Albert Krewinkel+Copyright   : © 2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Types/Peekable.hs view
@@ -6,7 +6,7 @@ Module      : Foreign.Lua.Types.Peekable Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Types/Pushable.hs view
@@ -5,7 +5,7 @@ Module      : Foreign.Lua.Types.Pushable Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Userdata.hs view
@@ -3,7 +3,7 @@ Module      : Foreign.Lua.Userdata Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Utf8.hs view
@@ -1,6 +1,6 @@ {-| Module      : Foreign.Lua.Utf8-Copyright   : © 2018 Albert Krewinkel+Copyright   : © 2018-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
src/Foreign/Lua/Util.hs view
@@ -2,7 +2,7 @@ Module      : Foreign.Lua.Util Copyright   : © 2007–2012 Gracjan Polak,                 2012–2016 Ömer Sinan Ağacan,-                2017-2018 Albert Krewinkel+                2017-2019 Albert Krewinkel License     : MIT Maintainer  : Albert Krewinkel <tarleb+hslua@zeitkraut.de> Stability   : beta
test/Foreign/Lua/CoreTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal@@ -23,7 +23,7 @@ {-# OPTIONS_GHC -fno-warn-deprecations #-} {-| Module      :  Foreign.Lua.CoreTests-Copyright   :  © 2017-2018 Albert Krewinkel+Copyright   :  © 2017-2019 Albert Krewinkel License     :  MIT  Maintainer  :  Albert Krewinkel <tarleb+hslua@zeitkraut.de>
test/Foreign/Lua/FunctionCallingTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
test/Foreign/Lua/Types/PeekableTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal@@ -22,7 +22,7 @@ {-# LANGUAGE OverloadedStrings #-} {-| Module      :  Foreign.Lua.Types.PeekableTests-Copyright   :  © 2017-2018 Albert Krewinkel+Copyright   :  © 2017-2019 Albert Krewinkel License     :  MIT  Maintainer  :  Albert Krewinkel <tarleb+hslua@zeitkraut.de>
test/Foreign/Lua/Types/PushableTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal@@ -22,7 +22,7 @@ {-# LANGUAGE OverloadedStrings #-} {-| Module      :  Foreign.Lua.Types.PushableTests-Copyright   :  © 2017-2018 Albert Krewinkel+Copyright   :  © 2017-2019 Albert Krewinkel License     :  MIT  Maintainer  :  Albert Krewinkel <tarleb+hslua@zeitkraut.de>
test/Foreign/Lua/TypesTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
test/Foreign/Lua/UserdataTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2018 Albert Krewinkel+Copyright © 2018-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
test/Foreign/Lua/UtilTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2018 Albert Krewinkel+Copyright © 2018-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
test/Foreign/LuaTests.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
test/Test/HsLua/Arbitrary.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
test/Test/HsLua/Util.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
test/test-hslua.hs view
@@ -1,5 +1,5 @@ {--Copyright © 2017-2018 Albert Krewinkel+Copyright © 2017-2019 Albert Krewinkel  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal