primitive-convenience (empty) → 0.1
raw patch · 5 files changed
+135/−0 lines, 5 filesdep +primitive
Dependencies added: primitive
Files
- CHANGELOG.md +12/−0
- LICENSE +29/−0
- README.md +10/−0
- primitive-convenience.cabal +53/−0
- src/Control/Monad/Primitive/Convenience.hs +31/−0
+ CHANGELOG.md view
@@ -0,0 +1,12 @@+# Changelog++`primitive-convenience` uses [PVP Versioning][1].+The changelog is available [on GitHub][2].++0.0.0+=====++* Initially created.++[1]: https://pvp.haskell.org+[2]: https://github.com/haskell-primitive/primitive-convenience/releases
+ LICENSE view
@@ -0,0 +1,29 @@+BSD 3-Clause License++Copyright (c) 2019, chessai+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright notice,+ this list of conditions and the following disclaimer in the documentation+ and/or other materials provided with the distribution.++3. Neither the name of the copyright holder nor the names of its+ contributors may be used to endorse or promote products derived from+ this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,10 @@+# primitive-convenience++[](https://hackage.haskell.org/package/primitive-convenience)+[](LICENSE)+[](https://travis-ci.org/haskell-primitive/primitive-convenience)++convenience classes for PrimMonad/PrimBase. The 'PrimMonad' state token+type can be annoying to handle in constraints. The typeclasses provided+in this library let users (visually) notice 'PrimState' equality+constraints less, by witnessing that `s ~ 'PrimState' m`.
+ primitive-convenience.cabal view
@@ -0,0 +1,53 @@+cabal-version: 2.2+name:+ primitive-convenience+version:+ 0.1+synopsis:+ convenience class for PrimMonad m/PrimState m+description:+ This library provides convenience classes for PrimMonad/PrimBase.+ .+ The 'PrimMonad' state token type can be annoying to handle in+ constraints. The typeclasses provided in this library let users+ (visually) notice 'PrimState' equality constraints less, by+ witnessing that `s ~ 'PrimState' m`.+homepage:+ https://github.com/haskell-primitive/primitive-convenience+bug-reports:+ https://github.com/haskell-primitive/primitive-convenience/issues+license:+ BSD-3-Clause+license-file:+ LICENSE+author:+ chessai+maintainer:+ chessai <chessai1996@gmail.com>+copyright:+ © 2019 chessai+category:+ Data+build-type:+ Simple+extra-doc-files:+ README.md+ , CHANGELOG.md++library+ hs-source-dirs:+ src+ exposed-modules:+ Control.Monad.Primitive.Convenience+ build-depends:+ , primitive >= 0.6.4 && < 0.8+ ghc-options:+ -Wall+ default-language:+ Haskell2010++source-repository head+ type:+ git+ location:+ https://github.com/haskell-primitive/primitive-convenience.git
+ src/Control/Monad/Primitive/Convenience.hs view
@@ -0,0 +1,31 @@+{-# language+ FlexibleInstances+ , FunctionalDependencies+ , MultiParamTypeClasses+ , NoImplicitPrelude+ , TypeFamilies+ , UndecidableInstances+ #-}++{-| Convenience typeclass for working with polymorphic @'PrimMonad'@s.+|-}+module Control.Monad.Primitive.Convenience+ ( MonadPrim+ , MonadPrimBase+ ) where++import Control.Monad.Primitive++-- | 'PrimMonad''s state token type can be annoying to handle+-- in constraints. This typeclass lets users (visually) notice+-- 'PrimState' equality constraints less, by witnessing that+-- @s ~ 'PrimState' m@.+class (PrimMonad m, s ~ PrimState m) => MonadPrim s m | m -> s where+instance (PrimMonad m, s ~ PrimState m) => MonadPrim s m++-- | 'PrimBase''s state token type can be annoying to handle+-- in constraints. This typeclass lets users (visually) notice+-- 'PrimState' equality constraints less, by witnessing that+-- @s ~ 'PrimState' m@.+class (PrimBase m, s ~ PrimState m) => MonadPrimBase s m | m -> s where+instance (PrimBase m, s ~ PrimState m) => MonadPrimBase s m