Add warnings for partial functions (#70)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
{-# LANGUAGE Trustworthy #-}
|
{-# LANGUAGE Trustworthy #-}
|
||||||
{-# LANGUAGE NoImplicitPrelude #-}
|
{-# LANGUAGE NoImplicitPrelude #-}
|
||||||
|
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
|
||||||
|
|
||||||
module Debug (
|
module Debug (
|
||||||
undefined,
|
undefined,
|
||||||
@@ -55,8 +56,10 @@ traceM s = trace (unpack s) (return ())
|
|||||||
traceId :: Text -> Text
|
traceId :: Text -> Text
|
||||||
traceId s = trace s s
|
traceId s = trace s s
|
||||||
|
|
||||||
|
{-# WARNING notImplemented "'notImplemented' remains in code" #-}
|
||||||
notImplemented :: a
|
notImplemented :: a
|
||||||
notImplemented = error "Not implemented"
|
notImplemented = error "Not implemented"
|
||||||
|
|
||||||
|
{-# WARNING undefined "'undefined' remains in code" #-}
|
||||||
undefined :: a
|
undefined :: a
|
||||||
undefined = error "Prelude.undefined"
|
undefined = error "Prelude.undefined"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import GHC.Types (RuntimeRep)
|
|||||||
import Protolude.CallStack (HasCallStack)
|
import Protolude.CallStack (HasCallStack)
|
||||||
import GHC.Exception (errorCallWithCallStackException)
|
import GHC.Exception (errorCallWithCallStackException)
|
||||||
|
|
||||||
|
{-# WARNING error "'error' remains in code" #-}
|
||||||
error :: forall (r :: RuntimeRep) . forall (a :: TYPE r) . HasCallStack => Text -> a
|
error :: forall (r :: RuntimeRep) . forall (a :: TYPE r) . HasCallStack => Text -> a
|
||||||
error s = raise# (errorCallWithCallStackException (unpack s) ?callstack)
|
error s = raise# (errorCallWithCallStackException (unpack s) ?callstack)
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ error s = raise# (errorCallWithCallStackException (unpack s) ?callstack)
|
|||||||
|
|
||||||
import GHC.Exception (errorCallException)
|
import GHC.Exception (errorCallException)
|
||||||
|
|
||||||
|
{-# WARNING error "'error' remains in code" #-}
|
||||||
error :: Text -> a
|
error :: Text -> a
|
||||||
error s = raise# (errorCallException (unpack s))
|
error s = raise# (errorCallException (unpack s))
|
||||||
|
|
||||||
@@ -42,6 +44,7 @@ error s = raise# (errorCallException (unpack s))
|
|||||||
import GHC.Types
|
import GHC.Types
|
||||||
import GHC.Exception
|
import GHC.Exception
|
||||||
|
|
||||||
|
{-# WARNING error "'error' remains in code" #-}
|
||||||
error :: Text -> a
|
error :: Text -> a
|
||||||
error s = throw (ErrorCall (unpack s))
|
error s = throw (ErrorCall (unpack s))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user