BNFC3-3.0: A compiler front-end generator.
Safe HaskellNone
LanguageHaskell2010

BNFC.Utils.List2

Description

Lists of length at least 2.

Import as: import BNFC.Utils.List2 (List2(List2)) import qualified BNFC.Utils.List2 as List2

Synopsis

Documentation

data List2 a Source #

Lists of length ≥2.

Constructors

List2 a a [a] 

Instances

Instances details
Functor List2 Source # 
Instance details

Defined in BNFC.Utils.List2

Methods

fmap :: (a -> b) -> List2 a -> List2 b Source #

(<$) :: a -> List2 b -> List2 a Source #

Foldable List2 Source # 
Instance details

Defined in BNFC.Utils.List2

Methods

fold :: Monoid m => List2 m -> m Source #

foldMap :: Monoid m => (a -> m) -> List2 a -> m Source #

foldMap' :: Monoid m => (a -> m) -> List2 a -> m Source #

foldr :: (a -> b -> b) -> b -> List2 a -> b Source #

foldr' :: (a -> b -> b) -> b -> List2 a -> b Source #

foldl :: (b -> a -> b) -> b -> List2 a -> b Source #

foldl' :: (b -> a -> b) -> b -> List2 a -> b Source #

foldr1 :: (a -> a -> a) -> List2 a -> a Source #

foldl1 :: (a -> a -> a) -> List2 a -> a Source #

toList :: List2 a -> [a] Source #

null :: List2 a -> Bool Source #

length :: List2 a -> Int Source #

elem :: Eq a => a -> List2 a -> Bool Source #

maximum :: Ord a => List2 a -> a Source #

minimum :: Ord a => List2 a -> a Source #

sum :: Num a => List2 a -> a Source #

product :: Num a => List2 a -> a Source #

Traversable List2 Source # 
Instance details

Defined in BNFC.Utils.List2

Methods

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

sequenceA :: Applicative f => List2 (f a) -> f (List2 a) Source #

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

sequence :: Monad m => List2 (m a) -> m (List2 a) Source #

IsList (List2 a) Source # 
Instance details

Defined in BNFC.Utils.List2

Associated Types

type Item (List2 a) Source #

Methods

fromList :: [Item (List2 a)] -> List2 a Source #

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

toList :: List2 a -> [Item (List2 a)] Source #

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

Defined in BNFC.Utils.List2

Methods

(==) :: List2 a -> List2 a -> Bool Source #

(/=) :: List2 a -> List2 a -> Bool Source #

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

Defined in BNFC.Utils.List2

Methods

compare :: List2 a -> List2 a -> Ordering Source #

(<) :: List2 a -> List2 a -> Bool Source #

(<=) :: List2 a -> List2 a -> Bool Source #

(>) :: List2 a -> List2 a -> Bool Source #

(>=) :: List2 a -> List2 a -> Bool Source #

max :: List2 a -> List2 a -> List2 a Source #

min :: List2 a -> List2 a -> List2 a Source #

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

Defined in BNFC.Utils.List2

Semigroup (List2 a) Source # 
Instance details

Defined in BNFC.Utils.List2

Methods

(<>) :: List2 a -> List2 a -> List2 a Source #

sconcat :: NonEmpty (List2 a) -> List2 a Source #

stimes :: Integral b => b -> List2 a -> List2 a Source #

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

Defined in BNFC.Utils.List2

Methods

rnf :: List2 a -> () Source #

type Item (List2 a) Source # 
Instance details

Defined in BNFC.Utils.List2

type Item (List2 a) = a

cons :: a -> List2 a -> List2 a Source #

snoc :: List2 a -> a -> List2 a Source #

head :: List2 a -> a Source #

Safe.

tail :: List2 a -> [a] Source #

Safe.

tail1 :: List2 a -> List1 a Source #

Safe.

fromList :: [a] -> List2 a Source #

Unsafe!

fromList1 :: List1 a -> List2 a Source #

Unsafe!

break :: (a -> Bool) -> List2 a -> ([a], [a]) Source #

toList :: IsList l => l -> [Item l] Source #

The toList function extracts a list of Item l from the structure l. It should satisfy fromList . toList = id.