euler-0.1.0.0

Safe HaskellSafe
LanguageHaskell2010

Euler.Util.Inf

Synopsis

Documentation

data Inf a Source #

A wrapper for infinite lists, with typeclasses operating on only the list's head. This is not correct in all circumstances, but is useful for (for example) tails of an infinite sequence without duplicate elements.

Instances
Eq a => Eq (Inf a) Source #
fromList [5..] == fromList [5..]
fromList [5..] /= fromList [6..]
Instance details

Defined in Euler.Util.Inf

Methods

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

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

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

Defined in Euler.Util.Inf

Methods

compare :: Inf a -> Inf a -> Ordering #

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

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

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

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

max :: Inf a -> Inf a -> Inf a #

min :: Inf a -> Inf a -> Inf a #

Show a => Show (Inf a) Source #
>>> show $ fromList [5..]
"Inf (5, ...)"
Instance details

Defined in Euler.Util.Inf

Methods

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

show :: Inf a -> String #

showList :: [Inf a] -> ShowS #

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

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