Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | GHC2021 |
Some basic types, mostly strict triples and pairs.
Strict Triples
strict triple
STR !a !b !c |
Instances
uniqueTriplets :: Foldable f => f a -> [Three a] Source #
Generate All unique unordered triplets.
>>>
mapM_ print $ uniqueTriplets "abcd"
V3 'a' 'b' 'c' V3 'a' 'b' 'd' V3 'a' 'c' 'd' V3 'b' 'c' 'd'
Strict Pairs
Strict pair
SP !a !b |
Instances
Bifunctor SP Source # | |||||
Functor (SP a) Source # | |||||
(NFData a, NFData b) => NFData (SP a b) Source # | |||||
Defined in HGeometry.Combinatorial.Util | |||||
(Semigroup a, Semigroup b, Monoid a, Monoid b) => Monoid (SP a b) Source # | |||||
(Semigroup a, Semigroup b) => Semigroup (SP a b) Source # | |||||
Generic (SP a b) Source # | |||||
Defined in HGeometry.Combinatorial.Util
| |||||
(Show a, Show b) => Show (SP a b) Source # | |||||
(Eq a, Eq b) => Eq (SP a b) Source # | |||||
(Ord a, Ord b) => Ord (SP a b) Source # | |||||
Field1 (SP a b) (SP c b) a c Source # | |||||
Field2 (SP a b) (SP a c) b c Source # | |||||
type Rep (SP a b) Source # | |||||
Defined in HGeometry.Combinatorial.Util type Rep (SP a b) = D1 ('MetaData "SP" "HGeometry.Combinatorial.Util" "hgeometry-combinatorial-1.0.0.0-inplace" 'False) (C1 ('MetaCons "SP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b))) |
- Strict pair whose elements are of the same type.
Strict pair with both items the same
uniquePairs :: Foldable f => f a -> [Two a] Source #
Given a list xs, generate all unique (unordered) pairs.
>>>
mapM_ print $ uniquePairs "abcde"
V2 'a' 'b' V2 'a' 'c' V2 'a' 'd' V2 'a' 'e' V2 'b' 'c' V2 'b' 'd' V2 'b' 'e' V2 'c' 'd' V2 'c' 'e' V2 'd' 'e'
nonEmptyTails :: [a] -> [[a]] Source #
A version of List.tails in which we remove the emptylist