    {-# LANGUAGE CPP #-}
    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveFoldable #-}
    {-# LANGUAGE DeriveFunctor #-}
    {-# LANGUAGE DeriveTraversable #-}
    {-# LANGUAGE FlexibleInstances #-}
    {-# LANGUAGE GeneralizedNewtypeDeriving #-}
    {-# LANGUAGE ScopedTypeVariables #-}
    {-# LANGUAGE StandaloneDeriving #-}
    {-# LANGUAGE TypeApplications #-}
    {-# OPTIONS_GHC -Wno-orphans #-}

    -----------------------------------------------------------------------------
    -- |
    -- Module      :  Language.Haskell.TH.Desugar.OMap
    -- Copyright   :  (C) 2016-2018 Daniel Wagner, 2019 Ryan Scott
    -- License     :  BSD-style (see LICENSE)
    -- Maintainer  :  Ryan Scott
    -- Stability   :  experimental
    -- Portability :  non-portable
    --
    -- An 'OMap' behaves much like a 'M.Map', with all the same asymptotics, but
    -- also remembers the order that keys were inserted.
    --
    -- This module offers a simplified version of the "Data.Map.Ordered" API
    -- that assumes left-biased indices everywhere and uses a different 'Semigroup'
    -- instance (the one in this module uses @('<>') = 'union'@) and 'Monoid'
    -- instance (the one in this module uses @'mappend' = 'union'@).
    --
    ----------------------------------------------------------------------------
    module Language.Haskell.TH.Desugar.OMap
        ( OMap(..)
        -- * Trivial maps
        , empty, singleton
        -- * Insertion
        , insertPre, insertPost, union, unionWithKey
        -- * Deletion
        , delete, filterWithKey, (\\), intersection, intersectionWithKey
        -- * Query
        , null, size, member, notMember, lookup
        -- * Indexing
        , Index, lookupIndex, lookupAt
        -- * List conversions
        , fromList, assocs, toAscList
        -- * 'M.Map' conversion
        , toMap
        ) where

    import Data.Coerce
    import Data.Data
    import qualified Data.Map.Lazy as M (Map)
    import Data.Map.Ordered (Bias(..), Index, L)
    import qualified Data.Map.Ordered as OM
    import Prelude hiding (filter, lookup, null)

    #if !(MIN_VERSION_base(4,11,0))
    import Data.Semigroup (Semigroup(..))
    #endif

    -- | An ordered map whose 'insertPre', 'insertPost', 'intersection',
    -- 'intersectionWithKey', 'union', and 'unionWithKey' operations are biased
    -- towards leftmost indices when when breaking ties between keys.
    newtype OMap k v = OMap (Bias L (OM.OMap k v))
      deriving (Typeable (OMap k v)
    Typeable (OMap k v)
    -> (forall (c :: * -> *).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> OMap k v -> c (OMap k v))
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c (OMap k v))
    -> (OMap k v -> Constr)
    -> (OMap k v -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c (OMap k v)))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c (OMap k v)))
    -> ((forall b. Data b => b -> b) -> OMap k v -> OMap k v)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> OMap k v -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> OMap k v -> r)
    -> (forall u. (forall d. Data d => d -> u) -> OMap k v -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> OMap k v -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v))
    -> Data (OMap k v)
    OMap k v -> Constr
    OMap k v -> DataType
    (forall b. Data b => b -> b) -> OMap k v -> OMap k v
    forall a.
    Typeable a
    -> (forall (c :: * -> *).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> OMap k v -> u
    forall u. (forall d. Data d => d -> u) -> OMap k v -> [u]
    forall {k} {v}. (Data k, Data v, Ord k) => Typeable (OMap k v)
    forall k v. (Data k, Data v, Ord k) => OMap k v -> Constr
    forall k v. (Data k, Data v, Ord k) => OMap k v -> DataType
    forall k v.
    (Data k, Data v, Ord k) =>
    (forall b. Data b => b -> b) -> OMap k v -> OMap k v
    forall k v u.
    (Data k, Data v, Ord k) =>
    Int -> (forall d. Data d => d -> u) -> OMap k v -> u
    forall k v u.
    (Data k, Data v, Ord k) =>
    (forall d. Data d => d -> u) -> OMap k v -> [u]
    forall k v r r'.
    (Data k, Data v, Ord k) =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    forall k v r r'.
    (Data k, Data v, Ord k) =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    forall k v (m :: * -> *).
    (Data k, Data v, Ord k, Monad m) =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    forall k v (m :: * -> *).
    (Data k, Data v, Ord k, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    forall k v (c :: * -> *).
    (Data k, Data v, Ord k) =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (OMap k v)
    forall k v (c :: * -> *).
    (Data k, Data v, Ord k) =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> OMap k v -> c (OMap k v)
    forall k v (t :: * -> *) (c :: * -> *).
    (Data k, Data v, Ord k, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (OMap k v))
    forall k v (t :: * -> * -> *) (c :: * -> *).
    (Data k, Data v, Ord k, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OMap k v))
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (OMap k v)
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> OMap k v -> c (OMap k v)
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (OMap k v))
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OMap k v))
    $cgfoldl :: forall k v (c :: * -> *).
    (Data k, Data v, Ord k) =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> OMap k v -> c (OMap k v)
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> OMap k v -> c (OMap k v)
    $cgunfold :: forall k v (c :: * -> *).
    (Data k, Data v, Ord k) =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (OMap k v)
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (OMap k v)
    $ctoConstr :: forall k v. (Data k, Data v, Ord k) => OMap k v -> Constr
    toConstr :: OMap k v -> Constr
    $cdataTypeOf :: forall k v. (Data k, Data v, Ord k) => OMap k v -> DataType
    dataTypeOf :: OMap k v -> DataType
    $cdataCast1 :: forall k v (t :: * -> *) (c :: * -> *).
    (Data k, Data v, Ord k, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (OMap k v))
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (OMap k v))
    $cdataCast2 :: forall k v (t :: * -> * -> *) (c :: * -> *).
    (Data k, Data v, Ord k, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OMap k v))
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OMap k v))
    $cgmapT :: forall k v.
    (Data k, Data v, Ord k) =>
    (forall b. Data b => b -> b) -> OMap k v -> OMap k v
    gmapT :: (forall b. Data b => b -> b) -> OMap k v -> OMap k v
    $cgmapQl :: forall k v r r'.
    (Data k, Data v, Ord k) =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    $cgmapQr :: forall k v r r'.
    (Data k, Data v, Ord k) =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OMap k v -> r
    $cgmapQ :: forall k v u.
    (Data k, Data v, Ord k) =>
    (forall d. Data d => d -> u) -> OMap k v -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> OMap k v -> [u]
    $cgmapQi :: forall k v u.
    (Data k, Data v, Ord k) =>
    Int -> (forall d. Data d => d -> u) -> OMap k v -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> OMap k v -> u
    $cgmapM :: forall k v (m :: * -> *).
    (Data k, Data v, Ord k, Monad m) =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    $cgmapMp :: forall k v (m :: * -> *).
    (Data k, Data v, Ord k, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    $cgmapMo :: forall k v (m :: * -> *).
    (Data k, Data v, Ord k, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OMap k v -> m (OMap k v)
    Data, (forall m. Monoid m => OMap k m -> m)
    -> (forall m a. Monoid m => (a -> m) -> OMap k a -> m)
    -> (forall m a. Monoid m => (a -> m) -> OMap k a -> m)
    -> (forall a b. (a -> b -> b) -> b -> OMap k a -> b)
    -> (forall a b. (a -> b -> b) -> b -> OMap k a -> b)
    -> (forall b a. (b -> a -> b) -> b -> OMap k a -> b)
    -> (forall b a. (b -> a -> b) -> b -> OMap k a -> b)
    -> (forall a. (a -> a -> a) -> OMap k a -> a)
    -> (forall a. (a -> a -> a) -> OMap k a -> a)
    -> (forall a. OMap k a -> [a])
    -> (forall a. OMap k a -> Bool)
    -> (forall a. OMap k a -> Int)
    -> (forall a. Eq a => a -> OMap k a -> Bool)
    -> (forall a. Ord a => OMap k a -> a)
    -> (forall a. Ord a => OMap k a -> a)
    -> (forall a. Num a => OMap k a -> a)
    -> (forall a. Num a => OMap k a -> a)
    -> Foldable (OMap k)
    forall a. Eq a => a -> OMap k a -> Bool
    forall a. Num a => OMap k a -> a
    forall a. Ord a => OMap k a -> a
    forall m. Monoid m => OMap k m -> m
    forall a. OMap k a -> Bool
    forall a. OMap k a -> Int
    forall a. OMap k a -> [a]
    forall a. (a -> a -> a) -> OMap k a -> a
    forall k a. Eq a => a -> OMap k a -> Bool
    forall k a. Num a => OMap k a -> a
    forall k a. Ord a => OMap k a -> a
    forall m a. Monoid m => (a -> m) -> OMap k a -> m
    forall k m. Monoid m => OMap k m -> m
    forall k a. OMap k a -> Bool
    forall k a. OMap k a -> Int
    forall k a. OMap k a -> [a]
    forall b a. (b -> a -> b) -> b -> OMap k a -> b
    forall a b. (a -> b -> b) -> b -> OMap k a -> b
    forall k a. (a -> a -> a) -> OMap k a -> a
    forall k m a. Monoid m => (a -> m) -> OMap k a -> m
    forall k b a. (b -> a -> b) -> b -> OMap k a -> b
    forall k a b. (a -> b -> b) -> b -> OMap k a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall k m. Monoid m => OMap k m -> m
    fold :: forall m. Monoid m => OMap k m -> m
    $cfoldMap :: forall k m a. Monoid m => (a -> m) -> OMap k a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> OMap k a -> m
    $cfoldMap' :: forall k m a. Monoid m => (a -> m) -> OMap k a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> OMap k a -> m
    $cfoldr :: forall k a b. (a -> b -> b) -> b -> OMap k a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> OMap k a -> b
    $cfoldr' :: forall k a b. (a -> b -> b) -> b -> OMap k a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> OMap k a -> b
    $cfoldl :: forall k b a. (b -> a -> b) -> b -> OMap k a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> OMap k a -> b
    $cfoldl' :: forall k b a. (b -> a -> b) -> b -> OMap k a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> OMap k a -> b
    $cfoldr1 :: forall k a. (a -> a -> a) -> OMap k a -> a
    foldr1 :: forall a. (a -> a -> a) -> OMap k a -> a
    $cfoldl1 :: forall k a. (a -> a -> a) -> OMap k a -> a
    foldl1 :: forall a. (a -> a -> a) -> OMap k a -> a
    $ctoList :: forall k a. OMap k a -> [a]
    toList :: forall a. OMap k a -> [a]
    $cnull :: forall k a. OMap k a -> Bool
    null :: forall a. OMap k a -> Bool
    $clength :: forall k a. OMap k a -> Int
    length :: forall a. OMap k a -> Int
    $celem :: forall k a. Eq a => a -> OMap k a -> Bool
    elem :: forall a. Eq a => a -> OMap k a -> Bool
    $cmaximum :: forall k a. Ord a => OMap k a -> a
    maximum :: forall a. Ord a => OMap k a -> a
    $cminimum :: forall k a. Ord a => OMap k a -> a
    minimum :: forall a. Ord a => OMap k a -> a
    $csum :: forall k a. Num a => OMap k a -> a
    sum :: forall a. Num a => OMap k a -> a
    $cproduct :: forall k a. Num a => OMap k a -> a
    product :: forall a. Num a => OMap k a -> a
    Foldable, (forall a b. (a -> b) -> OMap k a -> OMap k b)
    -> (forall a b. a -> OMap k b -> OMap k a) -> Functor (OMap k)
    forall a b. a -> OMap k b -> OMap k a
    forall a b. (a -> b) -> OMap k a -> OMap k b
    forall k a b. a -> OMap k b -> OMap k a
    forall k a b. (a -> b) -> OMap k a -> OMap k b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall k a b. (a -> b) -> OMap k a -> OMap k b
    fmap :: forall a b. (a -> b) -> OMap k a -> OMap k b
    $c<$ :: forall k a b. a -> OMap k b -> OMap k a
    <$ :: forall a b. a -> OMap k b -> OMap k a
    Functor, OMap k v -> OMap k v -> Bool
    (OMap k v -> OMap k v -> Bool)
    -> (OMap k v -> OMap k v -> Bool) -> Eq (OMap k v)
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    forall k v. (Eq k, Eq v) => OMap k v -> OMap k v -> Bool
    $c== :: forall k v. (Eq k, Eq v) => OMap k v -> OMap k v -> Bool
    == :: OMap k v -> OMap k v -> Bool
    $c/= :: forall k v. (Eq k, Eq v) => OMap k v -> OMap k v -> Bool
    /= :: OMap k v -> OMap k v -> Bool
    Eq, Eq (OMap k v)
    Eq (OMap k v)
    -> (OMap k v -> OMap k v -> Ordering)
    -> (OMap k v -> OMap k v -> Bool)
    -> (OMap k v -> OMap k v -> Bool)
    -> (OMap k v -> OMap k v -> Bool)
    -> (OMap k v -> OMap k v -> Bool)
    -> (OMap k v -> OMap k v -> OMap k v)
    -> (OMap k v -> OMap k v -> OMap k v)
    -> Ord (OMap k v)
    OMap k v -> OMap k v -> Bool
    OMap k v -> OMap k v -> Ordering
    OMap k v -> OMap k v -> OMap k v
    forall a.
    Eq a
    -> (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall {k} {v}. (Ord k, Ord v) => Eq (OMap k v)
    forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> Bool
    forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> Ordering
    forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> OMap k v
    $ccompare :: forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> Ordering
    compare :: OMap k v -> OMap k v -> Ordering
    $c< :: forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> Bool
    < :: OMap k v -> OMap k v -> Bool
    $c<= :: forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> Bool
    <= :: OMap k v -> OMap k v -> Bool
    $c> :: forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> Bool
    > :: OMap k v -> OMap k v -> Bool
    $c>= :: forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> Bool
    >= :: OMap k v -> OMap k v -> Bool
    $cmax :: forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> OMap k v
    max :: OMap k v -> OMap k v -> OMap k v
    $cmin :: forall k v. (Ord k, Ord v) => OMap k v -> OMap k v -> OMap k v
    min :: OMap k v -> OMap k v -> OMap k v
    Ord, ReadPrec [OMap k v]
    ReadPrec (OMap k v)
    Int -> ReadS (OMap k v)
    ReadS [OMap k v]
    (Int -> ReadS (OMap k v))
    -> ReadS [OMap k v]
    -> ReadPrec (OMap k v)
    -> ReadPrec [OMap k v]
    -> Read (OMap k v)
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    forall k v. (Ord k, Read k, Read v) => ReadPrec [OMap k v]
    forall k v. (Ord k, Read k, Read v) => ReadPrec (OMap k v)
    forall k v. (Ord k, Read k, Read v) => Int -> ReadS (OMap k v)
    forall k v. (Ord k, Read k, Read v) => ReadS [OMap k v]
    $creadsPrec :: forall k v. (Ord k, Read k, Read v) => Int -> ReadS (OMap k v)
    readsPrec :: Int -> ReadS (OMap k v)
    $creadList :: forall k v. (Ord k, Read k, Read v) => ReadS [OMap k v]
    readList :: ReadS [OMap k v]
    $creadPrec :: forall k v. (Ord k, Read k, Read v) => ReadPrec (OMap k v)
    readPrec :: ReadPrec (OMap k v)
    $creadListPrec :: forall k v. (Ord k, Read k, Read v) => ReadPrec [OMap k v]
    readListPrec :: ReadPrec [OMap k v]
    Read, Int -> OMap k v -> ShowS
    [OMap k v] -> ShowS
    OMap k v -> String
    (Int -> OMap k v -> ShowS)
    -> (OMap k v -> String) -> ([OMap k v] -> ShowS) -> Show (OMap k v)
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    forall k v. (Show k, Show v) => Int -> OMap k v -> ShowS
    forall k v. (Show k, Show v) => [OMap k v] -> ShowS
    forall k v. (Show k, Show v) => OMap k v -> String
    $cshowsPrec :: forall k v. (Show k, Show v) => Int -> OMap k v -> ShowS
    showsPrec :: Int -> OMap k v -> ShowS
    $cshow :: forall k v. (Show k, Show v) => OMap k v -> String
    show :: OMap k v -> String
    $cshowList :: forall k v. (Show k, Show v) => [OMap k v] -> ShowS
    showList :: [OMap k v] -> ShowS
    Show, Functor (OMap k)
    Foldable (OMap k)
    Functor (OMap k)
    -> Foldable (OMap k)
    -> (forall (f :: * -> *) a b.
        Applicative f =>
        (a -> f b) -> OMap k a -> f (OMap k b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        OMap k (f a) -> f (OMap k a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> OMap k a -> m (OMap k b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        OMap k (m a) -> m (OMap k a))
    -> Traversable (OMap k)
    forall {k}. Ord k => Functor (OMap k)
    forall {k}. Ord k => Foldable (OMap k)
    forall k (m :: * -> *) a.
    (Ord k, Monad m) =>
    OMap k (m a) -> m (OMap k a)
    forall k (f :: * -> *) a.
    (Ord k, Applicative f) =>
    OMap k (f a) -> f (OMap k a)
    forall k (m :: * -> *) a b.
    (Ord k, Monad m) =>
    (a -> m b) -> OMap k a -> m (OMap k b)
    forall k (f :: * -> *) a b.
    (Ord k, Applicative f) =>
    (a -> f b) -> OMap k a -> f (OMap k b)
    forall (t :: * -> *).
    Functor t
    -> Foldable t
    -> (forall (f :: * -> *) a b.
        Applicative f =>
        (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a. Monad m => OMap k (m a) -> m (OMap k a)
    forall (f :: * -> *) a.
    Applicative f =>
    OMap k (f a) -> f (OMap k a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> OMap k a -> m (OMap k b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> OMap k a -> f (OMap k b)
    $ctraverse :: forall k (f :: * -> *) a b.
    (Ord k, Applicative f) =>
    (a -> f b) -> OMap k a -> f (OMap k b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> OMap k a -> f (OMap k b)
    $csequenceA :: forall k (f :: * -> *) a.
    (Ord k, Applicative f) =>
    OMap k (f a) -> f (OMap k a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    OMap k (f a) -> f (OMap k a)
    $cmapM :: forall k (m :: * -> *) a b.
    (Ord k, Monad m) =>
    (a -> m b) -> OMap k a -> m (OMap k b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> OMap k a -> m (OMap k b)
    $csequence :: forall k (m :: * -> *) a.
    (Ord k, Monad m) =>
    OMap k (m a) -> m (OMap k a)
    sequence :: forall (m :: * -> *) a. Monad m => OMap k (m a) -> m (OMap k a)
    Traversable)

    instance Ord k => Semigroup (OMap k v) where
      <> :: OMap k v -> OMap k v -> OMap k v
    (<>) = OMap k v -> OMap k v -> OMap k v
    forall k v. Ord k => OMap k v -> OMap k v -> OMap k v
    union
    instance Ord k => Monoid (OMap k v) where
      mempty :: OMap k v
    mempty = OMap k v
    forall k v. OMap k v
    empty
    #if !(MIN_VERSION_base(4,11,0))
      mappend = (<>)
    #endif

    empty :: forall k v. OMap k v
    empty :: forall k v. OMap k v
    empty = OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce (forall k v. OMap k v
    OM.empty @k @v)

    singleton :: k -> v -> OMap k v
    singleton :: forall k v. k -> v -> OMap k v
    singleton k
    k v
    v = OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce ((k, v) -> OMap k v
    forall k v. (k, v) -> OMap k v
    OM.singleton (k
    k, v
    v))

    -- | The value's index will be lower than the indices of the values in the
    -- 'OSet'.
    insertPre :: Ord k => k -> v -> OMap k v -> OMap k v
    insertPre :: forall k v. Ord k => k -> v -> OMap k v -> OMap k v
    insertPre k
    k v
    v = (OMap k v -> OMap k v) -> OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce ((k
    k, v
    v) (k, v) -> OMap k v -> OMap k v
    forall k v. Ord k => (k, v) -> OMap k v -> OMap k v
    OM.|<)

    -- | The value's index will be higher than the indices of the values in the
    -- 'OSet'.
    insertPost :: Ord k => OMap k v -> k -> v -> OMap k v
    insertPost :: forall k v. Ord k => OMap k v -> k -> v -> OMap k v
    insertPost OMap k v
    m k
    k v
    v = OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce (OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce OMap k v
    m OMap k v -> (k, v) -> OMap k v
    forall k v. Ord k => OMap k v -> (k, v) -> OMap k v
    OM.|> (k
    k, v
    v))

    union :: forall k v. Ord k => OMap k v -> OMap k v -> OMap k v
    union :: forall k v. Ord k => OMap k v -> OMap k v -> OMap k v
    union = (OMap k v -> OMap k v -> OMap k v)
    -> OMap k v -> OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce (forall k v. Ord k => OMap k v -> OMap k v -> OMap k v
    (OM.|<>) @k @v)

    unionWithKey :: Ord k => (k -> v -> v -> v) -> OMap k v -> OMap k v -> OMap k v
    unionWithKey :: forall k v.
    Ord k =>
    (k -> v -> v -> v) -> OMap k v -> OMap k v -> OMap k v
    unionWithKey k -> v -> v -> v
    f = (OMap k v -> OMap k v -> OMap k v)
    -> OMap k v -> OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce ((k -> v -> v -> v) -> OMap k v -> OMap k v -> OMap k v
    forall k v.
    Ord k =>
    (k -> v -> v -> v) -> OMap k v -> OMap k v -> OMap k v
    OM.unionWithL k -> v -> v -> v
    f)

    delete :: forall k v. Ord k => k -> OMap k v -> OMap k v
    delete :: forall k v. Ord k => k -> OMap k v -> OMap k v
    delete = (k -> OMap k v -> OMap k v) -> k -> OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce (forall k v. Ord k => k -> OMap k v -> OMap k v
    OM.delete @k @v)

    filterWithKey :: Ord k => (k -> v -> Bool) -> OMap k v -> OMap k v
    filterWithKey :: forall k v. Ord k => (k -> v -> Bool) -> OMap k v -> OMap k v
    filterWithKey k -> v -> Bool
    f = (OMap k v -> OMap k v) -> OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce ((k -> v -> Bool) -> OMap k v -> OMap k v
    forall k v. Ord k => (k -> v -> Bool) -> OMap k v -> OMap k v
    OM.filter k -> v -> Bool
    f)

    (\\) :: forall k v v'. Ord k => OMap k v -> OMap k v' -> OMap k v
    \\ :: forall k v v'. Ord k => OMap k v -> OMap k v' -> OMap k v
    (\\) = (OMap k v -> OMap k v' -> OMap k v)
    -> OMap k v -> OMap k v' -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce (forall k v v'. Ord k => OMap k v -> OMap k v' -> OMap k v
    (OM.\\) @k @v @v')

    intersection :: forall k v v'. Ord k => OMap k v -> OMap k v' -> OMap k v
    intersection :: forall k v v'. Ord k => OMap k v -> OMap k v' -> OMap k v
    intersection = (OMap k v -> OMap k v' -> OMap k v)
    -> OMap k v -> OMap k v' -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce (forall k v v'. Ord k => OMap k v -> OMap k v' -> OMap k v
    (OM.|/\) @k @v @v')

    intersectionWithKey :: Ord k => (k -> v -> v' -> v'') -> OMap k v -> OMap k v' -> OMap k v''
    intersectionWithKey :: forall k v v' v''.
    Ord k =>
    (k -> v -> v' -> v'') -> OMap k v -> OMap k v' -> OMap k v''
    intersectionWithKey k -> v -> v' -> v''
    f = (OMap k v -> OMap k v' -> OMap k v'')
    -> OMap k v -> OMap k v' -> OMap k v''
    forall a b. Coercible a b => a -> b
    coerce ((k -> v -> v' -> v'') -> OMap k v -> OMap k v' -> OMap k v''
    forall k v v' v''.
    Ord k =>
    (k -> v -> v' -> v'') -> OMap k v -> OMap k v' -> OMap k v''
    OM.intersectionWith k -> v -> v' -> v''
    f)

    null :: forall k v. OMap k v -> Bool
    null :: forall k a. OMap k a -> Bool
    null = (OMap k v -> Bool) -> OMap k v -> Bool
    forall a b. Coercible a b => a -> b
    coerce (forall k v. OMap k v -> Bool
    OM.null @k @v)

    size :: forall k v. OMap k v -> Int
    size :: forall k a. OMap k a -> Int
    size = (OMap k v -> Int) -> OMap k v -> Int
    forall a b. Coercible a b => a -> b
    coerce (forall k v. OMap k v -> Int
    OM.size @k @v)

    member :: forall k v. Ord k => k -> OMap k v -> Bool
    member :: forall k v. Ord k => k -> OMap k v -> Bool
    member = (k -> OMap k v -> Bool) -> k -> OMap k v -> Bool
    forall a b. Coercible a b => a -> b
    coerce (forall k v. Ord k => k -> OMap k v -> Bool
    OM.member @k @v)

    notMember :: forall k v. Ord k => k -> OMap k v -> Bool
    notMember :: forall k v. Ord k => k -> OMap k v -> Bool
    notMember = (k -> OMap k v -> Bool) -> k -> OMap k v -> Bool
    forall a b. Coercible a b => a -> b
    coerce (forall k v. Ord k => k -> OMap k v -> Bool
    OM.notMember @k @v)

    lookup :: forall k v. Ord k => k -> OMap k v -> Maybe v
    lookup :: forall k v. Ord k => k -> OMap k v -> Maybe v
    lookup = (k -> OMap k v -> Maybe v) -> k -> OMap k v -> Maybe v
    forall a b. Coercible a b => a -> b
    coerce (forall k v. Ord k => k -> OMap k v -> Maybe v
    OM.lookup @k @v)

    lookupIndex :: forall k v. Ord k => k -> OMap k v -> Maybe Index
    lookupIndex :: forall k v. Ord k => k -> OMap k v -> Maybe Int
    lookupIndex = (k -> OMap k v -> Maybe Int) -> k -> OMap k v -> Maybe Int
    forall a b. Coercible a b => a -> b
    coerce (forall k v. Ord k => k -> OMap k v -> Maybe Int
    OM.findIndex @k @v)

    lookupAt :: forall k v. Index -> OMap k v -> Maybe (k, v)
    lookupAt :: forall k v. Int -> OMap k v -> Maybe (k, v)
    lookupAt Int
    i OMap k v
    m = forall k v. OMap k v -> Int -> Maybe (k, v)
    OM.elemAt @k @v (OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce OMap k v
    m) Int
    i

    fromList :: Ord k => [(k, v)] -> OMap k v
    fromList :: forall k v. Ord k => [(k, v)] -> OMap k v
    fromList [(k, v)]
    l = OMap k v -> OMap k v
    forall a b. Coercible a b => a -> b
    coerce ([(k, v)] -> OMap k v
    forall k v. Ord k => [(k, v)] -> OMap k v
    OM.fromList [(k, v)]
    l)

    assocs :: forall k v. OMap k v -> [(k, v)]
    assocs :: forall k v. OMap k v -> [(k, v)]
    assocs = (OMap k v -> [(k, v)]) -> OMap k v -> [(k, v)]
    forall a b. Coercible a b => a -> b
    coerce (forall k v. OMap k v -> [(k, v)]
    OM.assocs @k @v)

    toAscList :: forall k v. OMap k v -> [(k, v)]
    toAscList :: forall k v. OMap k v -> [(k, v)]
    toAscList = (OMap k v -> [(k, v)]) -> OMap k v -> [(k, v)]
    forall a b. Coercible a b => a -> b
    coerce (forall k v. OMap k v -> [(k, v)]
    OM.toAscList @k @v)

    toMap :: forall k v. OMap k v -> M.Map k v
    toMap :: forall k v. OMap k v -> Map k v
    toMap = (OMap k v -> Map k v) -> OMap k v -> Map k v
    forall a b. Coercible a b => a -> b
    coerce (forall k v. OMap k v -> Map k v
    OM.toMap @k @v)