safe 0.3.15 → 0.3.16
raw patch · 5 files changed
+40/−20 lines, 5 files
Files
- CHANGES.txt +18/−16
- LICENSE +1/−1
- Safe.hs +11/−0
- Test.hs +1/−0
- safe.cabal +9/−3
CHANGES.txt view
@@ -1,42 +1,44 @@ Changelog for Safe -0.3.15+0.3.16+ #22, add Safe index+0.3.15, released 2017-06-18 Support QuickCheck 2.10-0.3.14+0.3.14, released 2017-02-15 #20, fix for GHC 7.10.1-0.3.13+0.3.13, released 2017-02-09 #20, require GHC 7.4 or above-0.3.12+0.3.12, released 2017-02-05 #19, add Safe.Partial exposing a Partial typeclass #19, add support for GHC call stacks-0.3.11+0.3.11, released 2017-01-22 #16, add Safe succ and pred #16, add readEitherSafe for better errors than readEither #14, add Safe zip3Exact-0.3.10+0.3.10, released 2016-11-08 #15, add Safe cycle-0.3.9+0.3.9, released 2015-05-09 #9, add Safe toEnum-0.3.8+0.3.8, released 2014-08-10 #8, remove unnecessary Ord constraints from Foldable functions-0.3.7+0.3.7, released 2014-07-16 Add Def variants of the Exact functions-0.3.6+0.3.6, released 2014-07-12 #6, remove unnecessary Ord constraints from maximumBy/minimumBy-0.3.5+0.3.5, released 2014-06-28 Add Safe elemIndexJust/findIndexJust functions Add Safe scan functions Add Safe minimumBy/maximumBy functions Add a module of Exact functions Add Foldable minimum functions Clean up the Foldable module, deprecate the Safe variants-0.3.4+0.3.4, released 2014-01-30 #1, improve the string clipping in readNote-0.3.3+0.3.3, released 2011-11-15 #494, add foldl1' wrappings-0.3.2+0.3.2, released 2011-11-13 Add a Safe.Foldable module-0.3.1+0.3.1, released 2011-11-09 Add findJust, safe wrapping of fromJust/find-0.3+0.3, released 2010-11-10 Start of changelog
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2007-2017.+Copyright Neil Mitchell 2007-2018. All rights reserved. Redistribution and use in source and binary forms, with or without
Safe.hs view
@@ -49,9 +49,11 @@ toEnumMay, toEnumDef, toEnumNote, toEnumSafe, succMay, succDef, succNote, succSafe, predMay, predDef, predNote, predSafe,+ indexMay, indexDef, indexNote, ) where import Safe.Util+import Data.Ix import Data.List import Data.Maybe import Safe.Partial@@ -333,3 +335,12 @@ predSafe :: (Enum a, Eq a, Bounded a) => a -> a predSafe = predDef minBound++indexMay :: Ix a => (a, a) -> a -> Maybe Int+indexMay b i = if inRange b i then Just (index b i) else Nothing++indexDef :: Ix a => Int -> (a, a) -> a -> Int+indexDef def b = fromMaybe def . indexMay b++indexNote :: Ix a => String -> (a, a) -> a -> Int+indexNote note b = fromNote note "indexNote, out of range" . indexMay b
Test.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE ScopedTypeVariables #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} -- In the test suite, so OK module Main(main) where
safe.cabal view
@@ -1,17 +1,17 @@ cabal-version: >= 1.18 build-type: Simple name: safe-version: 0.3.15+version: 0.3.16 license: BSD3 license-file: LICENSE category: Unclassified author: Neil Mitchell <ndmitchell@gmail.com> maintainer: Neil Mitchell <ndmitchell@gmail.com>-copyright: Neil Mitchell 2007-2017+copyright: Neil Mitchell 2007-2018 homepage: https://github.com/ndmitchell/safe#readme synopsis: Library of safe (exception free) functions bug-reports: https://github.com/ndmitchell/safe/issues-tested-with: GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2+tested-with: GHC==8.2.1, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 description: A library wrapping @Prelude@/@Data.List@ functions that can throw exceptions, such as @head@ and @!!@. Each unsafe function has up to four variants, e.g. with @tail@:@@ -60,6 +60,12 @@ main-is: Test.hs default-language: Haskell2010 + other-modules:+ Safe+ Safe.Exact+ Safe.Foldable+ Safe.Partial+ Safe.Util build-depends: base, deepseq,