-- |
-- Module      :  Cryptol.Utils.Panic
-- Copyright   :  (c) 2013-2016 Galois, Inc.
-- License     :  BSD3
-- Maintainer  :  cryptol@galois.com
-- Stability   :  provisional
-- Portability :  portable

{-# LANGUAGE Trustworthy, TemplateHaskell #-}
module Cryptol.Utils.Panic
  (HasCallStack, CryptolPanic, Cryptol, Panic, panic) where

import Panic hiding (panic)
import qualified Panic as Panic

data Cryptol = Cryptol

type CryptolPanic = Panic Cryptol

panic :: HasCallStack => String -> [String] -> a
panic :: String -> [String] -> a
panic = Cryptol -> String -> [String] -> a
forall a b.
(PanicComponent a, HasCallStack) =>
a -> String -> [String] -> b
Panic.panic Cryptol
Cryptol

instance PanicComponent Cryptol where
  panicComponentName :: Cryptol -> String
panicComponentName Cryptol
_ = String
"Cryptol"
  panicComponentIssues :: Cryptol -> String
panicComponentIssues Cryptol
_ = String
"https://github.com/GaloisInc/cryptol/issues"

  {-# Noinline panicComponentRevision #-}
  panicComponentRevision :: Cryptol -> (String, String)
panicComponentRevision = Cryptol -> (String, String)
$useGitRevision