-- |
-- Module      : Amazonka.Core
-- Copyright   : (c) 2013-2021 Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : provisional
-- Portability : non-portable (GHC extensions)
--
-- Types and values referenced by generated code.
module Amazonka.Core
  ( module Amazonka.Types,
    module Amazonka.Endpoint,
    module Amazonka.Data,
    module Amazonka.Pager,
    module Amazonka.Waiter,
    module Amazonka.Error,
    (.!@),
    may,
  )
where

import Amazonka.Data
import Amazonka.Endpoint
import Amazonka.Error
import Amazonka.Pager
import Amazonka.Prelude
import Amazonka.Types
import Amazonka.Waiter

-- Legacy code generation operators

infixl 7 .!@

(.!@) :: Functor f => f (Maybe a) -> a -> f a
f (Maybe a)
f .!@ :: f (Maybe a) -> a -> f a
.!@ a
x = a -> Maybe a -> a
forall a. a -> Maybe a -> a
fromMaybe a
x (Maybe a -> a) -> f (Maybe a) -> f a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f (Maybe a)
f

may :: Applicative f => ([a] -> f b) -> [a] -> f (Maybe b)
may :: ([a] -> f b) -> [a] -> f (Maybe b)
may [a] -> f b
_ [] = Maybe b -> f (Maybe b)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe b
forall a. Maybe a
Nothing
may [a] -> f b
f [a]
xs = b -> Maybe b
forall a. a -> Maybe a
Just (b -> Maybe b) -> f b -> f (Maybe b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [a] -> f b
f [a]
xs