{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Trustworthy #-}
module Data.Text.Encoding.Base16.Error.Lens
(
_DecodeError
, _ConversionError
) where
import Control.Lens
import Data.Text (Text)
import Data.Text.Encoding.Base16.Error (Base16Error(..))
_DecodeError :: forall err. Prism' (Base16Error err) Text
_DecodeError = prism' DecodeError $ \e -> case e of
DecodeError t -> Just t
ConversionError{} -> Nothing
_ConversionError :: forall err. Prism' (Base16Error err) err
_ConversionError = prism' ConversionError $ \e -> case e of
ConversionError err -> Just err
DecodeError{} -> Nothing