1 {-# LANGUAGE TypeApplications #-}
2 module Language.Symantic.Grammar.Error where
4 import Data.Proxy (Proxy)
7 class ErrorInj a b where
9 instance ErrorInj err e => ErrorInj err (Either e a) where
10 errorInj = Left . errorInj
16 Proxy e1 -> Either e0 a -> Either err a
17 liftError _e1 (Right a) = Right a
18 liftError _e1 (Left e) = Left $ errorInj @e1 @err $ errorInj @e0 @e1 e