flp-0.1.0.0: A layout spec language for memory managers implemented in Rust.

Copyright(c) Alec Theriault 2017-2018
LicenseBSD-style
Maintaineralec.theriault@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Language.Rust.Parser.Reversed

Description

Datatypes wrapping lists and non-empty lists designed for fast append (as opposed to prepend) along with the usual class instances.

Synopsis

Documentation

newtype Reversed f a Source #

Wrap a data type where all the operations are reversed

Constructors

Reversed (f a) 
Instances
Functor f => Functor (Reversed f) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

fmap :: (a -> b) -> Reversed f a -> Reversed f b #

(<$) :: a -> Reversed f b -> Reversed f a #

Foldable (Reversed []) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

fold :: Monoid m => Reversed [] m -> m #

foldMap :: Monoid m => (a -> m) -> Reversed [] a -> m #

foldr :: (a -> b -> b) -> b -> Reversed [] a -> b #

foldr' :: (a -> b -> b) -> b -> Reversed [] a -> b #

foldl :: (b -> a -> b) -> b -> Reversed [] a -> b #

foldl' :: (b -> a -> b) -> b -> Reversed [] a -> b #

foldr1 :: (a -> a -> a) -> Reversed [] a -> a #

foldl1 :: (a -> a -> a) -> Reversed [] a -> a #

toList :: Reversed [] a -> [a] #

null :: Reversed [] a -> Bool #

length :: Reversed [] a -> Int #

elem :: Eq a => a -> Reversed [] a -> Bool #

maximum :: Ord a => Reversed [] a -> a #

minimum :: Ord a => Reversed [] a -> a #

sum :: Num a => Reversed [] a -> a #

product :: Num a => Reversed [] a -> a #

Foldable (Reversed NonEmpty) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

fold :: Monoid m => Reversed NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> Reversed NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> Reversed NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> Reversed NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> Reversed NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> Reversed NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> Reversed NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> Reversed NonEmpty a -> a #

toList :: Reversed NonEmpty a -> [a] #

null :: Reversed NonEmpty a -> Bool #

length :: Reversed NonEmpty a -> Int #

elem :: Eq a => a -> Reversed NonEmpty a -> Bool #

maximum :: Ord a => Reversed NonEmpty a -> a #

minimum :: Ord a => Reversed NonEmpty a -> a #

sum :: Num a => Reversed NonEmpty a -> a #

product :: Num a => Reversed NonEmpty a -> a #

IsList (f a) => IsList (Reversed f a) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Associated Types

type Item (Reversed f a) :: Type #

Methods

fromList :: [Item (Reversed f a)] -> Reversed f a #

fromListN :: Int -> [Item (Reversed f a)] -> Reversed f a #

toList :: Reversed f a -> [Item (Reversed f a)] #

(Typeable f, Typeable a, Data (f a)) => Data (Reversed f a) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Reversed f a -> c (Reversed f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Reversed f a) #

toConstr :: Reversed f a -> Constr #

dataTypeOf :: Reversed f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Reversed f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Reversed f a)) #

gmapT :: (forall b. Data b => b -> b) -> Reversed f a -> Reversed f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Reversed f a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Reversed f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Reversed f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Reversed f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Reversed f a -> m (Reversed f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Reversed f a -> m (Reversed f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Reversed f a -> m (Reversed f a) #

Semigroup (f a) => Semigroup (Reversed f a) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

(<>) :: Reversed f a -> Reversed f a -> Reversed f a #

sconcat :: NonEmpty (Reversed f a) -> Reversed f a #

stimes :: Integral b => b -> Reversed f a -> Reversed f a #

Monoid (f a) => Monoid (Reversed f a) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

mempty :: Reversed f a #

mappend :: Reversed f a -> Reversed f a -> Reversed f a #

mconcat :: [Reversed f a] -> Reversed f a #

Located (f a) => Located (Reversed f a) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

spanOf :: Reversed f a -> Span Source #

type Item (Reversed f a) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

type Item (Reversed f a) = Item (f a)

toNonEmpty :: Reversed NonEmpty a -> NonEmpty a Source #

Convert a reversed NonEmpty back into a normal one.

unsnoc :: Reversed NonEmpty a -> (Reversed [] a, a) Source #

Remove an element from the end of a non-empty reversed sequence

snoc :: Reversed [] a -> a -> Reversed NonEmpty a Source #

Add an element to the end of a reversed sequence to produce a non-empty reversed sequence

newtype NonEmpty a Source #

Constructors

NonEmpty (NonEmpty a) 
Instances
Functor NonEmpty Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

fmap :: (a -> b) -> NonEmpty a -> NonEmpty b #

(<$) :: a -> NonEmpty b -> NonEmpty a #

Foldable NonEmpty Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

fold :: Monoid m => NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a #

toList :: NonEmpty a -> [a] #

null :: NonEmpty a -> Bool #

length :: NonEmpty a -> Int #

elem :: Eq a => a -> NonEmpty a -> Bool #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

sum :: Num a => NonEmpty a -> a #

product :: Num a => NonEmpty a -> a #

Traversable NonEmpty Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

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

sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #

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

sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #

IsList (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Associated Types

type Item (NonEmpty a) :: Type #

Methods

fromList :: [Item (NonEmpty a)] -> NonEmpty a #

fromListN :: Int -> [Item (NonEmpty a)] -> NonEmpty a #

toList :: NonEmpty a -> [Item (NonEmpty a)] #

Eq a => Eq (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

(==) :: NonEmpty a -> NonEmpty a -> Bool #

(/=) :: NonEmpty a -> NonEmpty a -> Bool #

Data a => Data (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmpty a -> c (NonEmpty a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmpty a) #

toConstr :: NonEmpty a -> Constr #

dataTypeOf :: NonEmpty a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmpty a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmpty a)) #

gmapT :: (forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r #

gmapQ :: (forall d. Data d => d -> u) -> NonEmpty a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmpty a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

Ord a => Ord (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering #

(<) :: NonEmpty a -> NonEmpty a -> Bool #

(<=) :: NonEmpty a -> NonEmpty a -> Bool #

(>) :: NonEmpty a -> NonEmpty a -> Bool #

(>=) :: NonEmpty a -> NonEmpty a -> Bool #

max :: NonEmpty a -> NonEmpty a -> NonEmpty a #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a #

Show a => Show (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

showsPrec :: Int -> NonEmpty a -> ShowS #

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Foldable (Reversed NonEmpty) Source # 
Instance details

Defined in Language.Rust.Parser.Reversed

Methods

fold :: Monoid m => Reversed NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> Reversed NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> Reversed NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> Reversed NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> Reversed NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> Reversed NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> Reversed NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> Reversed NonEmpty a -> a #

toList :: Reversed NonEmpty a -> [a] #

null :: Reversed NonEmpty a -> Bool #

length :: Reversed NonEmpty a -> Int #

elem :: Eq a => a -> Reversed NonEmpty a -> Bool #

maximum :: Ord a => Reversed NonEmpty a -> a #

minimum :: Ord a => Reversed NonEmpty a -> a #

sum :: Num a => Reversed NonEmpty a -> a #

product :: Num a => Reversed NonEmpty a -> a #

Semigroup (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #

sconcat :: NonEmpty0 (NonEmpty a) -> NonEmpty a #

stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #

NFData a => NFData (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

Methods

rnf :: NonEmpty a -> () #

Located a => Located (NonEmpty a) Source #

O(n) time complexity

Instance details

Defined in Language.Rust.Data.Position

Methods

spanOf :: NonEmpty a -> Span Source #

type Item (NonEmpty a) Source # 
Instance details

Defined in Language.Rust.Parser.NonEmpty

type Item (NonEmpty a) = a