Agda-2.5.2: A dependently typed functional programming language and proof assistant

Safe Haskell | Safe
Language | Haskell2010

Agda.Utils.Impossible

Description

An interface for reporting "impossible" errors

Synopsis

- data Impossible = Impossible String Integer
- throwImpossible :: Impossible -> a
- catchImpossible :: IO a -> (Impossible -> IO a) -> IO a

# Documentation

data Impossible #

"Impossible" errors, annotated with a file name and a line number corresponding to the source code location of the error.

Constructors

Impossible String Integer |

Instances

Show Impossible # |
Methods showsPrec :: Int -> Impossible -> ShowS # show :: Impossible -> String # showList :: [Impossible] -> ShowS #
Exception Impossible # |
Methods toException :: Impossible -> SomeException # fromException :: SomeException -> Maybe Impossible # displayException :: Impossible -> String #

throwImpossible :: Impossible -> a #

Abort by throwing an "impossible" error. You should not use this function directly. Instead use the macro in `undefined.h`.

catchImpossible :: IO a -> (Impossible -> IO a) -> IO a #

Catch an "impossible" error, if possible.