hgeometry-0.6.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.Seq

Synopsis

Documentation

data LSeq n a Source #

LSeq n a certifies that the sequence has *at least* n items

Instances

Functor (LSeq n) Source # 

Methods

fmap :: (a -> b) -> LSeq n a -> LSeq n b #

(<$) :: a -> LSeq n b -> LSeq n a #

Foldable (LSeq n) Source # 

Methods

fold :: Monoid m => LSeq n m -> m #

foldMap :: Monoid m => (a -> m) -> LSeq n a -> m #

foldr :: (a -> b -> b) -> b -> LSeq n a -> b #

foldr' :: (a -> b -> b) -> b -> LSeq n a -> b #

foldl :: (b -> a -> b) -> b -> LSeq n a -> b #

foldl' :: (b -> a -> b) -> b -> LSeq n a -> b #

foldr1 :: (a -> a -> a) -> LSeq n a -> a #

foldl1 :: (a -> a -> a) -> LSeq n a -> a #

toList :: LSeq n a -> [a] #

null :: LSeq n a -> Bool #

length :: LSeq n a -> Int #

elem :: Eq a => a -> LSeq n a -> Bool #

maximum :: Ord a => LSeq n a -> a #

minimum :: Ord a => LSeq n a -> a #

sum :: Num a => LSeq n a -> a #

product :: Num a => LSeq n a -> a #

Traversable (LSeq n) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> LSeq n a -> f (LSeq n b) #

sequenceA :: Applicative f => LSeq n (f a) -> f (LSeq n a) #

mapM :: Monad m => (a -> m b) -> LSeq n a -> m (LSeq n b) #

sequence :: Monad m => LSeq n (m a) -> m (LSeq n a) #

Eq a => Eq (LSeq n a) Source # 

Methods

(==) :: LSeq n a -> LSeq n a -> Bool #

(/=) :: LSeq n a -> LSeq n a -> Bool #

Ord a => Ord (LSeq n a) Source # 

Methods

compare :: LSeq n a -> LSeq n a -> Ordering #

(<) :: LSeq n a -> LSeq n a -> Bool #

(<=) :: LSeq n a -> LSeq n a -> Bool #

(>) :: LSeq n a -> LSeq n a -> Bool #

(>=) :: LSeq n a -> LSeq n a -> Bool #

max :: LSeq n a -> LSeq n a -> LSeq n a #

min :: LSeq n a -> LSeq n a -> LSeq n a #

Read a => Read (LSeq n a) Source # 

Methods

readsPrec :: Int -> ReadS (LSeq n a) #

readList :: ReadS [LSeq n a] #

readPrec :: ReadPrec (LSeq n a) #

readListPrec :: ReadPrec [LSeq n a] #

Show a => Show (LSeq n a) Source # 

Methods

showsPrec :: Int -> LSeq n a -> ShowS #

show :: LSeq n a -> String #

showList :: [LSeq n a] -> ShowS #

Semigroup (LSeq n a) Source # 

Methods

(<>) :: LSeq n a -> LSeq n a -> LSeq n a #

sconcat :: NonEmpty (LSeq n a) -> LSeq n a #

stimes :: Integral b => b -> LSeq n a -> LSeq n a #

Monoid (LSeq 0 a) Source # 

Methods

mempty :: LSeq 0 a #

mappend :: LSeq 0 a -> LSeq 0 a -> LSeq 0 a #

mconcat :: [LSeq 0 a] -> LSeq 0 a #

Ixed (LSeq n a) Source # 

Methods

ix :: Index (LSeq n a) -> Traversal' (LSeq n a) (IxValue (LSeq n a)) #

type Index (LSeq n a) Source # 
type Index (LSeq n a) = Int
type IxValue (LSeq n a) Source # 
type IxValue (LSeq n a) = a

toSeq :: LSeq n a -> Seq a Source #

fromList :: Foldable f => f a -> LSeq 0 a Source #

fromSeq :: Seq a -> LSeq 0 a Source #

toNonEmpty :: LSeq (1 + n) a -> NonEmpty a Source #

(<|) :: a -> LSeq n a -> LSeq (1 + n) a infixr 5 Source #

(|>) :: LSeq n a -> a -> LSeq (1 + n) a infixl 5 Source #

(><) :: LSeq n a -> LSeq m a -> LSeq (n + m) a infix 5 Source #

eval :: forall proxy n m a. KnownNat n => proxy n -> LSeq m a -> Maybe (LSeq n a) Source #

index :: LSeq n a -> Int -> a Source #

get the element with index i, counting from the left and starting at 0. O(log(min(i,n-i)))

adjust :: (a -> a) -> Int -> LSeq n a -> LSeq n a Source #

partition :: (a -> Bool) -> LSeq n a -> (LSeq 0 a, LSeq 0 a) Source #

mapWithIndex :: (Int -> a -> b) -> LSeq n a -> LSeq n b Source #

take :: Int -> LSeq n a -> LSeq 0 a Source #

drop :: Int -> LSeq n a -> LSeq 0 a Source #

unstableSortBy :: (a -> a -> Ordering) -> LSeq n a -> LSeq n a Source #

data ViewL n a where Source #

Constructors

(:<) :: a -> LSeq n a -> ViewL (1 + n) a infixr 5 

Instances

Functor (ViewL n) Source # 

Methods

fmap :: (a -> b) -> ViewL n a -> ViewL n b #

(<$) :: a -> ViewL n b -> ViewL n a #

Foldable (ViewL n) Source # 

Methods

fold :: Monoid m => ViewL n m -> m #

foldMap :: Monoid m => (a -> m) -> ViewL n a -> m #

foldr :: (a -> b -> b) -> b -> ViewL n a -> b #

foldr' :: (a -> b -> b) -> b -> ViewL n a -> b #

foldl :: (b -> a -> b) -> b -> ViewL n a -> b #

foldl' :: (b -> a -> b) -> b -> ViewL n a -> b #

foldr1 :: (a -> a -> a) -> ViewL n a -> a #

foldl1 :: (a -> a -> a) -> ViewL n a -> a #

toList :: ViewL n a -> [a] #

null :: ViewL n a -> Bool #

length :: ViewL n a -> Int #

elem :: Eq a => a -> ViewL n a -> Bool #

maximum :: Ord a => ViewL n a -> a #

minimum :: Ord a => ViewL n a -> a #

sum :: Num a => ViewL n a -> a #

product :: Num a => ViewL n a -> a #

Traversable (ViewL n) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> ViewL n a -> f (ViewL n b) #

sequenceA :: Applicative f => ViewL n (f a) -> f (ViewL n a) #

mapM :: Monad m => (a -> m b) -> ViewL n a -> m (ViewL n b) #

sequence :: Monad m => ViewL n (m a) -> m (ViewL n a) #

Eq a => Eq (ViewL n a) Source # 

Methods

(==) :: ViewL n a -> ViewL n a -> Bool #

(/=) :: ViewL n a -> ViewL n a -> Bool #

Ord a => Ord (ViewL n a) Source # 

Methods

compare :: ViewL n a -> ViewL n a -> Ordering #

(<) :: ViewL n a -> ViewL n a -> Bool #

(<=) :: ViewL n a -> ViewL n a -> Bool #

(>) :: ViewL n a -> ViewL n a -> Bool #

(>=) :: ViewL n a -> ViewL n a -> Bool #

max :: ViewL n a -> ViewL n a -> ViewL n a #

min :: ViewL n a -> ViewL n a -> ViewL n a #

Show a => Show (ViewL n a) Source # 

Methods

showsPrec :: Int -> ViewL n a -> ShowS #

show :: ViewL n a -> String #

showList :: [ViewL n a] -> ShowS #

Semigroup (ViewL n a) Source # 

Methods

(<>) :: ViewL n a -> ViewL n a -> ViewL n a #

sconcat :: NonEmpty (ViewL n a) -> ViewL n a #

stimes :: Integral b => b -> ViewL n a -> ViewL n a #

viewl :: LSeq (1 + n) a -> ViewL (1 + n) a Source #

pattern (:<|) :: forall a n. () => forall n1. (~#) Nat Nat ((+) 1 n) ((+) 1 n1) => a -> LSeq n1 a -> LSeq ((+) 1 n) a infixr 5 Source #

pattern (:<<) :: forall a n. a -> LSeq 0 a -> LSeq n a infixr 5 Source #

pattern EmptyL :: forall a n. LSeq n a Source #

data ViewR n a where Source #

Constructors

(:>) :: LSeq n a -> a -> ViewR (1 + n) a infixl 5 

Instances

Functor (ViewR n) Source # 

Methods

fmap :: (a -> b) -> ViewR n a -> ViewR n b #

(<$) :: a -> ViewR n b -> ViewR n a #

Foldable (ViewR n) Source # 

Methods

fold :: Monoid m => ViewR n m -> m #

foldMap :: Monoid m => (a -> m) -> ViewR n a -> m #

foldr :: (a -> b -> b) -> b -> ViewR n a -> b #

foldr' :: (a -> b -> b) -> b -> ViewR n a -> b #

foldl :: (b -> a -> b) -> b -> ViewR n a -> b #

foldl' :: (b -> a -> b) -> b -> ViewR n a -> b #

foldr1 :: (a -> a -> a) -> ViewR n a -> a #

foldl1 :: (a -> a -> a) -> ViewR n a -> a #

toList :: ViewR n a -> [a] #

null :: ViewR n a -> Bool #

length :: ViewR n a -> Int #

elem :: Eq a => a -> ViewR n a -> Bool #

maximum :: Ord a => ViewR n a -> a #

minimum :: Ord a => ViewR n a -> a #

sum :: Num a => ViewR n a -> a #

product :: Num a => ViewR n a -> a #

Traversable (ViewR n) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> ViewR n a -> f (ViewR n b) #

sequenceA :: Applicative f => ViewR n (f a) -> f (ViewR n a) #

mapM :: Monad m => (a -> m b) -> ViewR n a -> m (ViewR n b) #

sequence :: Monad m => ViewR n (m a) -> m (ViewR n a) #

Eq a => Eq (ViewR n a) Source # 

Methods

(==) :: ViewR n a -> ViewR n a -> Bool #

(/=) :: ViewR n a -> ViewR n a -> Bool #

Ord a => Ord (ViewR n a) Source # 

Methods

compare :: ViewR n a -> ViewR n a -> Ordering #

(<) :: ViewR n a -> ViewR n a -> Bool #

(<=) :: ViewR n a -> ViewR n a -> Bool #

(>) :: ViewR n a -> ViewR n a -> Bool #

(>=) :: ViewR n a -> ViewR n a -> Bool #

max :: ViewR n a -> ViewR n a -> ViewR n a #

min :: ViewR n a -> ViewR n a -> ViewR n a #

Show a => Show (ViewR n a) Source # 

Methods

showsPrec :: Int -> ViewR n a -> ShowS #

show :: ViewR n a -> String #

showList :: [ViewR n a] -> ShowS #

Semigroup (ViewR n a) Source # 

Methods

(<>) :: ViewR n a -> ViewR n a -> ViewR n a #

sconcat :: NonEmpty (ViewR n a) -> ViewR n a #

stimes :: Integral b => b -> ViewR n a -> ViewR n a #

viewr :: LSeq (1 + n) a -> ViewR (1 + n) a Source #

pattern (:|>) :: forall a n. () => forall n1. (~#) Nat Nat ((+) 1 n) ((+) 1 n1) => LSeq n1 a -> a -> LSeq ((+) 1 n) a infixl 5 Source #

promise :: LSeq m a -> LSeq n a Source #

Promises that the length of this LSeq is actually n. This is not checked.

This function should be a noop