An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

safe

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: tail :: [a] -> [a], raises an error on tail []. tailMay :: [a] -> Maybe [a], turns errors into Nothing. tailDef :: [a] -> [a] -> [a], takes a default to return on errors. tailNote :: String -> [a] -> [a], takes an extra argument which supplements the error message. tailSafe :: [a] -> [a], returns some sensible default if possible, [] in the case of tail. This package is divided into three modules: Safe contains safe variants of Prelude and Data.List functions. Safe.Foldable contains safe variants of Foldable functions. Safe.Exact creates crashing versions of functions like zip (errors if the lists are not equal) and take (errors if there are not enough elements), then wraps them to provide safe variants.

Ecosystem
hackage.haskell.org
Latest Release
0.3.21
about 2 years ago
Versions
23
Downloads
214,678 total
Dependent Packages
111
Dependent Repos
1,812
Links
Registry hackage.haskell.org
Source Repository
Homepage Homepage
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:hackage/safe
spec
License BSD-3-Clause
First Release almost 18 years ago
Last Synced 8 days ago
Repository
Stars 45 on GitHub
Forks 11 on GitHub
Docker Dependents 2
Docker Downloads 89
Commits 204
Committers 14
Avg per Author 14.571
DDS 0.103
Rankings on hackage.haskell.org
Overall Top 4.2%
Downloads Top 0.5%
Dependent packages Top 0.3%
Dependent repos Top 0.3%
Docker downloads Top 1.3%