{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE KindSignatures #-}
module Data.Map.Util where
import Data.Data (Data, Typeable)
import Data.Map (Map)
import Data.Monoid
import qualified Data.Map as M
#if !(MIN_VERSION_base(4,8,0))
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)
#endif
type Tag = Int
type Index = Int
nextLowerTag, nextHigherTag :: Map Tag a -> Tag
nextLowerTag :: forall a. Map Tag a -> Tag
nextLowerTag = forall b a. b -> (a -> b) -> Maybe a -> b
maybe Tag
0 forall a. Enum a => a -> a
pred forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Map Tag a -> Maybe Tag
minTag
nextHigherTag :: forall a. Map Tag a -> Tag
nextHigherTag = forall b a. b -> (a -> b) -> Maybe a -> b
maybe Tag
0 forall a. Enum a => a -> a
succ forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Map Tag a -> Maybe Tag
maxTag
minTag, maxTag :: Map Tag a -> Maybe Tag
minTag :: forall a. Map Tag a -> Maybe Tag
minTag Map Tag a
m = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) (forall k a. Map k a -> Maybe ((k, a), Map k a)
M.minViewWithKey Map Tag a
m)
maxTag :: forall a. Map Tag a -> Maybe Tag
maxTag Map Tag a
m = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a b. (a, b) -> a
fst forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) (forall k a. Map k a -> Maybe ((k, a), Map k a)
M.maxViewWithKey Map Tag a
m)
showsPrecList :: Show a => (b -> [a]) -> Int -> b -> ShowS
showsPrecList :: forall a b. Show a => (b -> [a]) -> Tag -> b -> ShowS
showsPrecList b -> [a]
toList Tag
d b
o = Bool -> ShowS -> ShowS
showParen (Tag
d forall a. Ord a => a -> a -> Bool
> Tag
10) forall a b. (a -> b) -> a -> b
$
String -> ShowS
showString String
"fromList " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows (b -> [a]
toList b
o)
readsPrecList :: Read a => ([a] -> b) -> Int -> ReadS b
readsPrecList :: forall a b. Read a => ([a] -> b) -> Tag -> ReadS b
readsPrecList [a] -> b
fromList Tag
d = forall a. Bool -> ReadS a -> ReadS a
readParen (Tag
d forall a. Ord a => a -> a -> Bool
> Tag
10) forall a b. (a -> b) -> a -> b
$ \String
r -> do
(String
"fromList", String
s) <- ReadS String
lex String
r
([a]
xs, String
t) <- forall a. Read a => ReadS a
reads String
s
forall (m :: * -> *) a. Monad m => a -> m a
return ([a] -> b
fromList [a]
xs, String
t)
newtype Bias (dir :: IndexPreference) a = Bias { forall (dir :: IndexPreference) a. Bias dir a -> a
unbiased :: a }
deriving (Bias dir a -> DataType
Bias dir a -> Constr
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. Tag -> (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 {dir :: IndexPreference} {a}.
(Typeable dir, Data a) =>
Typeable (Bias dir a)
forall (dir :: IndexPreference) a.
(Typeable dir, Data a) =>
Bias dir a -> DataType
forall (dir :: IndexPreference) a.
(Typeable dir, Data a) =>
Bias dir a -> Constr
forall (dir :: IndexPreference) a.
(Typeable dir, Data a) =>
(forall b. Data b => b -> b) -> Bias dir a -> Bias dir a
forall (dir :: IndexPreference) a u.
(Typeable dir, Data a) =>
Tag -> (forall d. Data d => d -> u) -> Bias dir a -> u
forall (dir :: IndexPreference) a u.
(Typeable dir, Data a) =>
(forall d. Data d => d -> u) -> Bias dir a -> [u]
forall (dir :: IndexPreference) a r r'.
(Typeable dir, Data a) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Bias dir a -> r
forall (dir :: IndexPreference) a r r'.
(Typeable dir, Data a) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Bias dir a -> r
forall (dir :: IndexPreference) a (m :: * -> *).
(Typeable dir, Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
forall (dir :: IndexPreference) a (m :: * -> *).
(Typeable dir, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
forall (dir :: IndexPreference) a (c :: * -> *).
(Typeable dir, Data a) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Bias dir a)
forall (dir :: IndexPreference) a (c :: * -> *).
(Typeable dir, Data a) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bias dir a -> c (Bias dir a)
forall (dir :: IndexPreference) a (t :: * -> *) (c :: * -> *).
(Typeable dir, Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Bias dir a))
forall (dir :: IndexPreference) a (t :: * -> * -> *) (c :: * -> *).
(Typeable dir, Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Bias dir a))
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Bias dir a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bias dir a -> c (Bias dir a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
$cgmapMo :: forall (dir :: IndexPreference) a (m :: * -> *).
(Typeable dir, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
$cgmapMp :: forall (dir :: IndexPreference) a (m :: * -> *).
(Typeable dir, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
$cgmapM :: forall (dir :: IndexPreference) a (m :: * -> *).
(Typeable dir, Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Bias dir a -> m (Bias dir a)
gmapQi :: forall u. Tag -> (forall d. Data d => d -> u) -> Bias dir a -> u
$cgmapQi :: forall (dir :: IndexPreference) a u.
(Typeable dir, Data a) =>
Tag -> (forall d. Data d => d -> u) -> Bias dir a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> Bias dir a -> [u]
$cgmapQ :: forall (dir :: IndexPreference) a u.
(Typeable dir, Data a) =>
(forall d. Data d => d -> u) -> Bias dir a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Bias dir a -> r
$cgmapQr :: forall (dir :: IndexPreference) a r r'.
(Typeable dir, Data a) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Bias dir a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Bias dir a -> r
$cgmapQl :: forall (dir :: IndexPreference) a r r'.
(Typeable dir, Data a) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Bias dir a -> r
gmapT :: (forall b. Data b => b -> b) -> Bias dir a -> Bias dir a
$cgmapT :: forall (dir :: IndexPreference) a.
(Typeable dir, Data a) =>
(forall b. Data b => b -> b) -> Bias dir a -> Bias dir a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Bias dir a))
$cdataCast2 :: forall (dir :: IndexPreference) a (t :: * -> * -> *) (c :: * -> *).
(Typeable dir, Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Bias dir a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Bias dir a))
$cdataCast1 :: forall (dir :: IndexPreference) a (t :: * -> *) (c :: * -> *).
(Typeable dir, Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Bias dir a))
dataTypeOf :: Bias dir a -> DataType
$cdataTypeOf :: forall (dir :: IndexPreference) a.
(Typeable dir, Data a) =>
Bias dir a -> DataType
toConstr :: Bias dir a -> Constr
$ctoConstr :: forall (dir :: IndexPreference) a.
(Typeable dir, Data a) =>
Bias dir a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Bias dir a)
$cgunfold :: forall (dir :: IndexPreference) a (c :: * -> *).
(Typeable dir, Data a) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Bias dir a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bias dir a -> c (Bias dir a)
$cgfoldl :: forall (dir :: IndexPreference) a (c :: * -> *).
(Typeable dir, Data a) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bias dir a -> c (Bias dir a)
Data, Bias dir a -> Bias dir a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (dir :: IndexPreference) a.
Eq a =>
Bias dir a -> Bias dir a -> Bool
/= :: Bias dir a -> Bias dir a -> Bool
$c/= :: forall (dir :: IndexPreference) a.
Eq a =>
Bias dir a -> Bias dir a -> Bool
== :: Bias dir a -> Bias dir a -> Bool
$c== :: forall (dir :: IndexPreference) a.
Eq a =>
Bias dir a -> Bias dir a -> Bool
Eq, forall a. Bias dir a -> Bool
forall m a. Monoid m => (a -> m) -> Bias dir a -> m
forall a b. (a -> b -> b) -> b -> Bias dir a -> b
forall (dir :: IndexPreference) a. Eq a => a -> Bias dir a -> Bool
forall (dir :: IndexPreference) a. Num a => Bias dir a -> a
forall (dir :: IndexPreference) a. Ord a => Bias dir a -> a
forall (dir :: IndexPreference) m. Monoid m => Bias dir m -> m
forall (dir :: IndexPreference) a. Bias dir a -> Bool
forall (dir :: IndexPreference) a. Bias dir a -> Tag
forall (dir :: IndexPreference) a. Bias dir a -> [a]
forall (dir :: IndexPreference) a. (a -> a -> a) -> Bias dir a -> a
forall (dir :: IndexPreference) m a.
Monoid m =>
(a -> m) -> Bias dir a -> m
forall (dir :: IndexPreference) b a.
(b -> a -> b) -> b -> Bias dir a -> b
forall (dir :: IndexPreference) a b.
(a -> b -> b) -> b -> Bias dir 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 -> Tag)
-> (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
product :: forall a. Num a => Bias dir a -> a
$cproduct :: forall (dir :: IndexPreference) a. Num a => Bias dir a -> a
sum :: forall a. Num a => Bias dir a -> a
$csum :: forall (dir :: IndexPreference) a. Num a => Bias dir a -> a
minimum :: forall a. Ord a => Bias dir a -> a
$cminimum :: forall (dir :: IndexPreference) a. Ord a => Bias dir a -> a
maximum :: forall a. Ord a => Bias dir a -> a
$cmaximum :: forall (dir :: IndexPreference) a. Ord a => Bias dir a -> a
elem :: forall a. Eq a => a -> Bias dir a -> Bool
$celem :: forall (dir :: IndexPreference) a. Eq a => a -> Bias dir a -> Bool
length :: forall a. Bias dir a -> Tag
$clength :: forall (dir :: IndexPreference) a. Bias dir a -> Tag
null :: forall a. Bias dir a -> Bool
$cnull :: forall (dir :: IndexPreference) a. Bias dir a -> Bool
toList :: forall a. Bias dir a -> [a]
$ctoList :: forall (dir :: IndexPreference) a. Bias dir a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Bias dir a -> a
$cfoldl1 :: forall (dir :: IndexPreference) a. (a -> a -> a) -> Bias dir a -> a
foldr1 :: forall a. (a -> a -> a) -> Bias dir a -> a
$cfoldr1 :: forall (dir :: IndexPreference) a. (a -> a -> a) -> Bias dir a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Bias dir a -> b
$cfoldl' :: forall (dir :: IndexPreference) b a.
(b -> a -> b) -> b -> Bias dir a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Bias dir a -> b
$cfoldl :: forall (dir :: IndexPreference) b a.
(b -> a -> b) -> b -> Bias dir a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Bias dir a -> b
$cfoldr' :: forall (dir :: IndexPreference) a b.
(a -> b -> b) -> b -> Bias dir a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Bias dir a -> b
$cfoldr :: forall (dir :: IndexPreference) a b.
(a -> b -> b) -> b -> Bias dir a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Bias dir a -> m
$cfoldMap' :: forall (dir :: IndexPreference) m a.
Monoid m =>
(a -> m) -> Bias dir a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Bias dir a -> m
$cfoldMap :: forall (dir :: IndexPreference) m a.
Monoid m =>
(a -> m) -> Bias dir a -> m
fold :: forall m. Monoid m => Bias dir m -> m
$cfold :: forall (dir :: IndexPreference) m. Monoid m => Bias dir m -> m
Foldable, forall a b. a -> Bias dir b -> Bias dir a
forall a b. (a -> b) -> Bias dir a -> Bias dir b
forall (dir :: IndexPreference) a b. a -> Bias dir b -> Bias dir a
forall (dir :: IndexPreference) a b.
(a -> b) -> Bias dir a -> Bias dir b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Bias dir b -> Bias dir a
$c<$ :: forall (dir :: IndexPreference) a b. a -> Bias dir b -> Bias dir a
fmap :: forall a b. (a -> b) -> Bias dir a -> Bias dir b
$cfmap :: forall (dir :: IndexPreference) a b.
(a -> b) -> Bias dir a -> Bias dir b
Functor, Bias dir a -> Bias dir a -> Bool
Bias dir a -> Bias dir a -> Ordering
Bias dir a -> Bias dir a -> Bias dir a
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 {dir :: IndexPreference} {a}. Ord a => Eq (Bias dir a)
forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bool
forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Ordering
forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bias dir a
min :: Bias dir a -> Bias dir a -> Bias dir a
$cmin :: forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bias dir a
max :: Bias dir a -> Bias dir a -> Bias dir a
$cmax :: forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bias dir a
>= :: Bias dir a -> Bias dir a -> Bool
$c>= :: forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bool
> :: Bias dir a -> Bias dir a -> Bool
$c> :: forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bool
<= :: Bias dir a -> Bias dir a -> Bool
$c<= :: forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bool
< :: Bias dir a -> Bias dir a -> Bool
$c< :: forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Bool
compare :: Bias dir a -> Bias dir a -> Ordering
$ccompare :: forall (dir :: IndexPreference) a.
Ord a =>
Bias dir a -> Bias dir a -> Ordering
Ord, ReadPrec [Bias dir a]
ReadPrec (Bias dir a)
ReadS [Bias dir a]
forall a.
(Tag -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall (dir :: IndexPreference) a. Read a => ReadPrec [Bias dir a]
forall (dir :: IndexPreference) a. Read a => ReadPrec (Bias dir a)
forall (dir :: IndexPreference) a.
Read a =>
Tag -> ReadS (Bias dir a)
forall (dir :: IndexPreference) a. Read a => ReadS [Bias dir a]
readListPrec :: ReadPrec [Bias dir a]
$creadListPrec :: forall (dir :: IndexPreference) a. Read a => ReadPrec [Bias dir a]
readPrec :: ReadPrec (Bias dir a)
$creadPrec :: forall (dir :: IndexPreference) a. Read a => ReadPrec (Bias dir a)
readList :: ReadS [Bias dir a]
$creadList :: forall (dir :: IndexPreference) a. Read a => ReadS [Bias dir a]
readsPrec :: Tag -> ReadS (Bias dir a)
$creadsPrec :: forall (dir :: IndexPreference) a.
Read a =>
Tag -> ReadS (Bias dir a)
Read, Tag -> Bias dir a -> ShowS
forall a.
(Tag -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (dir :: IndexPreference) a.
Show a =>
Tag -> Bias dir a -> ShowS
forall (dir :: IndexPreference) a. Show a => [Bias dir a] -> ShowS
forall (dir :: IndexPreference) a. Show a => Bias dir a -> String
showList :: [Bias dir a] -> ShowS
$cshowList :: forall (dir :: IndexPreference) a. Show a => [Bias dir a] -> ShowS
show :: Bias dir a -> String
$cshow :: forall (dir :: IndexPreference) a. Show a => Bias dir a -> String
showsPrec :: Tag -> Bias dir a -> ShowS
$cshowsPrec :: forall (dir :: IndexPreference) a.
Show a =>
Tag -> Bias dir a -> ShowS
Show, forall (dir :: IndexPreference). Functor (Bias dir)
forall (dir :: IndexPreference). Foldable (Bias dir)
forall (dir :: IndexPreference) (m :: * -> *) a.
Monad m =>
Bias dir (m a) -> m (Bias dir a)
forall (dir :: IndexPreference) (f :: * -> *) a.
Applicative f =>
Bias dir (f a) -> f (Bias dir a)
forall (dir :: IndexPreference) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Bias dir a -> m (Bias dir b)
forall (dir :: IndexPreference) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Bias dir a -> f (Bias dir 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 (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Bias dir a -> f (Bias dir b)
sequence :: forall (m :: * -> *) a. Monad m => Bias dir (m a) -> m (Bias dir a)
$csequence :: forall (dir :: IndexPreference) (m :: * -> *) a.
Monad m =>
Bias dir (m a) -> m (Bias dir a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Bias dir a -> m (Bias dir b)
$cmapM :: forall (dir :: IndexPreference) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Bias dir a -> m (Bias dir b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Bias dir (f a) -> f (Bias dir a)
$csequenceA :: forall (dir :: IndexPreference) (f :: * -> *) a.
Applicative f =>
Bias dir (f a) -> f (Bias dir a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Bias dir a -> f (Bias dir b)
$ctraverse :: forall (dir :: IndexPreference) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Bias dir a -> f (Bias dir b)
Traversable, Typeable)
data IndexPreference = L | R
deriving Typeable
type L = 'L
type R = 'R