From 6b6f8967accf50f811a6c10189ddb90cb58b8315 Mon Sep 17 00:00:00 2001 From: Stephen Diehl Date: Sat, 2 Jul 2016 14:00:26 -0400 Subject: [PATCH] Note about exception handling. --- README.md | 13 +++++++++++++ protolude.cabal | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aca997199..d04bbda44 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,19 @@ manually. import GHC.Show (Show(..)) ``` +* Partial functions like ``undefined`` and ``error`` raise compiler warnings on + usage. + +This is by design. For fatal uncatchable errors use the provided ``panic`` +function if you intend the program to immediately abort. + +```haskell +panic "This is fatal my failure" +``` + +If inside of IO simply use ``throwIO`` for exception handling, or if in pure +business logic use well-typed checked exceptions of the ``ExceptT`` and variety. + License ------- diff --git a/protolude.cabal b/protolude.cabal index cee05882b..1ee0ca451 100644 --- a/protolude.cabal +++ b/protolude.cabal @@ -34,6 +34,8 @@ library exposed-modules: Protolude Unsafe + + other-modules: Base Applicative Bool @@ -48,8 +50,6 @@ library Bifunctor Panic - other-modules: - default-extensions: NoImplicitPrelude OverloadedStrings