{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
#if MIN_VERSION_lens(5,0,0)
{-# LANGUAGE Safe #-}
#else
{-# LANGUAGE Trustworthy #-}
#endif
module Data.Text.Encoding.Base32.Error.Lens
(
_DecodeError
, _ConversionError
) where
import Control.Lens
import Data.Text (Text)
import Data.Text.Encoding.Base32.Error (Base32Error(..))
_DecodeError :: Prism' (Base32Error err) Text
_DecodeError :: p Text (f Text) -> p (Base32Error err) (f (Base32Error err))
_DecodeError = (Text -> Base32Error err)
-> (Base32Error err -> Maybe Text)
-> Prism (Base32Error err) (Base32Error err) Text Text
forall b s a. (b -> s) -> (s -> Maybe a) -> Prism s s a b
prism' Text -> Base32Error err
forall e. Text -> Base32Error e
DecodeError ((Base32Error err -> Maybe Text)
-> Prism (Base32Error err) (Base32Error err) Text Text)
-> (Base32Error err -> Maybe Text)
-> Prism (Base32Error err) (Base32Error err) Text Text
forall a b. (a -> b) -> a -> b
$ \case
DecodeError Text
t -> Text -> Maybe Text
forall a. a -> Maybe a
Just Text
t
ConversionError{} -> Maybe Text
forall a. Maybe a
Nothing
_ConversionError :: Prism' (Base32Error err) err
_ConversionError :: p err (f err) -> p (Base32Error err) (f (Base32Error err))
_ConversionError = (err -> Base32Error err)
-> (Base32Error err -> Maybe err)
-> Prism (Base32Error err) (Base32Error err) err err
forall b s a. (b -> s) -> (s -> Maybe a) -> Prism s s a b
prism' err -> Base32Error err
forall e. e -> Base32Error e
ConversionError ((Base32Error err -> Maybe err)
-> Prism (Base32Error err) (Base32Error err) err err)
-> (Base32Error err -> Maybe err)
-> Prism (Base32Error err) (Base32Error err) err err
forall a b. (a -> b) -> a -> b
$ \case
ConversionError err
err -> err -> Maybe err
forall a. a -> Maybe a
Just err
err
DecodeError{} -> Maybe err
forall a. Maybe a
Nothing