| Copyright | Copyright (C) 2021 Yoo Chung |
|---|---|
| License | GPL-3.0-or-later |
| Maintainer | dev@chungyc.org |
| Safe Haskell | Safe-Inferred |
| Language | GHC2021 |
Problems.Lists
Description
Supporting definitions for list problems.
Synopsis
- data NestedList a
- = Elem a
- | List [NestedList a]
- data Encoding a
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
| Generic (NestedList a) Source # | |
Defined in Problems.Lists Associated Types type Rep (NestedList a) :: Type -> Type # | |
| Show a => Show (NestedList a) Source # | |
Defined in Problems.Lists Methods showsPrec :: Int -> NestedList a -> ShowS # show :: NestedList a -> String # showList :: [NestedList a] -> ShowS # | |
| Eq a => Eq (NestedList a) Source # | |
Defined in Problems.Lists | |
| type Rep (NestedList a) Source # | |
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]))) | |
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
| Generic (Encoding a) Source # | |
| Show a => Show (Encoding a) Source # | |
| NFData a => NFData (Encoding a) Source # | |
Defined in Problems.Lists | |
| Eq a => Eq (Encoding a) Source # | |
| type Rep (Encoding a) Source # | |
Defined in Problems.Lists type Rep (Encoding a) = D1 ('MetaData "Encoding" "Problems.Lists" "ninetynine-1.3.0-4Xxr3hBGtJH9Ff8qb2Invo" 'False) (C1 ('MetaCons "Single" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Multiple" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |