    module Data.Accessor.Example where

    import Data.Accessor.Basic ((.>), ($%), (^.), (^:), (^=), )
    import Data.Accessor.Tuple (first, second, first3, second3, )

    import qualified Data.Accessor.Container as Container
    import qualified Data.Accessor.BinaryRead as Read
    import qualified Data.Accessor.Show as Show
    import qualified Data.Accessor.Basic as Accessor

    import qualified Data.Array as Array
    import qualified Data.Set   as Set
    import qualified Data.Map   as Map

    import Data.Char (ord, toUpper, )

    import Prelude hiding (init)

    {- * Example accesses -}

    {- | Example of using 'set', 'get', 'modify'. -}
    plain :: Int
    plain :: Int
    plain =
       T (Char, Int) Int -> (Char, Int) -> Int
    forall r a. T r a -> r -> a
    Accessor.get T (Char, Int) Int
    forall a b. T (a, b) b
    second ((Char, Int) -> Int) -> (Char, Int) -> Int
    forall a b. (a -> b) -> a -> b
    $
       T (Char, Int) Int -> (Int -> Int) -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> (a -> a) -> r -> r
    Accessor.modify T (Char, Int) Int
    forall a b. T (a, b) b
    second Int -> Int
    forall a. Enum a => a -> a
    succ ((Char, Int) -> (Char, Int)) -> (Char, Int) -> (Char, Int)
    forall a b. (a -> b) -> a -> b
    $
       T (Char, Int) Char -> Char -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> a -> r -> r
    Accessor.set T (Char, Int) Char
    forall a b. T (a, b) a
    first Char
    'a' ((Char, Int) -> (Char, Int)) -> (Char, Int) -> (Char, Int)
    forall a b. (a -> b) -> a -> b
    $
       (Char
    'b',Int
    7)

    init :: (Char,Int)
    init :: (Char, Int)
    init =
       [(Char, Int) -> (Char, Int)] -> (Char, Int) -> (Char, Int)
    forall r. [r -> r] -> r -> r
    Accessor.compose
          [T (Char, Int) Char -> Char -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> a -> r -> r
    Accessor.set T (Char, Int) Char
    forall a b. T (a, b) a
    first Char
    'b',
           T (Char, Int) Char -> (Char -> Char) -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> (a -> a) -> r -> r
    Accessor.modify T (Char, Int) Char
    forall a b. T (a, b) a
    first Char -> Char
    forall a. Enum a => a -> a
    succ,
           T (Char, Int) Int -> Int -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> a -> r -> r
    Accessor.set T (Char, Int) Int
    forall a b. T (a, b) b
    second Int
    7]
          (Char
    forall a. HasCallStack => a
    undefined,Int
    forall a. HasCallStack => a
    undefined)
    --   setMany [first 'b', second 7] (undefined,undefined)

    initInfix :: (Char,Int)
    initInfix :: (Char, Int)
    initInfix =
       (Char
    forall a. HasCallStack => a
    undefined,Int
    forall a. HasCallStack => a
    undefined)
       (Char, Int) -> ((Char, Int) -> (Char, Int)) -> (Char, Int)
    forall a b. a -> (a -> b) -> b
    $% T (Char, Int) Char
    forall a b. T (a, b) a
    first T (Char, Int) Char -> Char -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> a -> r -> r
    ^= Char
    'b'
       (Char, Int) -> ((Char, Int) -> (Char, Int)) -> (Char, Int)
    forall a b. a -> (a -> b) -> b
    $% T (Char, Int) Char
    forall a b. T (a, b) a
    first T (Char, Int) Char -> (Char -> Char) -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> (a -> a) -> r -> r
    ^: Char -> Char
    forall a. Enum a => a -> a
    succ
       (Char, Int) -> ((Char, Int) -> (Char, Int)) -> (Char, Int)
    forall a b. a -> (a -> b) -> b
    $% T (Char, Int) Int
    forall a b. T (a, b) b
    second T (Char, Int) Int -> Int -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> a -> r -> r
    ^= Int
    7

    read :: Maybe ((Char,Int), Read.Stream)
    read :: Maybe ((Char, Int), Stream)
    read =
       Parser Stream (Char, Int)
    -> ((Char, Int), Stream) -> Maybe ((Char, Int), Stream)
    forall s r. Parser s r -> (r, s) -> Maybe (r, s)
    Read.runParser
          ([Parser Stream (Char, Int)] -> Parser Stream (Char, Int)
    forall s r. [Parser s r] -> Parser s r
    Read.record [T (Char, Int) Char -> Parser Stream (Char, Int)
    forall s a r. (ByteStream s, C a) => T r a -> Parser s r
    Read.field T (Char, Int) Char
    forall a b. T (a, b) a
    first, T (Char, Int) Int -> Parser Stream (Char, Int)
    forall s a r. (ByteStream s, C a) => T r a -> Parser s r
    Read.field T (Char, Int) Int
    forall a b. T (a, b) b
    second])
          ((Char
    forall a. HasCallStack => a
    undefined,Int
    forall a. HasCallStack => a
    undefined),
           Int -> Word8
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Char -> Int
    ord Char
    'c') Word8 -> Stream -> Stream
    forall a. a -> [a] -> [a]
    : Word8
    59 Word8 -> Stream -> Stream
    forall a. a -> [a] -> [a]
    : Word8
    154 Word8 -> Stream -> Stream
    forall a. a -> [a] -> [a]
    : Word8
    202 Word8 -> Stream -> Stream
    forall a. a -> [a] -> [a]
    : Word8
    0 Word8 -> Stream -> Stream
    forall a. a -> [a] -> [a]
    : [])

    infix0 :: Int
    infix0 :: Int
    infix0 =
       ((Char
    'b',Int
    7),String
    "hallo")((Char, Int), String)
    -> T ((Char, Int), String) (Char, Int) -> (Char, Int)
    forall r a. r -> T r a -> a
    ^.T ((Char, Int), String) (Char, Int)
    forall a b. T (a, b) a
    first(Char, Int) -> T (Char, Int) Int -> Int
    forall r a. r -> T r a -> a
    ^.T (Char, Int) Int
    forall a b. T (a, b) b
    second

    infix1 :: ((Char, Int), String)
    infix1 :: ((Char, Int), String)
    infix1 =
       ((Char
    'b',Int
    7),String
    "hallo")((Char, Int), String)
    -> (((Char, Int), String) -> ((Char, Int), String))
    -> ((Char, Int), String)
    forall a b. a -> (a -> b) -> b
    $%T ((Char, Int), String) (Char, Int)
    forall a b. T (a, b) a
    firstT ((Char, Int), String) (Char, Int)
    -> ((Char, Int) -> (Char, Int))
    -> ((Char, Int), String)
    -> ((Char, Int), String)
    forall r a. T r a -> (a -> a) -> r -> r
    ^:T (Char, Int) Int
    forall a b. T (a, b) b
    secondT (Char, Int) Int -> (Int -> Int) -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> (a -> a) -> r -> r
    ^:(Int
    1Int -> Int -> Int
    forall a. Num a => a -> a -> a
    +)

    infix2 :: ((Char, Int), String)
    infix2 :: ((Char, Int), String)
    infix2 =
       ((Char
    'b',Int
    7),String
    "hallo")((Char, Int), String)
    -> (((Char, Int), String) -> ((Char, Int), String))
    -> ((Char, Int), String)
    forall a b. a -> (a -> b) -> b
    $%T ((Char, Int), String) (Char, Int)
    forall a b. T (a, b) a
    firstT ((Char, Int), String) (Char, Int)
    -> ((Char, Int) -> (Char, Int))
    -> ((Char, Int), String)
    -> ((Char, Int), String)
    forall r a. T r a -> (a -> a) -> r -> r
    ^:T (Char, Int) Int
    forall a b. T (a, b) b
    secondT (Char, Int) Int -> Int -> (Char, Int) -> (Char, Int)
    forall r a. T r a -> a -> r -> r
    ^=Int
    10

    infix3 :: Int
    infix3 :: Int
    infix3 =
       ((Char
    'b',Int
    7),String
    "hallo")((Char, Int), String) -> T ((Char, Int), String) Int -> Int
    forall r a. r -> T r a -> a
    ^.(T ((Char, Int), String) (Char, Int)
    forall a b. T (a, b) a
    firstT ((Char, Int), String) (Char, Int)
    -> T (Char, Int) Int -> T ((Char, Int), String) Int
    forall a b c. T a b -> T b c -> T a c
    .>T (Char, Int) Int
    forall a b. T (a, b) b
    second)

    infix4 :: ((Char, Int), String)
    infix4 :: ((Char, Int), String)
    infix4 =
       ((Char
    'b',Int
    7),String
    "hallo")((Char, Int), String)
    -> (((Char, Int), String) -> ((Char, Int), String))
    -> ((Char, Int), String)
    forall a b. a -> (a -> b) -> b
    $%(T ((Char, Int), String) (Char, Int)
    forall a b. T (a, b) a
    firstT ((Char, Int), String) (Char, Int)
    -> T (Char, Int) Int -> T ((Char, Int), String) Int
    forall a b c. T a b -> T b c -> T a c
    .>T (Char, Int) Int
    forall a b. T (a, b) b
    second)T ((Char, Int), String) Int
    -> (Int -> Int) -> ((Char, Int), String) -> ((Char, Int), String)
    forall r a. T r a -> (a -> a) -> r -> r
    ^:(Int
    1Int -> Int -> Int
    forall a. Num a => a -> a -> a
    +)

    showsPair :: Int -> (Char, Int) -> ShowS
    showsPair :: Int -> (Char, Int) -> ShowS
    showsPair =
       [(Char, Int) -> (Char, Int) -> Maybe ShowS]
    -> String -> (Char, Int) -> Int -> (Char, Int) -> ShowS
    forall r.
    [r -> r -> Maybe ShowS] -> String -> r -> Int -> r -> ShowS
    Show.showsPrec
          [String
    -> T (Char, Int) Char -> (Char, Int) -> (Char, Int) -> Maybe ShowS
    forall a r.
    (Show a, Eq a) =>
    String -> T r a -> r -> r -> Maybe ShowS
    Show.field String
    "first"  T (Char, Int) Char
    forall a b. T (a, b) a
    first,
           String
    -> T (Char, Int) Int -> (Char, Int) -> (Char, Int) -> Maybe ShowS
    forall a r.
    (Show a, Eq a) =>
    String -> T r a -> r -> r -> Maybe ShowS
    Show.field String
    "second" T (Char, Int) Int
    forall a b. T (a, b) b
    second]
          String
    "init" (Char, Int)
    init

    show0 :: String
    show0 :: String
    show0 = Int -> (Char, Int) -> ShowS
    showsPair Int
    11 (Char, Int)
    init String
    ""

    show1 :: String
    show1 :: String
    show1 = Int -> (Char, Int) -> ShowS
    showsPair Int
    5 (Char
    'd',Int
    8) String
    ""

    self :: Char
    self :: Char
    self = T Char Char
    forall r. T r r
    Accessor.self T Char Char -> (Char -> Char) -> Char -> Char
    forall r a. T r a -> (a -> a) -> r -> r
    ^: Char -> Char
    forall a. Enum a => a -> a
    succ (Char -> Char) -> Char -> Char
    forall a b. (a -> b) -> a -> b
    $ Char
    'a'

    null :: Char
    null :: Char
    null = T Char ()
    forall r. T r ()
    Accessor.null T Char () -> () -> Char -> Char
    forall r a. T r a -> a -> r -> r
    ^= () (Char -> Char) -> Char -> Char
    forall a b. (a -> b) -> a -> b
    $ Char
    'a'

    {- |
    Modify a value of the 'ord' function.
    -}
    result :: [Int]
    result :: [Int]
    result =
       let f :: Char -> Int
    f = (Char -> T (Char -> Int) Int
    forall a b. Eq a => a -> T (a -> b) b
    Accessor.result Char
    'a' T (Char -> Int) Int -> Int -> (Char -> Int) -> Char -> Int
    forall r a. T r a -> a -> r -> r
    ^= Int
    65) Char -> Int
    ord
       in  (Char -> Int) -> String -> [Int]
    forall a b. (a -> b) -> [a] -> [b]
    map Char -> Int
    f String
    "abcABC"

    {- |
    Modify a value of a curried function.
    -}
    result2 :: [Int]
    result2 :: [Int]
    result2 =
       let f :: Int -> Int -> Int
    f = (Int -> T (Int -> Int -> Int) (Int -> Int)
    forall a b. Eq a => a -> T (a -> b) b
    Accessor.result Int
    0 T (Int -> Int -> Int) (Int -> Int)
    -> ((Int -> Int) -> Int -> Int)
    -> (Int -> Int -> Int)
    -> Int
    -> Int
    -> Int
    forall r a. T r a -> (a -> a) -> r -> r
    ^: Int -> T (Int -> Int) Int
    forall a b. Eq a => a -> T (a -> b) b
    Accessor.result Int
    0 T (Int -> Int) Int -> Int -> (Int -> Int) -> Int -> Int
    forall r a. T r a -> a -> r -> r
    ^= Int
    1) Int -> Int -> Int
    forall a. Integral a => a -> a -> a
    div
       in  ((Int, Int) -> Int) -> [(Int, Int)] -> [Int]
    forall a b. (a -> b) -> [a] -> [b]
    map ((Int -> Int -> Int) -> (Int, Int) -> Int
    forall a b c. (a -> b -> c) -> (a, b) -> c
    uncurry Int -> Int -> Int
    f) [(Int
    4,Int
    2), (Int
    2,Int
    1), (Int
    0,Int
    0)]

    merge :: (Int, Char, Ordering)
    merge :: (Int, Char, Ordering)
    merge =
       T (Int, Char, Ordering) Int
    -> T (Int, Char, Ordering) Char
    -> T (Int, Char, Ordering) (Int, Char)
    forall a b c. T a b -> T a c -> T a (b, c)
    Accessor.merge T (Int, Char, Ordering) Int
    forall a b c. T (a, b, c) a
    first3 T (Int, Char, Ordering) Char
    forall a b c. T (a, b, c) b
    second3 T (Int, Char, Ordering) (Int, Char)
    -> (Int, Char) -> (Int, Char, Ordering) -> (Int, Char, Ordering)
    forall r a. T r a -> a -> r -> r
    ^= (Int
    42, Char
    'c') ((Int, Char, Ordering) -> (Int, Char, Ordering))
    -> (Int, Char, Ordering) -> (Int, Char, Ordering)
    forall a b. (a -> b) -> a -> b
    $
       (Int
    23, Char
    'a', Ordering
    GT)

    accessHourMinute :: Accessor.T (Int, Int, Int) Int
    accessHourMinute :: T (Int, Int, Int) Int
    accessHourMinute =
       T (Int, Int, Int) Int
    -> T (Int, Int, Int) Int -> T (Int, Int, Int) (Int, Int)
    forall a b c. T a b -> T a c -> T a (b, c)
    Accessor.merge T (Int, Int, Int) Int
    forall a b c. T (a, b, c) a
    first3 T (Int, Int, Int) Int
    forall a b c. T (a, b, c) b
    second3 T (Int, Int, Int) (Int, Int)
    -> T (Int, Int) Int -> T (Int, Int, Int) Int
    forall a b c. T a b -> T b c -> T a c
    .>
       (Int -> (Int, Int)) -> ((Int, Int) -> Int) -> T (Int, Int) Int
    forall b a. (b -> a) -> (a -> b) -> T a b
    Accessor.fromWrapper (\Int
    h -> Int -> Int -> (Int, Int)
    forall a. Integral a => a -> a -> (a, a)
    divMod Int
    h Int
    60) (\(Int
    h,Int
    m) -> Int
    hInt -> Int -> Int
    forall a. Num a => a -> a -> a
    *Int
    60Int -> Int -> Int
    forall a. Num a => a -> a -> a
    +Int
    m)

    mergeHourMinute :: (Int, Int, Int)
    mergeHourMinute :: (Int, Int, Int)
    mergeHourMinute =
       T (Int, Int, Int) Int
    accessHourMinute T (Int, Int, Int) Int
    -> (Int -> Int) -> (Int, Int, Int) -> (Int, Int, Int)
    forall r a. T r a -> (a -> a) -> r -> r
    ^: (Int
    15Int -> Int -> Int
    forall a. Num a => a -> a -> a
    +) ((Int, Int, Int) -> (Int, Int, Int))
    -> (Int, Int, Int) -> (Int, Int, Int)
    forall a b. (a -> b) -> a -> b
    $
       (Int
    12, Int
    58, Int
    13)

    array :: Array.Array Int Char
    array :: Array Int Char
    array =
       Int -> T (Array Int Char) Char
    forall i e. Ix i => i -> T (Array i e) e
    Container.array Int
    7 T (Array Int Char) Char
    -> (Char -> Char) -> Array Int Char -> Array Int Char
    forall r a. T r a -> (a -> a) -> r -> r
    ^: Char -> Char
    toUpper (Array Int Char -> Array Int Char)
    -> Array Int Char -> Array Int Char
    forall a b. (a -> b) -> a -> b
    $
       Int -> T (Array Int Char) Char
    forall i e. Ix i => i -> T (Array i e) e
    Container.array Int
    2 T (Array Int Char) Char -> Char -> Array Int Char -> Array Int Char
    forall r a. T r a -> a -> r -> r
    ^= Char
    'z' (Array Int Char -> Array Int Char)
    -> Array Int Char -> Array Int Char
    forall a b. (a -> b) -> a -> b
    $
       (Int, Int) -> String -> Array Int Char
    forall i e. Ix i => (i, i) -> [e] -> Array i e
    Array.listArray (Int
    0,Int
    9) [Char
    'a'..]

    set :: Set.Set Char
    set :: Set Char
    set =
       Char -> T (Set Char) Bool
    forall a. Ord a => a -> T (Set a) Bool
    Container.set Char
    'a' T (Set Char) Bool -> Bool -> Set Char -> Set Char
    forall r a. T r a -> a -> r -> r
    ^= Bool
    False (Set Char -> Set Char) -> Set Char -> Set Char
    forall a b. (a -> b) -> a -> b
    $
       Char -> T (Set Char) Bool
    forall a. Ord a => a -> T (Set a) Bool
    Container.set Char
    'd' T (Set Char) Bool -> (Bool -> Bool) -> Set Char -> Set Char
    forall r a. T r a -> (a -> a) -> r -> r
    ^: Bool -> Bool
    not (Set Char -> Set Char) -> Set Char -> Set Char
    forall a b. (a -> b) -> a -> b
    $
       Char -> T (Set Char) Bool
    forall a. Ord a => a -> T (Set a) Bool
    Container.set Char
    'b' T (Set Char) Bool -> Bool -> Set Char -> Set Char
    forall r a. T r a -> a -> r -> r
    ^= Bool
    True (Set Char -> Set Char) -> Set Char -> Set Char
    forall a b. (a -> b) -> a -> b
    $
       String -> Set Char
    forall a. Ord a => [a] -> Set a
    Set.fromList [Char
    'a',Char
    'c']

    mapDefault :: Map.Map Int Char
    mapDefault :: Map Int Char
    mapDefault =
       Char -> Int -> T (Map Int Char) Char
    forall key elem. Ord key => elem -> key -> T (Map key elem) elem
    Container.mapDefault Char
    ' ' Int
    1 T (Map Int Char) Char -> Char -> Map Int Char -> Map Int Char
    forall r a. T r a -> a -> r -> r
    ^= Char
    '-' (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Char -> Int -> T (Map Int Char) Char
    forall key elem. Ord key => elem -> key -> T (Map key elem) elem
    Container.mapDefault Char
    ' ' Int
    3 T (Map Int Char) Char -> Char -> Map Int Char -> Map Int Char
    forall r a. T r a -> a -> r -> r
    ^= Char
    'z' (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Char -> Int -> T (Map Int Char) Char
    forall key elem. Ord key => elem -> key -> T (Map key elem) elem
    Container.mapDefault Char
    ' ' Int
    5 T (Map Int Char) Char
    -> (Char -> Char) -> Map Int Char -> Map Int Char
    forall r a. T r a -> (a -> a) -> r -> r
    ^: Char -> Char
    toUpper (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Char -> Int -> T (Map Int Char) Char
    forall key elem. Ord key => elem -> key -> T (Map key elem) elem
    Container.mapDefault Char
    ' ' Int
    9 T (Map Int Char) Char
    -> (Char -> Char) -> Map Int Char -> Map Int Char
    forall r a. T r a -> (a -> a) -> r -> r
    ^: Char -> Char
    toUpper (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       [(Int, Char)] -> Map Int Char
    forall k a. Ord k => [(k, a)] -> Map k a
    Map.fromList ([(Int, Char)] -> Map Int Char) -> [(Int, Char)] -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $ [Int] -> String -> [(Int, Char)]
    forall a b. [a] -> [b] -> [(a, b)]
    zip ((Int -> Int) -> [Int] -> [Int]
    forall a b. (a -> b) -> [a] -> [b]
    map (Int -> Int -> Int
    forall a b. (Num a, Integral b) => a -> b -> a
    ^(Int
    2::Int)) [Int
    0..Int
    7]) [Char
    'a'..]

    mapMaybe :: Map.Map Int Char
    mapMaybe :: Map Int Char
    mapMaybe =
       Int -> T (Map Int Char) (Maybe Char)
    forall key elem. Ord key => key -> T (Map key elem) (Maybe elem)
    Container.mapMaybe Int
    1 T (Map Int Char) (Maybe Char)
    -> Maybe Char -> Map Int Char -> Map Int Char
    forall r a. T r a -> a -> r -> r
    ^= Char -> Maybe Char
    forall a. a -> Maybe a
    Just Char
    '-' (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Int -> T (Map Int Char) (Maybe Char)
    forall key elem. Ord key => key -> T (Map key elem) (Maybe elem)
    Container.mapMaybe Int
    2 T (Map Int Char) (Maybe Char)
    -> Maybe Char -> Map Int Char -> Map Int Char
    forall r a. T r a -> a -> r -> r
    ^= Maybe Char
    forall a. Maybe a
    Nothing (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Int -> T (Map Int Char) (Maybe Char)
    forall key elem. Ord key => key -> T (Map key elem) (Maybe elem)
    Container.mapMaybe Int
    3 T (Map Int Char) (Maybe Char)
    -> Maybe Char -> Map Int Char -> Map Int Char
    forall r a. T r a -> a -> r -> r
    ^= Char -> Maybe Char
    forall a. a -> Maybe a
    Just Char
    'z' (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Int -> T (Map Int Char) (Maybe Char)
    forall key elem. Ord key => key -> T (Map key elem) (Maybe elem)
    Container.mapMaybe Int
    4 T (Map Int Char) (Maybe Char)
    -> Maybe Char -> Map Int Char -> Map Int Char
    forall r a. T r a -> a -> r -> r
    ^= Maybe Char
    forall a. Maybe a
    Nothing (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Int -> T (Map Int Char) (Maybe Char)
    forall key elem. Ord key => key -> T (Map key elem) (Maybe elem)
    Container.mapMaybe Int
    5 T (Map Int Char) (Maybe Char)
    -> (Maybe Char -> Maybe Char) -> Map Int Char -> Map Int Char
    forall r a. T r a -> (a -> a) -> r -> r
    ^: (Char -> Char) -> Maybe Char -> Maybe Char
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Char -> Char
    toUpper (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       Int -> T (Map Int Char) (Maybe Char)
    forall key elem. Ord key => key -> T (Map key elem) (Maybe elem)
    Container.mapMaybe Int
    9 T (Map Int Char) (Maybe Char)
    -> (Maybe Char -> Maybe Char) -> Map Int Char -> Map Int Char
    forall r a. T r a -> (a -> a) -> r -> r
    ^: (Char -> Char) -> Maybe Char -> Maybe Char
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Char -> Char
    toUpper (Map Int Char -> Map Int Char) -> Map Int Char -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $
       [(Int, Char)] -> Map Int Char
    forall k a. Ord k => [(k, a)] -> Map k a
    Map.fromList ([(Int, Char)] -> Map Int Char) -> [(Int, Char)] -> Map Int Char
    forall a b. (a -> b) -> a -> b
    $ [Int] -> String -> [(Int, Char)]
    forall a b. [a] -> [b] -> [(a, b)]
    zip ((Int -> Int) -> [Int] -> [Int]
    forall a b. (a -> b) -> [a] -> [b]
    map (Int -> Int -> Int
    forall a b. (Num a, Integral b) => a -> b -> a
    ^(Int
    2::Int)) [Int
    0..Int
    7]) [Char
    'a'..]