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

Safe HaskellNone
LanguageHaskell2010

Data.Seq

Synopsis

Documentation

data LSeq (n :: Nat) a Source #

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

Instances
Functor (LSeq n) Source # 
Instance details

Defined in Data.Seq

Methods

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

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

Foldable (LSeq n) Source # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

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

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

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

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

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

show :: LSeq n a -> String #

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

Semigroup (LSeq n a) Source # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

mempty :: LSeq 0 a #

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

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

(KnownNat n, Arbitrary a) => Arbitrary (LSeq n a) # 
Instance details

Defined in Test.QuickCheck.HGeometryInstances

Methods

arbitrary :: Gen (LSeq n a) #

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

Ixed (LSeq n a) Source # 
Instance details

Defined in Data.Seq

Methods

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

type Index (LSeq n a) Source # 
Instance details

Defined in Data.Seq

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

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

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

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

Foldable (ViewL n) Source # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

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

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

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

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

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

show :: ViewL n a -> String #

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

Semigroup (ViewL n a) Source # 
Instance details

Defined in Data.Seq

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

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

pattern EmptyL :: 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 # 
Instance details

Defined in Data.Seq

Methods

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

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

Foldable (ViewR n) Source # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

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

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

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

Defined in Data.Seq

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 # 
Instance details

Defined in Data.Seq

Methods

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

show :: ViewR n a -> String #

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

Semigroup (ViewR n a) Source # 
Instance details

Defined in Data.Seq

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 (n :: Nat) a. () => forall (n1 :: 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