packages feed

zipper-extra 0.1.3.1 → 0.1.3.2

raw patch · 3 files changed

+22/−31 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

LICENSE view
@@ -1,30 +1,19 @@-Copyright Daniel Firth (c) 2020--All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions are met:--    * Redistributions of source code must retain the above copyright-      notice, this list of conditions and the following disclaimer.+Copyright (c) 2020 Daniel Firth -    * 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.+Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions: -    * Neither the name of Author name here nor the names of other-      contributors may be used to endorse or promote products derived-      from this software without specific prior written permission.+The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software. -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-OWNER 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.+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
src/Control/Comonad/Zipper/Extra.hs view
@@ -1,7 +1,5 @@ {- |    Module     : Control.Comonad.Zipper.Extra-   Copyright  : Copyright (C) 2020 Daniel Firth-   Maintainer : Daniel Firth <dan.firth@homotopic.tech    License    : MIT    Stability  : experimental @@ -38,6 +36,8 @@ paginate :: Int -> [a] -> Maybe (Zipper [] [a]) paginate n = zipper . chunksOf n +-- | An exception type for when pagination fails to break up a list because either the+--   length of the list or the page size is zero. data PaginationException = EmptyContentsError | ZeroPageSize | UnknownPaginationException   deriving (Show, Eq, Typeable) @@ -66,6 +66,7 @@ zipperWithin :: Int -> Zipper t a -> [a] zipperWithin r xs = (`peek` xs) <$>  [(max 0 (pos xs - r)) .. (min (size xs -1) (pos xs + r))] +-- | Exception thrown when trying to make an empty zipper. data ZipperException = EmptyZipper   deriving (Show, Eq, Typeable) @@ -76,6 +77,7 @@ zipper' :: (MonadThrow m, Traversable t) => t a -> m (Zipper t a) zipper' xs = maybe (throwM EmptyZipper) return $ zipper xs +-- | Exception thrown when an element can not be found in a list or a zipper. data ElemNotFoundException a = ElemNotFoundException a [a]     deriving (Show, Eq, Typeable) 
zipper-extra.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 009c6d5a242a7bfa8126e4769efd8fd30dcc90f1e1d9d134071118e6e3a6effd+-- hash: 327c2d3767813cecfc10fa98e884ad2e3510d91c888ace687e71342603b45211  name:           zipper-extra-version:        0.1.3.1+version:        0.1.3.2 synopsis:       Zipper utils that weren't in Control.Comonad.Store.Zipper description:    Adds some utility functions for and reexports Control.Comonad.Store.Zipper category:       Comonads