ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Problems.Lists

Description

Supporting definitions for list problems.

Synopsis

Documentation

data NestedList a Source #

A list type with arbitrary nesting of lists.

Constructors

Elem a

A non-list element.

List [NestedList a]

Nested list.

Instances

Instances details
Generic (NestedList a) Source # 
Instance details

Defined in Problems.Lists

Associated Types

type Rep (NestedList a) :: Type -> Type #

Methods

from :: NestedList a -> Rep (NestedList a) x #

to :: Rep (NestedList a) x -> NestedList a #

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

Defined in Problems.Lists

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

Defined in Problems.Lists

Methods

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

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

type Rep (NestedList a) Source # 
Instance details

Defined in Problems.Lists

type Rep (NestedList a) = D1 ('MetaData "NestedList" "Problems.Lists" "ninetynine-1.3.0-4Xxr3hBGtJH9Ff8qb2Invo" 'False) (C1 ('MetaCons "Elem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "List" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [NestedList a])))

data Encoding a Source #

Encodes one or more consecutively duplicate elements.

Constructors

Single a

Represents a single occurrence of an element.

Multiple Int a

Represents an element repeating consecutively a given number of times.

Instances

Instances details
Generic (Encoding a) Source # 
Instance details

Defined in Problems.Lists

Associated Types

type Rep (Encoding a) :: Type -> Type #

Methods

from :: Encoding a -> Rep (Encoding a) x #

to :: Rep (Encoding a) x -> Encoding a #

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

Defined in Problems.Lists

Methods

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

show :: Encoding a -> String #

showList :: [Encoding a] -> ShowS #

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

Defined in Problems.Lists

Methods

rnf :: Encoding a -> () #

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

Defined in Problems.Lists

Methods

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

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

type Rep (Encoding a) Source # 
Instance details

Defined in Problems.Lists