module Debug
( undefined
, error
, trace
, traceM
, traceId
, traceIO
, traceShow
, traceShowId
, traceShowM
, notImplemented
, NotImplemented(..)
) where
import Control.Monad (Monad, return)
import Data.Text (Text, unpack)
import Data.Data (Data)
import Data.Typeable (Typeable)
import GHC.Generics (Generic)
import Control.Monad.IO.Class (MonadIO)
import qualified Base as P
import qualified Prelude as P
import Show (Print, putStrLn)
import System.IO.Unsafe (unsafePerformIO)
trace :: Print b => b -> a -> a
trace string expr = unsafePerformIO (do
putStrLn string
return expr)
traceIO :: (Print b, MonadIO m) => b -> a -> m a
traceIO string expr = do
putStrLn string
return expr
error :: Text -> a
error s = P.error (unpack s)
traceShow :: P.Show a => a -> b -> b
traceShow a b = trace (P.show a) b
traceShowId :: P.Show a => a -> a
traceShowId a = trace (P.show a) a
traceShowM :: (P.Show a, Monad m) => a -> m ()
traceShowM a = trace (P.show a) (return ())
traceM :: (Monad m) => Text -> m ()
traceM s = trace (unpack s) (return ())
traceId :: Text -> Text
traceId s = trace s s
notImplemented :: a
notImplemented = P.error "Not implemented"
data NotImplemented = NotImplemented
deriving (P.Eq, P.Ord, P.Show, Data, Typeable, Generic)
undefined :: a
undefined = P.undefined