Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
HGeometry.Ext
Description
A pair-like data type to represent a core
type that has extra information
as well.
Synopsis
- data core :+ extra = core :+ extra
- _core :: (core :+ extra) -> core
- _extra :: (core :+ extra) -> extra
- core :: Lens (core :+ extra) (core' :+ extra) core core'
- extra :: Lens (core :+ extra) (core :+ extra') extra extra'
- ext :: a -> a :+ ()
- class AsA t c | t -> c where
- asCore :: t -> c
- type (:~) t c = t `AsA` c
- pattern AsA :: t :~ c => c -> t
- class AsExt t where
- asIndexedExt :: (Indexable i p, Functor f) => p (s :+ i) (f (t :+ j)) -> Indexed i s (f t)
Documentation
data core :+ extra infixr 1 Source #
Our Ext type that represents the core datatype core extended with extra
information of type extra
.
Constructors
core :+ extra infixr 1 |
Instances
Bifoldable (:+) Source # | |
Bifoldable1 (:+) Source # | |
Defined in HGeometry.Ext | |
Bifunctor (:+) Source # | |
Bitraversable (:+) Source # | |
Defined in HGeometry.Ext Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> (a :+ b) -> f (c :+ d) # | |
Biapplicative (:+) Source # | |
Defined in HGeometry.Ext | |
Biapply (:+) Source # | |
Bitraversable1 (:+) Source # | |
Defined in HGeometry.Ext | |
Foldable ((:+) c) Source # | |
Defined in HGeometry.Ext Methods fold :: Monoid m => (c :+ m) -> m # foldMap :: Monoid m => (a -> m) -> (c :+ a) -> m # foldMap' :: Monoid m => (a -> m) -> (c :+ a) -> m # foldr :: (a -> b -> b) -> b -> (c :+ a) -> b # foldr' :: (a -> b -> b) -> b -> (c :+ a) -> b # foldl :: (b -> a -> b) -> b -> (c :+ a) -> b # foldl' :: (b -> a -> b) -> b -> (c :+ a) -> b # foldr1 :: (a -> a -> a) -> (c :+ a) -> a # foldl1 :: (a -> a -> a) -> (c :+ a) -> a # elem :: Eq a => a -> (c :+ a) -> Bool # maximum :: Ord a => (c :+ a) -> a # minimum :: Ord a => (c :+ a) -> a # | |
Traversable ((:+) c) Source # | |
Functor ((:+) c) Source # | |
(FromJSON core, FromJSON extra) => FromJSON (core :+ extra) Source # | |
(ToJSON core, ToJSON extra) => ToJSON (core :+ extra) Source # | |
(Semigroup core, Semigroup extra) => Semigroup (core :+ extra) Source # | |
(Bounded core, Bounded extra) => Bounded (core :+ extra) Source # | |
Generic (core :+ extra) Source # | |
(Read core, Read extra) => Read (core :+ extra) Source # | |
(Show core, Show extra) => Show (core :+ extra) Source # | |
(Default core, Default extra) => Default (core :+ extra) Source # | |
Defined in HGeometry.Ext | |
(NFData core, NFData extra) => NFData (core :+ extra) Source # | |
Defined in HGeometry.Ext | |
(Eq core, Eq extra) => Eq (core :+ extra) Source # | |
(Ord core, Ord extra) => Ord (core :+ extra) Source # | |
Defined in HGeometry.Ext Methods compare :: (core :+ extra) -> (core :+ extra) -> Ordering # (<) :: (core :+ extra) -> (core :+ extra) -> Bool # (<=) :: (core :+ extra) -> (core :+ extra) -> Bool # (>) :: (core :+ extra) -> (core :+ extra) -> Bool # (>=) :: (core :+ extra) -> (core :+ extra) -> Bool # max :: (core :+ extra) -> (core :+ extra) -> core :+ extra # min :: (core :+ extra) -> (core :+ extra) -> core :+ extra # | |
AsExt (c :+ e) Source # | |
(Uniform core, Uniform extra) => Uniform (core :+ extra) Source # | |
Defined in HGeometry.Ext Methods uniformM :: StatefulGen g m => g -> m (core :+ extra) Source # | |
(UniformRange core, UniformRange extra) => UniformRange (core :+ extra) Source # | |
Defined in HGeometry.Ext | |
AsA (c :+ e) c Source # | An Ext can act as its core. |
Defined in HGeometry.Ext | |
type Rep (core :+ extra) Source # | |
Defined in HGeometry.Ext type Rep (core :+ extra) = D1 ('MetaData ":+" "HGeometry.Ext" "hgeometry-combinatorial-1.0.0.0-inplace" 'False) (C1 ('MetaCons ":+" ('InfixI 'RightAssociative 1) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 core) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 extra))) | |
type CoreOf (c :+ e) Source # | |
Defined in HGeometry.Ext | |
type ExtraOf (c :+ e) Source # | |
Defined in HGeometry.Ext |
core :: Lens (core :+ extra) (core' :+ extra) core core' Source #
Lens access to the core of an extended value.
extra :: Lens (core :+ extra) (core :+ extra') extra extra' Source #
Lens access to the extra part of an extended value.
class AsA t c | t -> c where Source #
A class for types that can behave as a c. Mostly for types t that
"extend" a core
type c.
Types that can be decomposed into an Ext