1 {-# LANGUAGE TypeApplications #-}
3 module Symantic.Parser.Error where
5 import Data.Either (Either (..))
6 import Data.Function (($), (.))
7 import Data.Proxy (Proxy)
10 class ErrorInj a b where
12 instance ErrorInj err e => ErrorInj err (Either e a) where
13 errorInj = Left . errorInj
22 liftError _e1 (Right a) = Right a
23 liftError _e1 (Left e) = Left $ errorInj @e1 @err $ errorInj @e0 @e1 e