mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-05 23:03:38 +00:00
21 lines
362 B
Haskell
21 lines
362 B
Haskell
|
{-# LANGUAGE CPP #-}
|
||
|
|
||
|
module MetaBrush.Assert
|
||
|
( assert )
|
||
|
where
|
||
|
|
||
|
-- base
|
||
|
#ifdef ASSERTS
|
||
|
import Control.Exception
|
||
|
( AssertionFailed(..), throw )
|
||
|
#endif
|
||
|
|
||
|
--------------------------------------------------------------------------------
|
||
|
|
||
|
assert :: String -> a -> a
|
||
|
#ifdef ASSERTS
|
||
|
assert message _ = throw ( AssertionFailed message )
|
||
|
#else
|
||
|
assert _ a = a
|
||
|
#endif
|