aboutsummaryrefslogtreecommitdiff
path: root/doc/coding_style
diff options
context:
space:
mode:
authorGravatar https://www.google.com/accounts/o8/id?id=AItOawnq-RfkVpFN15SWvQ2lpSGAi0XpNQuLxKM <Yuval@web>2014-07-06 10:46:00 +0000
committerGravatar admin <admin@branchable.com>2014-07-06 10:46:00 +0000
commitb9f9166d6bf2a3bbeae22e1b411f9478880caa68 (patch)
tree1563d4747ddc93e868f224fe205ea3f2d674722e /doc/coding_style
parentc69cb2fc067fa2cd083c11063ac6ad2c43bc9b2f (diff)
Added a comment: What about safe?
Diffstat (limited to 'doc/coding_style')
-rw-r--r--doc/coding_style/comment_1_70521cf79ad06832b1d73fc2c20c68ec._comment20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/coding_style/comment_1_70521cf79ad06832b1d73fc2c20c68ec._comment b/doc/coding_style/comment_1_70521cf79ad06832b1d73fc2c20c68ec._comment
new file mode 100644
index 000000000..a8200f856
--- /dev/null
+++ b/doc/coding_style/comment_1_70521cf79ad06832b1d73fc2c20c68ec._comment
@@ -0,0 +1,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.
+"""]]