hgeometry-combinatorial-0.12.0.0: Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Control.CanAquire

Description

 
Synopsis

Documentation

runAcquire :: forall t a b. Traversable t => (forall s. CanAquire (I s a) a => t (I s a) -> b) -> t a -> b Source #

Run a computation on something that can aquire i's.

class HasIndex i Int => CanAquire i a where Source #

Methods

aquire :: i -> a Source #

A value of type i can obtain something of type 'a'

Instances

Instances details
Reifies s (Vector a) => CanAquire (I s a) a Source # 
Instance details

Defined in Control.CanAquire

Methods

aquire :: I s a -> a Source #

class HasIndex t i | t -> i where Source #

Methods

indexOf :: t -> i Source #

Types that have an instance of this class can act as indices.

Instances

Instances details
HasIndex (I s a) Int Source # 
Instance details

Defined in Control.CanAquire

Methods

indexOf :: I s a -> Int Source #

replaceByIndex :: forall t a. Traversable t => t a -> (Vector a, t Int) Source #

Replaces every element by an index. Returns the new traversable containing only these indices, as well as a vector with the values. (such that indexing in this value gives the original value).

labelWithIndex :: Traversable t => t a -> (t (Int, a), Int) Source #

Label each element with its index. Returns the new collection as well as its size.

data I (s :: *) a Source #

A type that can act as an Index.

Instances

Instances details
Enum (I s a) Source # 
Instance details

Defined in Control.CanAquire

Methods

succ :: I s a -> I s a #

pred :: I s a -> I s a #

toEnum :: Int -> I s a #

fromEnum :: I s a -> Int #

enumFrom :: I s a -> [I s a] #

enumFromThen :: I s a -> I s a -> [I s a] #

enumFromTo :: I s a -> I s a -> [I s a] #

enumFromThenTo :: I s a -> I s a -> I s a -> [I s a] #

Eq (I s a) Source # 
Instance details

Defined in Control.CanAquire

Methods

(==) :: I s a -> I s a -> Bool #

(/=) :: I s a -> I s a -> Bool #

Ord (I s a) Source # 
Instance details

Defined in Control.CanAquire

Methods

compare :: I s a -> I s a -> Ordering #

(<) :: I s a -> I s a -> Bool #

(<=) :: I s a -> I s a -> Bool #

(>) :: I s a -> I s a -> Bool #

(>=) :: I s a -> I s a -> Bool #

max :: I s a -> I s a -> I s a #

min :: I s a -> I s a -> I s a #

Show (I s a) Source # 
Instance details

Defined in Control.CanAquire

Methods

showsPrec :: Int -> I s a -> ShowS #

show :: I s a -> String #

showList :: [I s a] -> ShowS #

HasIndex (I s a) Int Source # 
Instance details

Defined in Control.CanAquire

Methods

indexOf :: I s a -> Int Source #

Reifies s (Vector a) => CanAquire (I s a) a Source # 
Instance details

Defined in Control.CanAquire

Methods

aquire :: I s a -> a Source #