1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Make Unimplemented store a String.

This commit is contained in:
Patrick Thomson 2019-12-06 14:49:38 -05:00
parent 17d0b57f85
commit cb0e0eae0c

View File

@ -20,11 +20,12 @@ import Syntax.Term
import Syntax.Traversable
data Failure (f :: Type -> Type) a
= forall a . Show a => Unimplemented a
= Unimplemented String
| InvariantViolated String
deriving Generic1
instance Show (Failure f a) where
show (Unimplemented a) = "unimplemented: " <> show a
show (Unimplemented a) = "unimplemented: " <> a
show (InvariantViolated a) = "invariant violated: " <> a
deriving instance Functor (Failure f)
@ -42,7 +43,7 @@ instance RightModule Failure where
a >>=* _ = coerce a
unimplemented :: (Show ast, Member Failure sig, Carrier sig m) => ast -> m a
unimplemented = send . Unimplemented
unimplemented = send . Unimplemented . show
invariantViolated :: (Member Failure sig, Carrier sig m) => String -> m a
invariantViolated = send . InvariantViolated