1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 02:14:20 +03:00

Define an Exception instance for Error.

This commit is contained in:
Rob Rix 2017-08-29 17:33:30 -04:00 committed by joshvera
parent 8801b21c77
commit 3b23701d39

View File

@ -1,6 +1,7 @@
{-# LANGUAGE GADTs, ImplicitParams, RankNTypes, StandaloneDeriving #-}
module Data.Error where
import Control.Exception
import Data.Blob
import Data.ByteString (isSuffixOf)
import Data.ByteString.Char8 (pack, unpack)
@ -22,6 +23,7 @@ deriving instance Foldable Error
deriving instance Functor Error
deriving instance Show grammar => Show (Error grammar)
deriving instance Traversable Error
instance Exception (Error String)
errorCallStack :: Error grammar -> CallStack
errorCallStack Error{} = callStack