File: comment_1_70521cf79ad06832b1d73fc2c20c68ec._comment

package info (click to toggle)
git-annex 5.20141125%2Bdeb8u1
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 37,832 kB
  • sloc: haskell: 42,603; sh: 1,080; ansic: 498; makefile: 316; perl: 125
file content (20 lines) | stat: -rw-r--r-- 805 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[[!comment format=mdwn
 username="https://www.google.com/accounts/o8/id?id=AItOawnq-RfkVpFN15SWvQ2lpSGAi0XpNQuLxKM"
 nickname="Yuval"
 subject="What about safe?"
 date="2014-07-06T10:45:59Z"
 content="""
https://hackage.haskell.org/package/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.
"""]]