knit-haskell-0.3.0.0: a minimal Rmarkdown sort-of-thing for haskell, by way of Pandoc

Copyright(c) Adam Conner-Sax 2019
LicenseBSD-3-Clause
Maintaineradam_conner_sax@yahoo.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Knit.Report.Input.Visualization.Diagrams

Contents

Description

Functions to Diagrams (from the Diagrams library) to the current Pandoc document.

Synopsis

Add Diagrams Inputs

addDiagramAsSVG Source #

Arguments

:: (PandocEffects effs, Member ToPandoc effs, Member UnusedId effs) 
=> Maybe Text

id attribute for figure. Will use next unused "figure" id if Nothing

-> Maybe Text

caption for figure

-> Double

width in pixels (?)

-> Double

height in pixels (?)

-> QDiagram SVG V2 Double Any

diagram

-> Sem effs Text 

Add diagram (via svg inserted as html).

re-exports

(<$) :: Functor f => a -> f b -> f a infixl 4 #

Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.

class Functor f => Applicative (f :: Type -> Type) where #

A functor with application, providing operations to

  • embed pure expressions (pure), and
  • sequence computations and combine their results (<*> and liftA2).

A minimal complete definition must include implementations of pure and of either <*> or liftA2. If it defines both, then they must behave the same as their default definitions:

(<*>) = liftA2 id
liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

identity
pure id <*> v = v
composition
pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
homomorphism
pure f <*> pure x = pure (f x)
interchange
u <*> pure y = pure ($ y) <*> u

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

As a consequence of these laws, the Functor instance for f will satisfy

It may be useful to note that supposing

forall x y. p (q x y) = f x . g y

it follows from the above that

liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v

If f is also a Monad, it should satisfy

(which implies that pure and <*> satisfy the applicative functor laws).

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a #

Lift a value.

(<*>) :: f (a -> b) -> f a -> f b infixl 4 #

Sequential application.

A few functors support an implementation of <*> that is more efficient than the default one.

liftA2 :: (a -> b -> c) -> f a -> f b -> f c #

Lift a binary function to actions.

Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>.

(*>) :: f a -> f b -> f b infixl 4 #

Sequence actions, discarding the value of the first argument.

(<*) :: f a -> f b -> f a infixl 4 #

Sequence actions, discarding the value of the second argument.

Instances
Applicative []

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> [a] #

(<*>) :: [a -> b] -> [a] -> [b] #

liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] #

(*>) :: [a] -> [b] -> [b] #

(<*) :: [a] -> [b] -> [a] #

Applicative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> Maybe a #

(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #

liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #

(*>) :: Maybe a -> Maybe b -> Maybe b #

(<*) :: Maybe a -> Maybe b -> Maybe a #

Applicative IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> IO a #

(<*>) :: IO (a -> b) -> IO a -> IO b #

liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c #

(*>) :: IO a -> IO b -> IO b #

(<*) :: IO a -> IO b -> IO a #

Applicative Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Par1 a #

(<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b #

liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c #

(*>) :: Par1 a -> Par1 b -> Par1 b #

(<*) :: Par1 a -> Par1 b -> Par1 a #

Applicative Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

pure :: a -> Q a #

(<*>) :: Q (a -> b) -> Q a -> Q b #

liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c #

(*>) :: Q a -> Q b -> Q b #

(<*) :: Q a -> Q b -> Q a #

Applicative Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pure :: a -> Identity a #

(<*>) :: Identity (a -> b) -> Identity a -> Identity b #

liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

(*>) :: Identity a -> Identity b -> Identity b #

(<*) :: Identity a -> Identity b -> Identity a #

Applicative ZipList
f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN
    = 'ZipList' (zipWithN f xs1 ... xsN)

where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example:

(\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
    = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
    = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> ZipList a #

(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b #

liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c #

(*>) :: ZipList a -> ZipList b -> ZipList b #

(<*) :: ZipList a -> ZipList b -> ZipList a #

Applicative Active 
Instance details

Defined in Data.Active

Methods

pure :: a -> Active a #

(<*>) :: Active (a -> b) -> Active a -> Active b #

liftA2 :: (a -> b -> c) -> Active a -> Active b -> Active c #

(*>) :: Active a -> Active b -> Active b #

(<*) :: Active a -> Active b -> Active a #

Applicative Duration 
Instance details

Defined in Data.Active

Methods

pure :: a -> Duration a #

(<*>) :: Duration (a -> b) -> Duration a -> Duration b #

liftA2 :: (a -> b -> c) -> Duration a -> Duration b -> Duration c #

(*>) :: Duration a -> Duration b -> Duration b #

(<*) :: Duration a -> Duration b -> Duration a #

Applicative IResult 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

pure :: a -> IResult a #

(<*>) :: IResult (a -> b) -> IResult a -> IResult b #

liftA2 :: (a -> b -> c) -> IResult a -> IResult b -> IResult c #

(*>) :: IResult a -> IResult b -> IResult b #

(<*) :: IResult a -> IResult b -> IResult a #

Applicative Result 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

pure :: a -> Result a #

(<*>) :: Result (a -> b) -> Result a -> Result b #

liftA2 :: (a -> b -> c) -> Result a -> Result b -> Result c #

(*>) :: Result a -> Result b -> Result b #

(<*) :: Result a -> Result b -> Result a #

Applicative Parser 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

pure :: a -> Parser a #

(<*>) :: Parser (a -> b) -> Parser a -> Parser b #

liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c #

(*>) :: Parser a -> Parser b -> Parser b #

(<*) :: Parser a -> Parser b -> Parser a #

Applicative Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

pure :: a -> Complex a #

(<*>) :: Complex (a -> b) -> Complex a -> Complex b #

liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c #

(*>) :: Complex a -> Complex b -> Complex b #

(<*) :: Complex a -> Complex b -> Complex a #

Applicative Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Min a #

(<*>) :: Min (a -> b) -> Min a -> Min b #

liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c #

(*>) :: Min a -> Min b -> Min b #

(<*) :: Min a -> Min b -> Min a #

Applicative Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Max a #

(<*>) :: Max (a -> b) -> Max a -> Max b #

liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c #

(*>) :: Max a -> Max b -> Max b #

(<*) :: Max a -> Max b -> Max a #

Applicative First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> First a #

(<*>) :: First (a -> b) -> First a -> First b #

liftA2 :: (a -> b -> c) -> First a -> First b -> First c #

(*>) :: First a -> First b -> First b #

(<*) :: First a -> First b -> First a #

Applicative Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Last a #

(<*>) :: Last (a -> b) -> Last a -> Last b #

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c #

(*>) :: Last a -> Last b -> Last b #

(<*) :: Last a -> Last b -> Last a #

Applicative Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Option a #

(<*>) :: Option (a -> b) -> Option a -> Option b #

liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c #

(*>) :: Option a -> Option b -> Option b #

(<*) :: Option a -> Option b -> Option a #

Applicative STM

Since: base-4.8.0.0

Instance details

Defined in GHC.Conc.Sync

Methods

pure :: a -> STM a #

(<*>) :: STM (a -> b) -> STM a -> STM b #

liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c #

(*>) :: STM a -> STM b -> STM b #

(<*) :: STM a -> STM b -> STM a #

Applicative First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> First a #

(<*>) :: First (a -> b) -> First a -> First b #

liftA2 :: (a -> b -> c) -> First a -> First b -> First c #

(*>) :: First a -> First b -> First b #

(<*) :: First a -> First b -> First a #

Applicative Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> Last a #

(<*>) :: Last (a -> b) -> Last a -> Last b #

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c #

(*>) :: Last a -> Last b -> Last b #

(<*) :: Last a -> Last b -> Last a #

Applicative Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Dual a #

(<*>) :: Dual (a -> b) -> Dual a -> Dual b #

liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c #

(*>) :: Dual a -> Dual b -> Dual b #

(<*) :: Dual a -> Dual b -> Dual a #

Applicative Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Sum a #

(<*>) :: Sum (a -> b) -> Sum a -> Sum b #

liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c #

(*>) :: Sum a -> Sum b -> Sum b #

(<*) :: Sum a -> Sum b -> Sum a #

Applicative Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Product a #

(<*>) :: Product (a -> b) -> Product a -> Product b #

liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c #

(*>) :: Product a -> Product b -> Product b #

(<*) :: Product a -> Product b -> Product a #

Applicative Down

Since: base-4.11.0.0

Instance details

Defined in Data.Ord

Methods

pure :: a -> Down a #

(<*>) :: Down (a -> b) -> Down a -> Down b #

liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c #

(*>) :: Down a -> Down b -> Down b #

(<*) :: Down a -> Down b -> Down a #

Applicative ReadP

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: a -> ReadP a #

(<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b #

liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c #

(*>) :: ReadP a -> ReadP b -> ReadP b #

(<*) :: ReadP a -> ReadP b -> ReadP a #

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

pure :: a -> NonEmpty a #

(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #

Applicative MarkupM 
Instance details

Defined in Text.Blaze.Internal

Methods

pure :: a -> MarkupM a #

(<*>) :: MarkupM (a -> b) -> MarkupM a -> MarkupM b #

liftA2 :: (a -> b -> c) -> MarkupM a -> MarkupM b -> MarkupM c #

(*>) :: MarkupM a -> MarkupM b -> MarkupM b #

(<*) :: MarkupM a -> MarkupM b -> MarkupM a #

Applicative Vector 
Instance details

Defined in Data.Vector

Methods

pure :: a -> Vector a #

(<*>) :: Vector (a -> b) -> Vector a -> Vector b #

liftA2 :: (a -> b -> c) -> Vector a -> Vector b -> Vector c #

(*>) :: Vector a -> Vector b -> Vector b #

(<*) :: Vector a -> Vector b -> Vector a #

Applicative Headed 
Instance details

Defined in Colonnade.Encode

Methods

pure :: a -> Headed a #

(<*>) :: Headed (a -> b) -> Headed a -> Headed b #

liftA2 :: (a -> b -> c) -> Headed a -> Headed b -> Headed c #

(*>) :: Headed a -> Headed b -> Headed b #

(<*) :: Headed a -> Headed b -> Headed a #

Applicative Headless 
Instance details

Defined in Colonnade.Encode

Methods

pure :: a -> Headless a #

(<*>) :: Headless (a -> b) -> Headless a -> Headless b #

liftA2 :: (a -> b -> c) -> Headless a -> Headless b -> Headless c #

(*>) :: Headless a -> Headless b -> Headless b #

(<*) :: Headless a -> Headless b -> Headless a #

Applicative RGB 
Instance details

Defined in Data.Colour.RGB

Methods

pure :: a -> RGB a #

(<*>) :: RGB (a -> b) -> RGB a -> RGB b #

liftA2 :: (a -> b -> c) -> RGB a -> RGB b -> RGB c #

(*>) :: RGB a -> RGB b -> RGB b #

(<*) :: RGB a -> RGB b -> RGB a #

Applicative Tree 
Instance details

Defined in Data.Tree

Methods

pure :: a -> Tree a #

(<*>) :: Tree (a -> b) -> Tree a -> Tree b #

liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c #

(*>) :: Tree a -> Tree b -> Tree b #

(<*) :: Tree a -> Tree b -> Tree a #

Applicative Seq

Since: containers-0.5.4

Instance details

Defined in Data.Sequence.Internal

Methods

pure :: a -> Seq a #

(<*>) :: Seq (a -> b) -> Seq a -> Seq b #

liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c #

(*>) :: Seq a -> Seq b -> Seq b #

(<*) :: Seq a -> Seq b -> Seq a #

Applicative CryptoFailable 
Instance details

Defined in Crypto.Error.Types

Applicative Angle 
Instance details

Defined in Diagrams.Angle

Methods

pure :: a -> Angle a #

(<*>) :: Angle (a -> b) -> Angle a -> Angle b #

liftA2 :: (a -> b -> c) -> Angle a -> Angle b -> Angle c #

(*>) :: Angle a -> Angle b -> Angle b #

(<*) :: Angle a -> Angle b -> Angle a #

Applicative V2 
Instance details

Defined in Linear.V2

Methods

pure :: a -> V2 a #

(<*>) :: V2 (a -> b) -> V2 a -> V2 b #

liftA2 :: (a -> b -> c) -> V2 a -> V2 b -> V2 c #

(*>) :: V2 a -> V2 b -> V2 b #

(<*) :: V2 a -> V2 b -> V2 a #

Applicative V3 
Instance details

Defined in Linear.V3

Methods

pure :: a -> V3 a #

(<*>) :: V3 (a -> b) -> V3 a -> V3 b #

liftA2 :: (a -> b -> c) -> V3 a -> V3 b -> V3 c #

(*>) :: V3 a -> V3 b -> V3 b #

(<*) :: V3 a -> V3 b -> V3 a #

Applicative DList 
Instance details

Defined in Data.DList

Methods

pure :: a -> DList a #

(<*>) :: DList (a -> b) -> DList a -> DList b #

liftA2 :: (a -> b -> c) -> DList a -> DList b -> DList c #

(*>) :: DList a -> DList b -> DList b #

(<*) :: DList a -> DList b -> DList a #

Applicative Lua 
Instance details

Defined in Foreign.Lua.Core.Types

Methods

pure :: a -> Lua a #

(<*>) :: Lua (a -> b) -> Lua a -> Lua b #

liftA2 :: (a -> b -> c) -> Lua a -> Lua b -> Lua c #

(*>) :: Lua a -> Lua b -> Lua b #

(<*) :: Lua a -> Lua b -> Lua a #

Applicative Interval 
Instance details

Defined in Numeric.Interval.Kaucher

Methods

pure :: a -> Interval a #

(<*>) :: Interval (a -> b) -> Interval a -> Interval b #

liftA2 :: (a -> b -> c) -> Interval a -> Interval b -> Interval c #

(*>) :: Interval a -> Interval b -> Interval b #

(<*) :: Interval a -> Interval b -> Interval a #

Applicative Plucker 
Instance details

Defined in Linear.Plucker

Methods

pure :: a -> Plucker a #

(<*>) :: Plucker (a -> b) -> Plucker a -> Plucker b #

liftA2 :: (a -> b -> c) -> Plucker a -> Plucker b -> Plucker c #

(*>) :: Plucker a -> Plucker b -> Plucker b #

(<*) :: Plucker a -> Plucker b -> Plucker a #

Applicative Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

pure :: a -> Quaternion a #

(<*>) :: Quaternion (a -> b) -> Quaternion a -> Quaternion b #

liftA2 :: (a -> b -> c) -> Quaternion a -> Quaternion b -> Quaternion c #

(*>) :: Quaternion a -> Quaternion b -> Quaternion b #

(<*) :: Quaternion a -> Quaternion b -> Quaternion a #

Applicative V0 
Instance details

Defined in Linear.V0

Methods

pure :: a -> V0 a #

(<*>) :: V0 (a -> b) -> V0 a -> V0 b #

liftA2 :: (a -> b -> c) -> V0 a -> V0 b -> V0 c #

(*>) :: V0 a -> V0 b -> V0 b #

(<*) :: V0 a -> V0 b -> V0 a #

Applicative V4 
Instance details

Defined in Linear.V4

Methods

pure :: a -> V4 a #

(<*>) :: V4 (a -> b) -> V4 a -> V4 b #

liftA2 :: (a -> b -> c) -> V4 a -> V4 b -> V4 c #

(*>) :: V4 a -> V4 b -> V4 b #

(<*) :: V4 a -> V4 b -> V4 a #

Applicative V1 
Instance details

Defined in Linear.V1

Methods

pure :: a -> V1 a #

(<*>) :: V1 (a -> b) -> V1 a -> V1 b #

liftA2 :: (a -> b -> c) -> V1 a -> V1 b -> V1 c #

(*>) :: V1 a -> V1 b -> V1 b #

(<*) :: V1 a -> V1 b -> V1 a #

Applicative PandocIO 
Instance details

Defined in Text.Pandoc.Class

Methods

pure :: a -> PandocIO a #

(<*>) :: PandocIO (a -> b) -> PandocIO a -> PandocIO b #

liftA2 :: (a -> b -> c) -> PandocIO a -> PandocIO b -> PandocIO c #

(*>) :: PandocIO a -> PandocIO b -> PandocIO b #

(<*) :: PandocIO a -> PandocIO b -> PandocIO a #

Applicative PandocPure 
Instance details

Defined in Text.Pandoc.Class

Methods

pure :: a -> PandocPure a #

(<*>) :: PandocPure (a -> b) -> PandocPure a -> PandocPure b #

liftA2 :: (a -> b -> c) -> PandocPure a -> PandocPure b -> PandocPure c #

(*>) :: PandocPure a -> PandocPure b -> PandocPure b #

(<*) :: PandocPure a -> PandocPure b -> PandocPure a #

Applicative SmallArray 
Instance details

Defined in Data.Primitive.SmallArray

Methods

pure :: a -> SmallArray a #

(<*>) :: SmallArray (a -> b) -> SmallArray a -> SmallArray b #

liftA2 :: (a -> b -> c) -> SmallArray a -> SmallArray b -> SmallArray c #

(*>) :: SmallArray a -> SmallArray b -> SmallArray b #

(<*) :: SmallArray a -> SmallArray b -> SmallArray a #

Applicative Array 
Instance details

Defined in Data.Primitive.Array

Methods

pure :: a -> Array a #

(<*>) :: Array (a -> b) -> Array a -> Array b #

liftA2 :: (a -> b -> c) -> Array a -> Array b -> Array c #

(*>) :: Array a -> Array b -> Array b #

(<*) :: Array a -> Array b -> Array a #

Applicative Stream 
Instance details

Defined in Codec.Compression.Zlib.Stream

Methods

pure :: a -> Stream a #

(<*>) :: Stream (a -> b) -> Stream a -> Stream b #

liftA2 :: (a -> b -> c) -> Stream a -> Stream b -> Stream c #

(*>) :: Stream a -> Stream b -> Stream b #

(<*) :: Stream a -> Stream b -> Stream a #

Applicative P

Since: base-4.5.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: a -> P a #

(<*>) :: P (a -> b) -> P a -> P b #

liftA2 :: (a -> b -> c) -> P a -> P b -> P c #

(*>) :: P a -> P b -> P b #

(<*) :: P a -> P b -> P a #

Applicative (Either e)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

pure :: a -> Either e a #

(<*>) :: Either e (a -> b) -> Either e a -> Either e b #

liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c #

(*>) :: Either e a -> Either e b -> Either e b #

(<*) :: Either e a -> Either e b -> Either e a #

Applicative (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> U1 a #

(<*>) :: U1 (a -> b) -> U1 a -> U1 b #

liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c #

(*>) :: U1 a -> U1 b -> U1 b #

(<*) :: U1 a -> U1 b -> U1 a #

Monoid a => Applicative ((,) a)

For tuples, the Monoid constraint on a determines how the first values merge. For example, Strings concatenate:

("hello ", (+15)) <*> ("world!", 2002)
("hello world!",2017)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a0 -> (a, a0) #

(<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) #

liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) #

(*>) :: (a, a0) -> (a, b) -> (a, b) #

(<*) :: (a, a0) -> (a, b) -> (a, a0) #

Monad m => Applicative (WrappedMonad m)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a #

Applicative (Prompt p) 
Instance details

Defined in Control.Monad.Prompt

Methods

pure :: a -> Prompt p a #

(<*>) :: Prompt p (a -> b) -> Prompt p a -> Prompt p b #

liftA2 :: (a -> b -> c) -> Prompt p a -> Prompt p b -> Prompt p c #

(*>) :: Prompt p a -> Prompt p b -> Prompt p b #

(<*) :: Prompt p a -> Prompt p b -> Prompt p a #

Applicative (RecPrompt p) 
Instance details

Defined in Control.Monad.Prompt

Methods

pure :: a -> RecPrompt p a #

(<*>) :: RecPrompt p (a -> b) -> RecPrompt p a -> RecPrompt p b #

liftA2 :: (a -> b -> c) -> RecPrompt p a -> RecPrompt p b -> RecPrompt p c #

(*>) :: RecPrompt p a -> RecPrompt p b -> RecPrompt p b #

(<*) :: RecPrompt p a -> RecPrompt p b -> RecPrompt p a #

Representable f => Applicative (Co f) 
Instance details

Defined in Data.Functor.Rep

Methods

pure :: a -> Co f a #

(<*>) :: Co f (a -> b) -> Co f a -> Co f b #

liftA2 :: (a -> b -> c) -> Co f a -> Co f b -> Co f c #

(*>) :: Co f a -> Co f b -> Co f b #

(<*) :: Co f a -> Co f b -> Co f a #

Applicative (Parser i) 
Instance details

Defined in Data.Attoparsec.Internal.Types

Methods

pure :: a -> Parser i a #

(<*>) :: Parser i (a -> b) -> Parser i a -> Parser i b #

liftA2 :: (a -> b -> c) -> Parser i a -> Parser i b -> Parser i c #

(*>) :: Parser i a -> Parser i b -> Parser i b #

(<*) :: Parser i a -> Parser i b -> Parser i a #

Arrow a => Applicative (ArrowMonad a)

Since: base-4.6.0.0

Instance details

Defined in Control.Arrow

Methods

pure :: a0 -> ArrowMonad a a0 #

(<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b #

liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c #

(*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b #

(<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 #

Applicative (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Applicative (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

pure :: a -> Measured n a #

(<*>) :: Measured n (a -> b) -> Measured n a -> Measured n b #

liftA2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c #

(*>) :: Measured n a -> Measured n b -> Measured n b #

(<*) :: Measured n a -> Measured n b -> Measured n a #

Applicative f => Applicative (Point f) 
Instance details

Defined in Linear.Affine

Methods

pure :: a -> Point f a #

(<*>) :: Point f (a -> b) -> Point f a -> Point f b #

liftA2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c #

(*>) :: Point f a -> Point f b -> Point f b #

(<*) :: Point f a -> Point f b -> Point f a #

(Functor m, Monad m) => Applicative (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

pure :: a -> MaybeT m a #

(<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b #

liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c #

(*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #

(<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a #

Applicative (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedFold s a #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

liftA2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

Applicative (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedGetter s a #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

liftA2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Alternative f => Applicative (Cofree f) 
Instance details

Defined in Control.Comonad.Cofree

Methods

pure :: a -> Cofree f a #

(<*>) :: Cofree f (a -> b) -> Cofree f a -> Cofree f b #

liftA2 :: (a -> b -> c) -> Cofree f a -> Cofree f b -> Cofree f c #

(*>) :: Cofree f a -> Cofree f b -> Cofree f b #

(<*) :: Cofree f a -> Cofree f b -> Cofree f a #

Functor f => Applicative (Free f) 
Instance details

Defined in Control.Monad.Free

Methods

pure :: a -> Free f a #

(<*>) :: Free f (a -> b) -> Free f a -> Free f b #

liftA2 :: (a -> b -> c) -> Free f a -> Free f b -> Free f c #

(*>) :: Free f a -> Free f b -> Free f b #

(<*) :: Free f a -> Free f b -> Free f a #

Applicative f => Applicative (Yoneda f) 
Instance details

Defined in Data.Functor.Yoneda

Methods

pure :: a -> Yoneda f a #

(<*>) :: Yoneda f (a -> b) -> Yoneda f a -> Yoneda f b #

liftA2 :: (a -> b -> c) -> Yoneda f a -> Yoneda f b -> Yoneda f c #

(*>) :: Yoneda f a -> Yoneda f b -> Yoneda f b #

(<*) :: Yoneda f a -> Yoneda f b -> Yoneda f a #

Applicative f => Applicative (Indexing f) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: a -> Indexing f a #

(<*>) :: Indexing f (a -> b) -> Indexing f a -> Indexing f b #

liftA2 :: (a -> b -> c) -> Indexing f a -> Indexing f b -> Indexing f c #

(*>) :: Indexing f a -> Indexing f b -> Indexing f b #

(<*) :: Indexing f a -> Indexing f b -> Indexing f a #

Applicative f => Applicative (Indexing64 f) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: a -> Indexing64 f a #

(<*>) :: Indexing64 f (a -> b) -> Indexing64 f a -> Indexing64 f b #

liftA2 :: (a -> b -> c) -> Indexing64 f a -> Indexing64 f b -> Indexing64 f c #

(*>) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f b #

(<*) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f a #

Applicative m => Applicative (HtmlT m)

Based on the monad instance.

Instance details

Defined in Lucid.Base

Methods

pure :: a -> HtmlT m a #

(<*>) :: HtmlT m (a -> b) -> HtmlT m a -> HtmlT m b #

liftA2 :: (a -> b -> c) -> HtmlT m a -> HtmlT m b -> HtmlT m c #

(*>) :: HtmlT m a -> HtmlT m b -> HtmlT m b #

(<*) :: HtmlT m a -> HtmlT m b -> HtmlT m a #

Applicative m => Applicative (ListT m) 
Instance details

Defined in Control.Monad.Trans.List

Methods

pure :: a -> ListT m a #

(<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b #

liftA2 :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c #

(*>) :: ListT m a -> ListT m b -> ListT m b #

(<*) :: ListT m a -> ListT m b -> ListT m a #

Applicative (Sem f) 
Instance details

Defined in Polysemy.Internal

Methods

pure :: a -> Sem f a #

(<*>) :: Sem f (a -> b) -> Sem f a -> Sem f b #

liftA2 :: (a -> b -> c) -> Sem f a -> Sem f b -> Sem f c #

(*>) :: Sem f a -> Sem f b -> Sem f b #

(<*) :: Sem f a -> Sem f b -> Sem f a #

(Applicative (Rep p), Representable p) => Applicative (Prep p) 
Instance details

Defined in Data.Profunctor.Rep

Methods

pure :: a -> Prep p a #

(<*>) :: Prep p (a -> b) -> Prep p a -> Prep p b #

liftA2 :: (a -> b -> c) -> Prep p a -> Prep p b -> Prep p c #

(*>) :: Prep p a -> Prep p b -> Prep p b #

(<*) :: Prep p a -> Prep p b -> Prep p a #

Applicative (RVarT n) 
Instance details

Defined in Data.RVar

Methods

pure :: a -> RVarT n a #

(<*>) :: RVarT n (a -> b) -> RVarT n a -> RVarT n b #

liftA2 :: (a -> b -> c) -> RVarT n a -> RVarT n b -> RVarT n c #

(*>) :: RVarT n a -> RVarT n b -> RVarT n b #

(<*) :: RVarT n a -> RVarT n b -> RVarT n a #

Applicative f => Applicative (WrappedApplicative f) 
Instance details

Defined in Data.Functor.Bind.Class

Apply f => Applicative (MaybeApply f) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

pure :: a -> MaybeApply f a #

(<*>) :: MaybeApply f (a -> b) -> MaybeApply f a -> MaybeApply f b #

liftA2 :: (a -> b -> c) -> MaybeApply f a -> MaybeApply f b -> MaybeApply f c #

(*>) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f b #

(<*) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f a #

Applicative f => Applicative (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Rec1 f a #

(<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b #

liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c #

(*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b #

(<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a #

Applicative m => Applicative (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

pure :: a -> IdentityT m a #

(<*>) :: IdentityT m (a -> b) -> IdentityT m a -> IdentityT m b #

liftA2 :: (a -> b -> c) -> IdentityT m a -> IdentityT m b -> IdentityT m c #

(*>) :: IdentityT m a -> IdentityT m b -> IdentityT m b #

(<*) :: IdentityT m a -> IdentityT m b -> IdentityT m a #

Monoid m => Applicative (Const m :: Type -> Type)

Since: base-2.0.1

Instance details

Defined in Data.Functor.Const

Methods

pure :: a -> Const m a #

(<*>) :: Const m (a -> b) -> Const m a -> Const m b #

liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c #

(*>) :: Const m a -> Const m b -> Const m b #

(<*) :: Const m a -> Const m b -> Const m a #

Arrow a => Applicative (WrappedArrow a b)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #

Applicative (PromptT p m) 
Instance details

Defined in Control.Monad.Prompt

Methods

pure :: a -> PromptT p m a #

(<*>) :: PromptT p m (a -> b) -> PromptT p m a -> PromptT p m b #

liftA2 :: (a -> b -> c) -> PromptT p m a -> PromptT p m b -> PromptT p m c #

(*>) :: PromptT p m a -> PromptT p m b -> PromptT p m b #

(<*) :: PromptT p m a -> PromptT p m b -> PromptT p m a #

Applicative (RecPromptT p m) 
Instance details

Defined in Control.Monad.Prompt

Methods

pure :: a -> RecPromptT p m a #

(<*>) :: RecPromptT p m (a -> b) -> RecPromptT p m a -> RecPromptT p m b #

liftA2 :: (a -> b -> c) -> RecPromptT p m a -> RecPromptT p m b -> RecPromptT p m c #

(*>) :: RecPromptT p m a -> RecPromptT p m b -> RecPromptT p m b #

(<*) :: RecPromptT p m a -> RecPromptT p m b -> RecPromptT p m a #

Applicative f => Applicative (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> Ap f a #

(<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b #

liftA2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c #

(*>) :: Ap f a -> Ap f b -> Ap f b #

(<*) :: Ap f a -> Ap f b -> Ap f a #

Applicative f => Applicative (Alt f)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Alt f a #

(<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b #

liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c #

(*>) :: Alt f a -> Alt f b -> Alt f b #

(<*) :: Alt f a -> Alt f b -> Alt f a #

Biapplicative p => Applicative (Join p) 
Instance details

Defined in Data.Bifunctor.Join

Methods

pure :: a -> Join p a #

(<*>) :: Join p (a -> b) -> Join p a -> Join p b #

liftA2 :: (a -> b -> c) -> Join p a -> Join p b -> Join p c #

(*>) :: Join p a -> Join p b -> Join p b #

(<*) :: Join p a -> Join p b -> Join p a #

Biapplicative p => Applicative (Fix p) 
Instance details

Defined in Data.Bifunctor.Fix

Methods

pure :: a -> Fix p a #

(<*>) :: Fix p (a -> b) -> Fix p a -> Fix p b #

liftA2 :: (a -> b -> c) -> Fix p a -> Fix p b -> Fix p c #

(*>) :: Fix p a -> Fix p b -> Fix p b #

(<*) :: Fix p a -> Fix p b -> Fix p a #

Applicative w => Applicative (TracedT m w) 
Instance details

Defined in Control.Comonad.Trans.Traced

Methods

pure :: a -> TracedT m w a #

(<*>) :: TracedT m w (a -> b) -> TracedT m w a -> TracedT m w b #

liftA2 :: (a -> b -> c) -> TracedT m w a -> TracedT m w b -> TracedT m w c #

(*>) :: TracedT m w a -> TracedT m w b -> TracedT m w b #

(<*) :: TracedT m w a -> TracedT m w b -> TracedT m w a #

(Applicative f, Monad f) => Applicative (WhenMissing f x)

Equivalent to ReaderT k (ReaderT x (MaybeT f)).

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMissing f x a #

(<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b #

liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c #

(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b #

(<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a #

Applicative (Query v n) 
Instance details

Defined in Diagrams.Core.Query

Methods

pure :: a -> Query v n a #

(<*>) :: Query v n (a -> b) -> Query v n a -> Query v n b #

liftA2 :: (a -> b -> c) -> Query v n a -> Query v n b -> Query v n c #

(*>) :: Query v n a -> Query v n b -> Query v n b #

(<*) :: Query v n a -> Query v n b -> Query v n a #

Applicative (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: a0 -> Indexed i a a0 #

(<*>) :: Indexed i a (a0 -> b) -> Indexed i a a0 -> Indexed i a b #

liftA2 :: (a0 -> b -> c) -> Indexed i a a0 -> Indexed i a b -> Indexed i a c #

(*>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b #

(<*) :: Indexed i a a0 -> Indexed i a b -> Indexed i a a0 #

(Functor m, Monad m) => Applicative (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

pure :: a -> ExceptT e m a #

(<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b #

liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c #

(*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b #

(<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a #

(Functor f, Monad m) => Applicative (FreeT f m) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

pure :: a -> FreeT f m a #

(<*>) :: FreeT f m (a -> b) -> FreeT f m a -> FreeT f m b #

liftA2 :: (a -> b -> c) -> FreeT f m a -> FreeT f m b -> FreeT f m c #

(*>) :: FreeT f m a -> FreeT f m b -> FreeT f m b #

(<*) :: FreeT f m a -> FreeT f m b -> FreeT f m a #

(Alternative f, Applicative w) => Applicative (CofreeT f w) 
Instance details

Defined in Control.Comonad.Trans.Cofree

Methods

pure :: a -> CofreeT f w a #

(<*>) :: CofreeT f w (a -> b) -> CofreeT f w a -> CofreeT f w b #

liftA2 :: (a -> b -> c) -> CofreeT f w a -> CofreeT f w b -> CofreeT f w c #

(*>) :: CofreeT f w a -> CofreeT f w b -> CofreeT f w b #

(<*) :: CofreeT f w a -> CofreeT f w b -> CofreeT f w a #

(Functor g, g ~ h) => Applicative (Curried g h) 
Instance details

Defined in Data.Functor.Day.Curried

Methods

pure :: a -> Curried g h a #

(<*>) :: Curried g h (a -> b) -> Curried g h a -> Curried g h b #

liftA2 :: (a -> b -> c) -> Curried g h a -> Curried g h b -> Curried g h c #

(*>) :: Curried g h a -> Curried g h b -> Curried g h b #

(<*) :: Curried g h a -> Curried g h b -> Curried g h a #

(Applicative f, Applicative g) => Applicative (Day f g) 
Instance details

Defined in Data.Functor.Day

Methods

pure :: a -> Day f g a #

(<*>) :: Day f g (a -> b) -> Day f g a -> Day f g b #

liftA2 :: (a -> b -> c) -> Day f g a -> Day f g b -> Day f g c #

(*>) :: Day f g a -> Day f g b -> Day f g b #

(<*) :: Day f g a -> Day f g b -> Day f g a #

(Functor m, Monad m) => Applicative (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

pure :: a -> ErrorT e m a #

(<*>) :: ErrorT e m (a -> b) -> ErrorT e m a -> ErrorT e m b #

liftA2 :: (a -> b -> c) -> ErrorT e m a -> ErrorT e m b -> ErrorT e m c #

(*>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b #

(<*) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m a #

(Functor m, Monad m) => Applicative (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

pure :: a -> StateT s m a #

(<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b #

liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c #

(*>) :: StateT s m a -> StateT s m b -> StateT s m b #

(<*) :: StateT s m a -> StateT s m b -> StateT s m a #

Applicative f => Applicative (Backwards f)

Apply f-actions in the reverse order.

Instance details

Defined in Control.Applicative.Backwards

Methods

pure :: a -> Backwards f a #

(<*>) :: Backwards f (a -> b) -> Backwards f a -> Backwards f b #

liftA2 :: (a -> b -> c) -> Backwards f a -> Backwards f b -> Backwards f c #

(*>) :: Backwards f a -> Backwards f b -> Backwards f b #

(<*) :: Backwards f a -> Backwards f b -> Backwards f a #

Applicative (Mafic a b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> Mafic a b a0 #

(<*>) :: Mafic a b (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 #

liftA2 :: (a0 -> b0 -> c) -> Mafic a b a0 -> Mafic a b b0 -> Mafic a b c #

(*>) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b b0 #

(<*) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b a0 #

Applicative (Flows i b)

This is an illegal Applicative.

Instance details

Defined in Control.Lens.Internal.Level

Methods

pure :: a -> Flows i b a #

(<*>) :: Flows i b (a -> b0) -> Flows i b a -> Flows i b b0 #

liftA2 :: (a -> b0 -> c) -> Flows i b a -> Flows i b b0 -> Flows i b c #

(*>) :: Flows i b a -> Flows i b b0 -> Flows i b b0 #

(<*) :: Flows i b a -> Flows i b b0 -> Flows i b a #

Dim n => Applicative (V n) 
Instance details

Defined in Linear.V

Methods

pure :: a -> V n a #

(<*>) :: V n (a -> b) -> V n a -> V n b #

liftA2 :: (a -> b -> c) -> V n a -> V n b -> V n c #

(*>) :: V n a -> V n b -> V n b #

(<*) :: V n a -> V n b -> V n a #

Applicative m => Applicative (LoggingT message m) 
Instance details

Defined in Control.Monad.Log

Methods

pure :: a -> LoggingT message m a #

(<*>) :: LoggingT message m (a -> b) -> LoggingT message m a -> LoggingT message m b #

liftA2 :: (a -> b -> c) -> LoggingT message m a -> LoggingT message m b -> LoggingT message m c #

(*>) :: LoggingT message m a -> LoggingT message m b -> LoggingT message m b #

(<*) :: LoggingT message m a -> LoggingT message m b -> LoggingT message m a #

Monad m => Applicative (PureLoggingT log m) 
Instance details

Defined in Control.Monad.Log

Methods

pure :: a -> PureLoggingT log m a #

(<*>) :: PureLoggingT log m (a -> b) -> PureLoggingT log m a -> PureLoggingT log m b #

liftA2 :: (a -> b -> c) -> PureLoggingT log m a -> PureLoggingT log m b -> PureLoggingT log m c #

(*>) :: PureLoggingT log m a -> PureLoggingT log m b -> PureLoggingT log m b #

(<*) :: PureLoggingT log m a -> PureLoggingT log m b -> PureLoggingT log m a #

Applicative m => Applicative (DiscardLoggingT message m) 
Instance details

Defined in Control.Monad.Log

Methods

pure :: a -> DiscardLoggingT message m a #

(<*>) :: DiscardLoggingT message m (a -> b) -> DiscardLoggingT message m a -> DiscardLoggingT message m b #

liftA2 :: (a -> b -> c) -> DiscardLoggingT message m a -> DiscardLoggingT message m b -> DiscardLoggingT message m c #

(*>) :: DiscardLoggingT message m a -> DiscardLoggingT message m b -> DiscardLoggingT message m b #

(<*) :: DiscardLoggingT message m a -> DiscardLoggingT message m b -> DiscardLoggingT message m a #

(Monoid w, Applicative m) => Applicative (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

pure :: a -> WriterT w m a #

(<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b #

liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c #

(*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #

(<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a #

(Functor m, Monad m) => Applicative (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

pure :: a -> StateT s m a #

(<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b #

liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c #

(*>) :: StateT s m a -> StateT s m b -> StateT s m b #

(<*) :: StateT s m a -> StateT s m b -> StateT s m a #

(Monoid w, Applicative m) => Applicative (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

pure :: a -> WriterT w m a #

(<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b #

liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c #

(*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #

(<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a #

(Profunctor p, Arrow p) => Applicative (Tambara p a) 
Instance details

Defined in Data.Profunctor.Strong

Methods

pure :: a0 -> Tambara p a a0 #

(<*>) :: Tambara p a (a0 -> b) -> Tambara p a a0 -> Tambara p a b #

liftA2 :: (a0 -> b -> c) -> Tambara p a a0 -> Tambara p a b -> Tambara p a c #

(*>) :: Tambara p a a0 -> Tambara p a b -> Tambara p a b #

(<*) :: Tambara p a a0 -> Tambara p a b -> Tambara p a a0 #

Applicative f => Applicative (Star f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

pure :: a0 -> Star f a a0 #

(<*>) :: Star f a (a0 -> b) -> Star f a a0 -> Star f a b #

liftA2 :: (a0 -> b -> c) -> Star f a a0 -> Star f a b -> Star f a c #

(*>) :: Star f a a0 -> Star f a b -> Star f a b #

(<*) :: Star f a a0 -> Star f a b -> Star f a a0 #

Applicative (Costar f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

pure :: a0 -> Costar f a a0 #

(<*>) :: Costar f a (a0 -> b) -> Costar f a a0 -> Costar f a b #

liftA2 :: (a0 -> b -> c) -> Costar f a a0 -> Costar f a b -> Costar f a c #

(*>) :: Costar f a a0 -> Costar f a b -> Costar f a b #

(<*) :: Costar f a a0 -> Costar f a b -> Costar f a a0 #

Applicative (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

pure :: a -> Tagged s a #

(<*>) :: Tagged s (a -> b) -> Tagged s a -> Tagged s b #

liftA2 :: (a -> b -> c) -> Tagged s a -> Tagged s b -> Tagged s c #

(*>) :: Tagged s a -> Tagged s b -> Tagged s b #

(<*) :: Tagged s a -> Tagged s b -> Tagged s a #

Applicative f => Applicative (Reverse f)

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

pure :: a -> Reverse f a #

(<*>) :: Reverse f (a -> b) -> Reverse f a -> Reverse f b #

liftA2 :: (a -> b -> c) -> Reverse f a -> Reverse f b -> Reverse f c #

(*>) :: Reverse f a -> Reverse f b -> Reverse f b #

(<*) :: Reverse f a -> Reverse f b -> Reverse f a #

Applicative (Mag a b) 
Instance details

Defined in Data.Biapplicative

Methods

pure :: a0 -> Mag a b a0 #

(<*>) :: Mag a b (a0 -> b0) -> Mag a b a0 -> Mag a b b0 #

liftA2 :: (a0 -> b0 -> c) -> Mag a b a0 -> Mag a b b0 -> Mag a b c #

(*>) :: Mag a b a0 -> Mag a b b0 -> Mag a b b0 #

(<*) :: Mag a b a0 -> Mag a b b0 -> Mag a b a0 #

Monoid m => Applicative (Holes t m) 
Instance details

Defined in Control.Lens.Traversal

Methods

pure :: a -> Holes t m a #

(<*>) :: Holes t m (a -> b) -> Holes t m a -> Holes t m b #

liftA2 :: (a -> b -> c) -> Holes t m a -> Holes t m b -> Holes t m c #

(*>) :: Holes t m a -> Holes t m b -> Holes t m b #

(<*) :: Holes t m a -> Holes t m b -> Holes t m a #

Applicative ((->) a :: Type -> Type)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a0 -> a -> a0 #

(<*>) :: (a -> (a0 -> b)) -> (a -> a0) -> a -> b #

liftA2 :: (a0 -> b -> c) -> (a -> a0) -> (a -> b) -> a -> c #

(*>) :: (a -> a0) -> (a -> b) -> a -> b #

(<*) :: (a -> a0) -> (a -> b) -> a -> a0 #

Monoid c => Applicative (K1 i c :: Type -> Type)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> K1 i c a #

(<*>) :: K1 i c (a -> b) -> K1 i c a -> K1 i c b #

liftA2 :: (a -> b -> c0) -> K1 i c a -> K1 i c b -> K1 i c c0 #

(*>) :: K1 i c a -> K1 i c b -> K1 i c b #

(<*) :: K1 i c a -> K1 i c b -> K1 i c a #

(Applicative f, Applicative g) => Applicative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> (f :*: g) a #

(<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b #

liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c #

(*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #

(<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a #

(Applicative f, Applicative g) => Applicative (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

pure :: a -> Product f g a #

(<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b #

liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c #

(*>) :: Product f g a -> Product f g b -> Product f g b #

(<*) :: Product f g a -> Product f g b -> Product f g a #

(Monad f, Applicative f) => Applicative (WhenMatched f x y)

Equivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMatched f x y a #

(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b #

liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c #

(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b #

(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a #

(Applicative f, Monad f) => Applicative (WhenMissing f k x)

Equivalent to ReaderT k (ReaderT x (MaybeT f)) .

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMissing f k x a #

(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b #

liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c #

(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b #

(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a #

Applicative (Bazaar p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: a0 -> Bazaar p a b a0 #

(<*>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 #

liftA2 :: (a0 -> b0 -> c) -> Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b c #

(*>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 #

(<*) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 #

Applicative (Molten i a b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> Molten i a b a0 #

(<*>) :: Molten i a b (a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 #

liftA2 :: (a0 -> b0 -> c) -> Molten i a b a0 -> Molten i a b b0 -> Molten i a b c #

(*>) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b b0 #

(<*) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b a0 #

Applicative m => Applicative (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

pure :: a -> ReaderT r m a #

(<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b #

liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c #

(*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #

(<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a #

Applicative (ContT r m) 
Instance details

Defined in Control.Monad.Trans.Cont

Methods

pure :: a -> ContT r m a #

(<*>) :: ContT r m (a -> b) -> ContT r m a -> ContT r m b #

liftA2 :: (a -> b -> c) -> ContT r m a -> ContT r m b -> ContT r m c #

(*>) :: ContT r m a -> ContT r m b -> ContT r m b #

(<*) :: ContT r m a -> ContT r m b -> ContT r m a #

Applicative (ParsecT s u m) 
Instance details

Defined in Text.Parsec.Prim

Methods

pure :: a -> ParsecT s u m a #

(<*>) :: ParsecT s u m (a -> b) -> ParsecT s u m a -> ParsecT s u m b #

liftA2 :: (a -> b -> c) -> ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m c #

(*>) :: ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m b #

(<*) :: ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m a #

Applicative f => Applicative (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> M1 i c f a #

(<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b #

liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 #

(*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b #

(<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a #

(Applicative f, Applicative g) => Applicative (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> (f :.: g) a #

(<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b #

liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c #

(*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b #

(<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a #

(Applicative f, Applicative g) => Applicative (Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

pure :: a -> Compose f g a #

(<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b #

liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c #

(*>) :: Compose f g a -> Compose f g b -> Compose f g b #

(<*) :: Compose f g a -> Compose f g b -> Compose f g a #

(Monad f, Applicative f) => Applicative (WhenMatched f k x y)

Equivalent to ReaderT k (ReaderT x (ReaderT y (MaybeT f)))

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMatched f k x y a #

(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b #

liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c #

(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b #

(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a #

(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

pure :: a -> RWST r w s m a #

(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b #

liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c #

(*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #

(<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a #

Applicative (TakingWhile p f a b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> TakingWhile p f a b a0 #

(<*>) :: TakingWhile p f a b (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 #

liftA2 :: (a0 -> b0 -> c) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b c #

(*>) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b b0 #

(<*) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 #

Applicative (BazaarT p g a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: a0 -> BazaarT p g a b a0 #

(<*>) :: BazaarT p g a b (a0 -> b0) -> BazaarT p g a b a0 -> BazaarT p g a b b0 #

liftA2 :: (a0 -> b0 -> c) -> BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b c #

(*>) :: BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b b0 #

(<*) :: BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b a0 #

(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

pure :: a -> RWST r w s m a #

(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b #

liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c #

(*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #

(<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a #

Reifies s (ReifiedApplicative f) => Applicative (ReflectedApplicative f s) 
Instance details

Defined in Data.Reflection

Monad state => Applicative (Builder collection mutCollection step state err) 
Instance details

Defined in Basement.MutableBuilder

Methods

pure :: a -> Builder collection mutCollection step state err a #

(<*>) :: Builder collection mutCollection step state err (a -> b) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b #

liftA2 :: (a -> b -> c) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err c #

(*>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b #

(<*) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err a #

class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where #

Functors representing data structures that can be traversed from left to right.

A definition of traverse must satisfy the following laws:

naturality
t . traverse f = traverse (t . f) for every applicative transformation t
identity
traverse Identity = Identity
composition
traverse (Compose . fmap g . f) = Compose . fmap (traverse g) . traverse f

A definition of sequenceA must satisfy the following laws:

naturality
t . sequenceA = sequenceA . fmap t for every applicative transformation t
identity
sequenceA . fmap Identity = Identity
composition
sequenceA . fmap Compose = Compose . fmap sequenceA . sequenceA

where an applicative transformation is a function

t :: (Applicative f, Applicative g) => f a -> g a

preserving the Applicative operations, i.e.

and the identity functor Identity and composition of functors Compose are defined as

  newtype Identity a = Identity a

  instance Functor Identity where
    fmap f (Identity x) = Identity (f x)

  instance Applicative Identity where
    pure x = Identity x
    Identity f <*> Identity x = Identity (f x)

  newtype Compose f g a = Compose (f (g a))

  instance (Functor f, Functor g) => Functor (Compose f g) where
    fmap f (Compose x) = Compose (fmap (fmap f) x)

  instance (Applicative f, Applicative g) => Applicative (Compose f g) where
    pure x = Compose (pure (pure x))
    Compose f <*> Compose x = Compose ((<*>) <$> f <*> x)

(The naturality law is implied by parametricity.)

Instances are similar to Functor, e.g. given a data type

data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

instance Traversable Tree where
   traverse f Empty = pure Empty
   traverse f (Leaf x) = Leaf <$> f x
   traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r

This is suitable even for abstract types, as the laws for <*> imply a form of associativity.

The superclass instances should satisfy the following:

Minimal complete definition

traverse | sequenceA

Methods

traverse :: Applicative f => (a -> f b) -> t a -> f (t b) #

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see traverse_.

Instances
Traversable []

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> [a] -> f [b] #

sequenceA :: Applicative f => [f a] -> f [a] #

mapM :: Monad m => (a -> m b) -> [a] -> m [b] #

sequence :: Monad m => [m a] -> m [a] #

Traversable Maybe

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) #

sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) #

mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) #

sequence :: Monad m => Maybe (m a) -> m (Maybe a) #

Traversable Par1

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) #

sequenceA :: Applicative f => Par1 (f a) -> f (Par1 a) #

mapM :: Monad m => (a -> m b) -> Par1 a -> m (Par1 b) #

sequence :: Monad m => Par1 (m a) -> m (Par1 a) #

Traversable Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) #

sequenceA :: Applicative f => Identity (f a) -> f (Identity a) #

mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) #

sequence :: Monad m => Identity (m a) -> m (Identity a) #

Traversable ZipList

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) #

sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) #

mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) #

sequence :: Monad m => ZipList (m a) -> m (ZipList a) #

Traversable IResult 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

traverse :: Applicative f => (a -> f b) -> IResult a -> f (IResult b) #

sequenceA :: Applicative f => IResult (f a) -> f (IResult a) #

mapM :: Monad m => (a -> m b) -> IResult a -> m (IResult b) #

sequence :: Monad m => IResult (m a) -> m (IResult a) #

Traversable Result 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Result a -> f (Result b) #

sequenceA :: Applicative f => Result (f a) -> f (Result a) #

mapM :: Monad m => (a -> m b) -> Result a -> m (Result b) #

sequence :: Monad m => Result (m a) -> m (Result a) #

Traversable Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) #

sequenceA :: Applicative f => Complex (f a) -> f (Complex a) #

mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) #

sequence :: Monad m => Complex (m a) -> m (Complex a) #

Traversable Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) #

sequenceA :: Applicative f => Min (f a) -> f (Min a) #

mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) #

sequence :: Monad m => Min (m a) -> m (Min a) #

Traversable Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) #

sequenceA :: Applicative f => Max (f a) -> f (Max a) #

mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) #

sequence :: Monad m => Max (m a) -> m (Max a) #

Traversable First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) #

sequenceA :: Applicative f => First (f a) -> f (First a) #

mapM :: Monad m => (a -> m b) -> First a -> m (First b) #

sequence :: Monad m => First (m a) -> m (First a) #

Traversable Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) #

sequenceA :: Applicative f => Last (f a) -> f (Last a) #

mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) #

sequence :: Monad m => Last (m a) -> m (Last a) #

Traversable Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Option a -> f (Option b) #

sequenceA :: Applicative f => Option (f a) -> f (Option a) #

mapM :: Monad m => (a -> m b) -> Option a -> m (Option b) #

sequence :: Monad m => Option (m a) -> m (Option a) #

Traversable First

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) #

sequenceA :: Applicative f => First (f a) -> f (First a) #

mapM :: Monad m => (a -> m b) -> First a -> m (First b) #

sequence :: Monad m => First (m a) -> m (First a) #

Traversable Last

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) #

sequenceA :: Applicative f => Last (f a) -> f (Last a) #

mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) #

sequence :: Monad m => Last (m a) -> m (Last a) #

Traversable Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) #

sequenceA :: Applicative f => Dual (f a) -> f (Dual a) #

mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) #

sequence :: Monad m => Dual (m a) -> m (Dual a) #

Traversable Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) #

sequenceA :: Applicative f => Sum (f a) -> f (Sum a) #

mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) #

sequence :: Monad m => Sum (m a) -> m (Sum a) #

Traversable Product

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) #

sequenceA :: Applicative f => Product (f a) -> f (Product a) #

mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) #

sequence :: Monad m => Product (m a) -> m (Product a) #

Traversable Down

Since: base-4.12.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Down a -> f (Down b) #

sequenceA :: Applicative f => Down (f a) -> f (Down a) #

mapM :: Monad m => (a -> m b) -> Down a -> m (Down b) #

sequence :: Monad m => Down (m a) -> m (Down a) #

Traversable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #

sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #

mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) #

sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #

Traversable Vector 
Instance details

Defined in Data.Vector

Methods

traverse :: Applicative f => (a -> f b) -> Vector a -> f (Vector b) #

sequenceA :: Applicative f => Vector (f a) -> f (Vector a) #

mapM :: Monad m => (a -> m b) -> Vector a -> m (Vector b) #

sequence :: Monad m => Vector (m a) -> m (Vector a) #

Traversable IntMap 
Instance details

Defined in Data.IntMap.Internal

Methods

traverse :: Applicative f => (a -> f b) -> IntMap a -> f (IntMap b) #

sequenceA :: Applicative f => IntMap (f a) -> f (IntMap a) #

mapM :: Monad m => (a -> m b) -> IntMap a -> m (IntMap b) #

sequence :: Monad m => IntMap (m a) -> m (IntMap a) #

Traversable Tree 
Instance details

Defined in Data.Tree

Methods

traverse :: Applicative f => (a -> f b) -> Tree a -> f (Tree b) #

sequenceA :: Applicative f => Tree (f a) -> f (Tree a) #

mapM :: Monad m => (a -> m b) -> Tree a -> m (Tree b) #

sequence :: Monad m => Tree (m a) -> m (Tree a) #

Traversable Seq 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Seq a -> f (Seq b) #

sequenceA :: Applicative f => Seq (f a) -> f (Seq a) #

mapM :: Monad m => (a -> m b) -> Seq a -> m (Seq b) #

sequence :: Monad m => Seq (m a) -> m (Seq a) #

Traversable FingerTree 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> FingerTree a -> f (FingerTree b) #

sequenceA :: Applicative f => FingerTree (f a) -> f (FingerTree a) #

mapM :: Monad m => (a -> m b) -> FingerTree a -> m (FingerTree b) #

sequence :: Monad m => FingerTree (m a) -> m (FingerTree a) #

Traversable Digit 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Digit a -> f (Digit b) #

sequenceA :: Applicative f => Digit (f a) -> f (Digit a) #

mapM :: Monad m => (a -> m b) -> Digit a -> m (Digit b) #

sequence :: Monad m => Digit (m a) -> m (Digit a) #

Traversable Node 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Node a -> f (Node b) #

sequenceA :: Applicative f => Node (f a) -> f (Node a) #

mapM :: Monad m => (a -> m b) -> Node a -> m (Node b) #

sequence :: Monad m => Node (m a) -> m (Node a) #

Traversable Elem 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Elem a -> f (Elem b) #

sequenceA :: Applicative f => Elem (f a) -> f (Elem a) #

mapM :: Monad m => (a -> m b) -> Elem a -> m (Elem b) #

sequence :: Monad m => Elem (m a) -> m (Elem a) #

Traversable ViewL 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> ViewL a -> f (ViewL b) #

sequenceA :: Applicative f => ViewL (f a) -> f (ViewL a) #

mapM :: Monad m => (a -> m b) -> ViewL a -> m (ViewL b) #

sequence :: Monad m => ViewL (m a) -> m (ViewL a) #

Traversable ViewR 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> ViewR a -> f (ViewR b) #

sequenceA :: Applicative f => ViewR (f a) -> f (ViewR a) #

mapM :: Monad m => (a -> m b) -> ViewR a -> m (ViewR b) #

sequence :: Monad m => ViewR (m a) -> m (ViewR a) #

Traversable Recommend 
Instance details

Defined in Data.Monoid.Recommend

Methods

traverse :: Applicative f => (a -> f b) -> Recommend a -> f (Recommend b) #

sequenceA :: Applicative f => Recommend (f a) -> f (Recommend a) #

mapM :: Monad m => (a -> m b) -> Recommend a -> m (Recommend b) #

sequence :: Monad m => Recommend (m a) -> m (Recommend a) #

Traversable V2 
Instance details

Defined in Linear.V2

Methods

traverse :: Applicative f => (a -> f b) -> V2 a -> f (V2 b) #

sequenceA :: Applicative f => V2 (f a) -> f (V2 a) #

mapM :: Monad m => (a -> m b) -> V2 a -> m (V2 b) #

sequence :: Monad m => V2 (m a) -> m (V2 a) #

Traversable V3 
Instance details

Defined in Linear.V3

Methods

traverse :: Applicative f => (a -> f b) -> V3 a -> f (V3 b) #

sequenceA :: Applicative f => V3 (f a) -> f (V3 a) #

mapM :: Monad m => (a -> m b) -> V3 a -> m (V3 b) #

sequence :: Monad m => V3 (m a) -> m (V3 a) #

Traversable HistoriedResponse 
Instance details

Defined in Network.HTTP.Client

Methods

traverse :: Applicative f => (a -> f b) -> HistoriedResponse a -> f (HistoriedResponse b) #

sequenceA :: Applicative f => HistoriedResponse (f a) -> f (HistoriedResponse a) #

mapM :: Monad m => (a -> m b) -> HistoriedResponse a -> m (HistoriedResponse b) #

sequence :: Monad m => HistoriedResponse (m a) -> m (HistoriedResponse a) #

Traversable Response 
Instance details

Defined in Network.HTTP.Client.Types

Methods

traverse :: Applicative f => (a -> f b) -> Response a -> f (Response b) #

sequenceA :: Applicative f => Response (f a) -> f (Response a) #

mapM :: Monad m => (a -> m b) -> Response a -> m (Response b) #

sequence :: Monad m => Response (m a) -> m (Response a) #

Traversable Interval 
Instance details

Defined in Numeric.Interval.Kaucher

Methods

traverse :: Applicative f => (a -> f b) -> Interval a -> f (Interval b) #

sequenceA :: Applicative f => Interval (f a) -> f (Interval a) #

mapM :: Monad m => (a -> m b) -> Interval a -> m (Interval b) #

sequence :: Monad m => Interval (m a) -> m (Interval a) #

Traversable Plucker 
Instance details

Defined in Linear.Plucker

Methods

traverse :: Applicative f => (a -> f b) -> Plucker a -> f (Plucker b) #

sequenceA :: Applicative f => Plucker (f a) -> f (Plucker a) #

mapM :: Monad m => (a -> m b) -> Plucker a -> m (Plucker b) #

sequence :: Monad m => Plucker (m a) -> m (Plucker a) #

Traversable Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

traverse :: Applicative f => (a -> f b) -> Quaternion a -> f (Quaternion b) #

sequenceA :: Applicative f => Quaternion (f a) -> f (Quaternion a) #

mapM :: Monad m => (a -> m b) -> Quaternion a -> m (Quaternion b) #

sequence :: Monad m => Quaternion (m a) -> m (Quaternion a) #

Traversable V0 
Instance details

Defined in Linear.V0

Methods

traverse :: Applicative f => (a -> f b) -> V0 a -> f (V0 b) #

sequenceA :: Applicative f => V0 (f a) -> f (V0 a) #

mapM :: Monad m => (a -> m b) -> V0 a -> m (V0 b) #

sequence :: Monad m => V0 (m a) -> m (V0 a) #

Traversable V4 
Instance details

Defined in Linear.V4

Methods

traverse :: Applicative f => (a -> f b) -> V4 a -> f (V4 b) #

sequenceA :: Applicative f => V4 (f a) -> f (V4 a) #

mapM :: Monad m => (a -> m b) -> V4 a -> m (V4 b) #

sequence :: Monad m => V4 (m a) -> m (V4 a) #

Traversable V1 
Instance details

Defined in Linear.V1

Methods

traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) #

sequenceA :: Applicative f => V1 (f a) -> f (V1 a) #

mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) #

sequence :: Monad m => V1 (m a) -> m (V1 a) #

Traversable WithSeverity 
Instance details

Defined in Control.Monad.Log

Methods

traverse :: Applicative f => (a -> f b) -> WithSeverity a -> f (WithSeverity b) #

sequenceA :: Applicative f => WithSeverity (f a) -> f (WithSeverity a) #

mapM :: Monad m => (a -> m b) -> WithSeverity a -> m (WithSeverity b) #

sequence :: Monad m => WithSeverity (m a) -> m (WithSeverity a) #

Traversable WithTimestamp 
Instance details

Defined in Control.Monad.Log

Methods

traverse :: Applicative f => (a -> f b) -> WithTimestamp a -> f (WithTimestamp b) #

sequenceA :: Applicative f => WithTimestamp (f a) -> f (WithTimestamp a) #

mapM :: Monad m => (a -> m b) -> WithTimestamp a -> m (WithTimestamp b) #

sequence :: Monad m => WithTimestamp (m a) -> m (WithTimestamp a) #

Traversable WithCallStack 
Instance details

Defined in Control.Monad.Log

Methods

traverse :: Applicative f => (a -> f b) -> WithCallStack a -> f (WithCallStack b) #

sequenceA :: Applicative f => WithCallStack (f a) -> f (WithCallStack a) #

mapM :: Monad m => (a -> m b) -> WithCallStack a -> m (WithCallStack b) #

sequence :: Monad m => WithCallStack (m a) -> m (WithCallStack a) #

Traversable Many 
Instance details

Defined in Text.Pandoc.Builder

Methods

traverse :: Applicative f => (a -> f b) -> Many a -> f (Many b) #

sequenceA :: Applicative f => Many (f a) -> f (Many a) #

mapM :: Monad m => (a -> m b) -> Many a -> m (Many b) #

sequence :: Monad m => Many (m a) -> m (Many a) #

Traversable SimpleDocStream

Transform a document based on its annotations, possibly leveraging Applicative effects.

Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

traverse :: Applicative f => (a -> f b) -> SimpleDocStream a -> f (SimpleDocStream b) #

sequenceA :: Applicative f => SimpleDocStream (f a) -> f (SimpleDocStream a) #

mapM :: Monad m => (a -> m b) -> SimpleDocStream a -> m (SimpleDocStream b) #

sequence :: Monad m => SimpleDocStream (m a) -> m (SimpleDocStream a) #

Traversable SmallArray 
Instance details

Defined in Data.Primitive.SmallArray

Methods

traverse :: Applicative f => (a -> f b) -> SmallArray a -> f (SmallArray b) #

sequenceA :: Applicative f => SmallArray (f a) -> f (SmallArray a) #

mapM :: Monad m => (a -> m b) -> SmallArray a -> m (SmallArray b) #

sequence :: Monad m => SmallArray (m a) -> m (SmallArray a) #

Traversable Array 
Instance details

Defined in Data.Primitive.Array

Methods

traverse :: Applicative f => (a -> f b) -> Array a -> f (Array b) #

sequenceA :: Applicative f => Array (f a) -> f (Array a) #

mapM :: Monad m => (a -> m b) -> Array a -> m (Array b) #

sequence :: Monad m => Array (m a) -> m (Array a) #

Traversable NamedDoc Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

traverse :: Applicative f => (a -> f b) -> NamedDoc a -> f (NamedDoc b) #

sequenceA :: Applicative f => NamedDoc (f a) -> f (NamedDoc a) #

mapM :: Monad m => (a -> m b) -> NamedDoc a -> m (NamedDoc b) #

sequence :: Monad m => NamedDoc (m a) -> m (NamedDoc a) #

Traversable (Either a)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) #

sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) #

mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) #

sequence :: Monad m => Either a (m a0) -> m (Either a a0) #

Traversable (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) #

sequenceA :: Applicative f => V1 (f a) -> f (V1 a) #

mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) #

sequence :: Monad m => V1 (m a) -> m (V1 a) #

Traversable (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> U1 a -> f (U1 b) #

sequenceA :: Applicative f => U1 (f a) -> f (U1 a) #

mapM :: Monad m => (a -> m b) -> U1 a -> m (U1 b) #

sequence :: Monad m => U1 (m a) -> m (U1 a) #

Traversable ((,) a)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a0 -> f b) -> (a, a0) -> f (a, b) #

sequenceA :: Applicative f => (a, f a0) -> f (a, a0) #

mapM :: Monad m => (a0 -> m b) -> (a, a0) -> m (a, b) #

sequence :: Monad m => (a, m a0) -> m (a, a0) #

Traversable (Map k) 
Instance details

Defined in Data.Map.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Map k a -> f (Map k b) #

sequenceA :: Applicative f => Map k (f a) -> f (Map k a) #

mapM :: Monad m => (a -> m b) -> Map k a -> m (Map k b) #

sequence :: Monad m => Map k (m a) -> m (Map k a) #

Traversable (HashMap k) 
Instance details

Defined in Data.HashMap.Base

Methods

traverse :: Applicative f => (a -> f b) -> HashMap k a -> f (HashMap k b) #

sequenceA :: Applicative f => HashMap k (f a) -> f (HashMap k a) #

mapM :: Monad m => (a -> m b) -> HashMap k a -> m (HashMap k b) #

sequence :: Monad m => HashMap k (m a) -> m (HashMap k a) #

Ix i => Traversable (Array i)

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Array i a -> f (Array i b) #

sequenceA :: Applicative f => Array i (f a) -> f (Array i a) #

mapM :: Monad m => (a -> m b) -> Array i a -> m (Array i b) #

sequence :: Monad m => Array i (m a) -> m (Array i a) #

Traversable (Arg a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) #

sequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) #

mapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) #

sequence :: Monad m => Arg a (m a0) -> m (Arg a a0) #

Traversable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

Traversable f => Traversable (Point f) 
Instance details

Defined in Linear.Affine

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Point f a -> f0 (Point f b) #

sequenceA :: Applicative f0 => Point f (f0 a) -> f0 (Point f a) #

mapM :: Monad m => (a -> m b) -> Point f a -> m (Point f b) #

sequence :: Monad m => Point f (m a) -> m (Point f a) #

Traversable f => Traversable (MaybeT f) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

traverse :: Applicative f0 => (a -> f0 b) -> MaybeT f a -> f0 (MaybeT f b) #

sequenceA :: Applicative f0 => MaybeT f (f0 a) -> f0 (MaybeT f a) #

mapM :: Monad m => (a -> m b) -> MaybeT f a -> m (MaybeT f b) #

sequence :: Monad m => MaybeT f (m a) -> m (MaybeT f a) #

Traversable (Level i) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

traverse :: Applicative f => (a -> f b) -> Level i a -> f (Level i b) #

sequenceA :: Applicative f => Level i (f a) -> f (Level i a) #

mapM :: Monad m => (a -> m b) -> Level i a -> m (Level i b) #

sequence :: Monad m => Level i (m a) -> m (Level i a) #

Traversable f => Traversable (Cofree f) 
Instance details

Defined in Control.Comonad.Cofree

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Cofree f a -> f0 (Cofree f b) #

sequenceA :: Applicative f0 => Cofree f (f0 a) -> f0 (Cofree f a) #

mapM :: Monad m => (a -> m b) -> Cofree f a -> m (Cofree f b) #

sequence :: Monad m => Cofree f (m a) -> m (Cofree f a) #

Traversable f => Traversable (Free f) 
Instance details

Defined in Control.Monad.Free

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Free f a -> f0 (Free f b) #

sequenceA :: Applicative f0 => Free f (f0 a) -> f0 (Free f a) #

mapM :: Monad m => (a -> m b) -> Free f a -> m (Free f b) #

sequence :: Monad m => Free f (m a) -> m (Free f a) #

Traversable f => Traversable (Yoneda f) 
Instance details

Defined in Data.Functor.Yoneda

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Yoneda f a -> f0 (Yoneda f b) #

sequenceA :: Applicative f0 => Yoneda f (f0 a) -> f0 (Yoneda f a) #

mapM :: Monad m => (a -> m b) -> Yoneda f a -> m (Yoneda f b) #

sequence :: Monad m => Yoneda f (m a) -> m (Yoneda f a) #

Traversable f => Traversable (ListT f) 
Instance details

Defined in Control.Monad.Trans.List

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ListT f a -> f0 (ListT f b) #

sequenceA :: Applicative f0 => ListT f (f0 a) -> f0 (ListT f a) #

mapM :: Monad m => (a -> m b) -> ListT f a -> m (ListT f b) #

sequence :: Monad m => ListT f (m a) -> m (ListT f a) #

Traversable f => Traversable (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) #

sequenceA :: Applicative f0 => Rec1 f (f0 a) -> f0 (Rec1 f a) #

mapM :: Monad m => (a -> m b) -> Rec1 f a -> m (Rec1 f b) #

sequence :: Monad m => Rec1 f (m a) -> m (Rec1 f a) #

Traversable (URec Char :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) #

sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) #

mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) #

sequence :: Monad m => URec Char (m a) -> m (URec Char a) #

Traversable (URec Double :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) #

sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) #

mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) #

sequence :: Monad m => URec Double (m a) -> m (URec Double a) #

Traversable (URec Float :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) #

sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) #

mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) #

sequence :: Monad m => URec Float (m a) -> m (URec Float a) #

Traversable (URec Int :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) #

sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) #

mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) #

sequence :: Monad m => URec Int (m a) -> m (URec Int a) #

Traversable (URec Word :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) #

sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) #

mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) #

sequence :: Monad m => URec Word (m a) -> m (URec Word a) #

Traversable (URec (Ptr ()) :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> URec (Ptr ()) a -> f (URec (Ptr ()) b) #

sequenceA :: Applicative f => URec (Ptr ()) (f a) -> f (URec (Ptr ()) a) #

mapM :: Monad m => (a -> m b) -> URec (Ptr ()) a -> m (URec (Ptr ()) b) #

sequence :: Monad m => URec (Ptr ()) (m a) -> m (URec (Ptr ()) a) #

Traversable f => Traversable (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

traverse :: Applicative f0 => (a -> f0 b) -> IdentityT f a -> f0 (IdentityT f b) #

sequenceA :: Applicative f0 => IdentityT f (f0 a) -> f0 (IdentityT f a) #

mapM :: Monad m => (a -> m b) -> IdentityT f a -> m (IdentityT f b) #

sequence :: Monad m => IdentityT f (m a) -> m (IdentityT f a) #

Traversable (Const m :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) #

sequenceA :: Applicative f => Const m (f a) -> f (Const m a) #

mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) #

sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #

Traversable f => Traversable (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Ap f a -> f0 (Ap f b) #

sequenceA :: Applicative f0 => Ap f (f0 a) -> f0 (Ap f a) #

mapM :: Monad m => (a -> m b) -> Ap f a -> m (Ap f b) #

sequence :: Monad m => Ap f (m a) -> m (Ap f a) #

Traversable f => Traversable (Alt f)

Since: base-4.12.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Alt f a -> f0 (Alt f b) #

sequenceA :: Applicative f0 => Alt f (f0 a) -> f0 (Alt f a) #

mapM :: Monad m => (a -> m b) -> Alt f a -> m (Alt f b) #

sequence :: Monad m => Alt f (m a) -> m (Alt f a) #

Bitraversable p => Traversable (Join p) 
Instance details

Defined in Data.Bifunctor.Join

Methods

traverse :: Applicative f => (a -> f b) -> Join p a -> f (Join p b) #

sequenceA :: Applicative f => Join p (f a) -> f (Join p a) #

mapM :: Monad m => (a -> m b) -> Join p a -> m (Join p b) #

sequence :: Monad m => Join p (m a) -> m (Join p a) #

Bitraversable p => Traversable (Fix p) 
Instance details

Defined in Data.Bifunctor.Fix

Methods

traverse :: Applicative f => (a -> f b) -> Fix p a -> f (Fix p b) #

sequenceA :: Applicative f => Fix p (f a) -> f (Fix p a) #

mapM :: Monad m => (a -> m b) -> Fix p a -> m (Fix p b) #

sequence :: Monad m => Fix p (m a) -> m (Fix p a) #

Traversable f => Traversable (ExceptT e f) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ExceptT e f a -> f0 (ExceptT e f b) #

sequenceA :: Applicative f0 => ExceptT e f (f0 a) -> f0 (ExceptT e f a) #

mapM :: Monad m => (a -> m b) -> ExceptT e f a -> m (ExceptT e f b) #

sequence :: Monad m => ExceptT e f (m a) -> m (ExceptT e f a) #

Traversable f => Traversable (FreeF f a) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> FreeF f a a0 -> f0 (FreeF f a b) #

sequenceA :: Applicative f0 => FreeF f a (f0 a0) -> f0 (FreeF f a a0) #

mapM :: Monad m => (a0 -> m b) -> FreeF f a a0 -> m (FreeF f a b) #

sequence :: Monad m => FreeF f a (m a0) -> m (FreeF f a a0) #

(Monad m, Traversable m, Traversable f) => Traversable (FreeT f m) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

traverse :: Applicative f0 => (a -> f0 b) -> FreeT f m a -> f0 (FreeT f m b) #

sequenceA :: Applicative f0 => FreeT f m (f0 a) -> f0 (FreeT f m a) #

mapM :: Monad m0 => (a -> m0 b) -> FreeT f m a -> m0 (FreeT f m b) #

sequence :: Monad m0 => FreeT f m (m0 a) -> m0 (FreeT f m a) #

Traversable f => Traversable (CofreeF f a) 
Instance details

Defined in Control.Comonad.Trans.Cofree

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> CofreeF f a a0 -> f0 (CofreeF f a b) #

sequenceA :: Applicative f0 => CofreeF f a (f0 a0) -> f0 (CofreeF f a a0) #

mapM :: Monad m => (a0 -> m b) -> CofreeF f a a0 -> m (CofreeF f a b) #

sequence :: Monad m => CofreeF f a (m a0) -> m (CofreeF f a a0) #

(Traversable f, Traversable w) => Traversable (CofreeT f w) 
Instance details

Defined in Control.Comonad.Trans.Cofree

Methods

traverse :: Applicative f0 => (a -> f0 b) -> CofreeT f w a -> f0 (CofreeT f w b) #

sequenceA :: Applicative f0 => CofreeT f w (f0 a) -> f0 (CofreeT f w a) #

mapM :: Monad m => (a -> m b) -> CofreeT f w a -> m (CofreeT f w b) #

sequence :: Monad m => CofreeT f w (m a) -> m (CofreeT f w a) #

Traversable f => Traversable (ErrorT e f) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ErrorT e f a -> f0 (ErrorT e f b) #

sequenceA :: Applicative f0 => ErrorT e f (f0 a) -> f0 (ErrorT e f a) #

mapM :: Monad m => (a -> m b) -> ErrorT e f a -> m (ErrorT e f b) #

sequence :: Monad m => ErrorT e f (m a) -> m (ErrorT e f a) #

Traversable f => Traversable (Backwards f)

Derived instance.

Instance details

Defined in Control.Applicative.Backwards

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Backwards f a -> f0 (Backwards f b) #

sequenceA :: Applicative f0 => Backwards f (f0 a) -> f0 (Backwards f a) #

mapM :: Monad m => (a -> m b) -> Backwards f a -> m (Backwards f b) #

sequence :: Monad m => Backwards f (m a) -> m (Backwards f a) #

Traversable f => Traversable (AlongsideLeft f b) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

traverse :: Applicative f0 => (a -> f0 b0) -> AlongsideLeft f b a -> f0 (AlongsideLeft f b b0) #

sequenceA :: Applicative f0 => AlongsideLeft f b (f0 a) -> f0 (AlongsideLeft f b a) #

mapM :: Monad m => (a -> m b0) -> AlongsideLeft f b a -> m (AlongsideLeft f b b0) #

sequence :: Monad m => AlongsideLeft f b (m a) -> m (AlongsideLeft f b a) #

Traversable f => Traversable (AlongsideRight f a) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> AlongsideRight f a a0 -> f0 (AlongsideRight f a b) #

sequenceA :: Applicative f0 => AlongsideRight f a (f0 a0) -> f0 (AlongsideRight f a a0) #

mapM :: Monad m => (a0 -> m b) -> AlongsideRight f a a0 -> m (AlongsideRight f a b) #

sequence :: Monad m => AlongsideRight f a (m a0) -> m (AlongsideRight f a a0) #

Traversable (V n) 
Instance details

Defined in Linear.V

Methods

traverse :: Applicative f => (a -> f b) -> V n a -> f (V n b) #

sequenceA :: Applicative f => V n (f a) -> f (V n a) #

mapM :: Monad m => (a -> m b) -> V n a -> m (V n b) #

sequence :: Monad m => V n (m a) -> m (V n a) #

Traversable f => Traversable (WriterT w f) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

traverse :: Applicative f0 => (a -> f0 b) -> WriterT w f a -> f0 (WriterT w f b) #

sequenceA :: Applicative f0 => WriterT w f (f0 a) -> f0 (WriterT w f a) #

mapM :: Monad m => (a -> m b) -> WriterT w f a -> m (WriterT w f b) #

sequence :: Monad m => WriterT w f (m a) -> m (WriterT w f a) #

Traversable f => Traversable (WriterT w f) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

traverse :: Applicative f0 => (a -> f0 b) -> WriterT w f a -> f0 (WriterT w f b) #

sequenceA :: Applicative f0 => WriterT w f (f0 a) -> f0 (WriterT w f a) #

mapM :: Monad m => (a -> m b) -> WriterT w f a -> m (WriterT w f b) #

sequence :: Monad m => WriterT w f (m a) -> m (WriterT w f a) #

Traversable (Forget r a) 
Instance details

Defined in Data.Profunctor.Types

Methods

traverse :: Applicative f => (a0 -> f b) -> Forget r a a0 -> f (Forget r a b) #

sequenceA :: Applicative f => Forget r a (f a0) -> f (Forget r a a0) #

mapM :: Monad m => (a0 -> m b) -> Forget r a a0 -> m (Forget r a b) #

sequence :: Monad m => Forget r a (m a0) -> m (Forget r a a0) #

Traversable (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

traverse :: Applicative f => (a -> f b) -> Tagged s a -> f (Tagged s b) #

sequenceA :: Applicative f => Tagged s (f a) -> f (Tagged s a) #

mapM :: Monad m => (a -> m b) -> Tagged s a -> m (Tagged s b) #

sequence :: Monad m => Tagged s (m a) -> m (Tagged s a) #

Traversable f => Traversable (Reverse f)

Traverse from right to left.

Instance details

Defined in Data.Functor.Reverse

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Reverse f a -> f0 (Reverse f b) #

sequenceA :: Applicative f0 => Reverse f (f0 a) -> f0 (Reverse f a) #

mapM :: Monad m => (a -> m b) -> Reverse f a -> m (Reverse f b) #

sequence :: Monad m => Reverse f (m a) -> m (Reverse f a) #

Traversable (K1 i c :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> K1 i c a -> f (K1 i c b) #

sequenceA :: Applicative f => K1 i c (f a) -> f (K1 i c a) #

mapM :: Monad m => (a -> m b) -> K1 i c a -> m (K1 i c b) #

sequence :: Monad m => K1 i c (m a) -> m (K1 i c a) #

(Traversable f, Traversable g) => Traversable (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #

sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((f :+: g) a) #

mapM :: Monad m => (a -> m b) -> (f :+: g) a -> m ((f :+: g) b) #

sequence :: Monad m => (f :+: g) (m a) -> m ((f :+: g) a) #

(Traversable f, Traversable g) => Traversable (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) #

mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) #

sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) #

(Traversable f, Traversable g) => Traversable (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) #

sequenceA :: Applicative f0 => Product f g (f0 a) -> f0 (Product f g a) #

mapM :: Monad m => (a -> m b) -> Product f g a -> m (Product f g b) #

sequence :: Monad m => Product f g (m a) -> m (Product f g a) #

Traversable (Magma i t b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

traverse :: Applicative f => (a -> f b0) -> Magma i t b a -> f (Magma i t b b0) #

sequenceA :: Applicative f => Magma i t b (f a) -> f (Magma i t b a) #

mapM :: Monad m => (a -> m b0) -> Magma i t b a -> m (Magma i t b b0) #

sequence :: Monad m => Magma i t b (m a) -> m (Magma i t b a) #

Traversable f => Traversable (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) #

sequenceA :: Applicative f0 => M1 i c f (f0 a) -> f0 (M1 i c f a) #

mapM :: Monad m => (a -> m b) -> M1 i c f a -> m (M1 i c f b) #

sequence :: Monad m => M1 i c f (m a) -> m (M1 i c f a) #

(Traversable f, Traversable g) => Traversable (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) #

sequenceA :: Applicative f0 => (f :.: g) (f0 a) -> f0 ((f :.: g) a) #

mapM :: Monad m => (a -> m b) -> (f :.: g) a -> m ((f :.: g) b) #

sequence :: Monad m => (f :.: g) (m a) -> m ((f :.: g) a) #

(Traversable f, Traversable g) => Traversable (Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) #

sequenceA :: Applicative f0 => Compose f g (f0 a) -> f0 (Compose f g a) #

mapM :: Monad m => (a -> m b) -> Compose f g a -> m (Compose f g b) #

sequence :: Monad m => Compose f g (m a) -> m (Compose f g a) #

Bitraversable p => Traversable (WrappedBifunctor p a) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

traverse :: Applicative f => (a0 -> f b) -> WrappedBifunctor p a a0 -> f (WrappedBifunctor p a b) #

sequenceA :: Applicative f => WrappedBifunctor p a (f a0) -> f (WrappedBifunctor p a a0) #

mapM :: Monad m => (a0 -> m b) -> WrappedBifunctor p a a0 -> m (WrappedBifunctor p a b) #

sequence :: Monad m => WrappedBifunctor p a (m a0) -> m (WrappedBifunctor p a a0) #

Traversable g => Traversable (Joker g a) 
Instance details

Defined in Data.Bifunctor.Joker

Methods

traverse :: Applicative f => (a0 -> f b) -> Joker g a a0 -> f (Joker g a b) #

sequenceA :: Applicative f => Joker g a (f a0) -> f (Joker g a a0) #

mapM :: Monad m => (a0 -> m b) -> Joker g a a0 -> m (Joker g a b) #

sequence :: Monad m => Joker g a (m a0) -> m (Joker g a a0) #

Bitraversable p => Traversable (Flip p a) 
Instance details

Defined in Data.Bifunctor.Flip

Methods

traverse :: Applicative f => (a0 -> f b) -> Flip p a a0 -> f (Flip p a b) #

sequenceA :: Applicative f => Flip p a (f a0) -> f (Flip p a a0) #

mapM :: Monad m => (a0 -> m b) -> Flip p a a0 -> m (Flip p a b) #

sequence :: Monad m => Flip p a (m a0) -> m (Flip p a a0) #

Traversable (Clown f a :: Type -> Type) 
Instance details

Defined in Data.Bifunctor.Clown

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> Clown f a a0 -> f0 (Clown f a b) #

sequenceA :: Applicative f0 => Clown f a (f0 a0) -> f0 (Clown f a a0) #

mapM :: Monad m => (a0 -> m b) -> Clown f a a0 -> m (Clown f a b) #

sequence :: Monad m => Clown f a (m a0) -> m (Clown f a a0) #

(Traversable f, Bitraversable p) => Traversable (Tannen f p a) 
Instance details

Defined in Data.Bifunctor.Tannen

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> Tannen f p a a0 -> f0 (Tannen f p a b) #

sequenceA :: Applicative f0 => Tannen f p a (f0 a0) -> f0 (Tannen f p a a0) #

mapM :: Monad m => (a0 -> m b) -> Tannen f p a a0 -> m (Tannen f p a b) #

sequence :: Monad m => Tannen f p a (m a0) -> m (Tannen f p a a0) #

(Bitraversable p, Traversable g) => Traversable (Biff p f g a) 
Instance details

Defined in Data.Bifunctor.Biff

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> Biff p f g a a0 -> f0 (Biff p f g a b) #

sequenceA :: Applicative f0 => Biff p f g a (f0 a0) -> f0 (Biff p f g a a0) #

mapM :: Monad m => (a0 -> m b) -> Biff p f g a a0 -> m (Biff p f g a b) #

sequence :: Monad m => Biff p f g a (m a0) -> m (Biff p f g a a0) #

class Semigroup a where #

The class of semigroups (types with an associative binary operation).

Instances should satisfy the associativity law:

Since: base-4.9.0.0

Minimal complete definition

(<>)

Methods

(<>) :: a -> a -> a infixr 6 #

An associative operation.

sconcat :: NonEmpty a -> a #

Reduce a non-empty list with <>

The default definition should be sufficient, but this can be overridden for efficiency.

stimes :: Integral b => b -> a -> a #

Repeat a value n times.

Given that this works on a Semigroup it is allowed to fail if you request 0 or fewer repetitions, and the default definition will do so.

By making this a member of the class, idempotent semigroups and monoids can upgrade this to execute in O(1) by picking stimes = stimesIdempotent or stimes = stimesIdempotentMonoid respectively.

Instances
Semigroup Ordering

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Semigroup ()

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: () -> () -> () #

sconcat :: NonEmpty () -> () #

stimes :: Integral b => b -> () -> () #

Semigroup ByteString 
Instance details

Defined in Data.ByteString.Internal

Semigroup ByteString 
Instance details

Defined in Data.ByteString.Lazy.Internal

Semigroup Builder 
Instance details

Defined in Data.Text.Internal.Builder

Semigroup More 
Instance details

Defined in Data.Attoparsec.Internal.Types

Methods

(<>) :: More -> More -> More #

sconcat :: NonEmpty More -> More #

stimes :: Integral b => b -> More -> More #

Semigroup Void

Since: base-4.9.0.0

Instance details

Defined in Data.Void

Methods

(<>) :: Void -> Void -> Void #

sconcat :: NonEmpty Void -> Void #

stimes :: Integral b => b -> Void -> Void #

Semigroup All

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: All -> All -> All #

sconcat :: NonEmpty All -> All #

stimes :: Integral b => b -> All -> All #

Semigroup Any

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Any -> Any -> Any #

sconcat :: NonEmpty Any -> Any #

stimes :: Integral b => b -> Any -> Any #

Semigroup String 
Instance details

Defined in Basement.UTF8.Base

Semigroup Attribute 
Instance details

Defined in Text.Blaze.Internal

Semigroup Cell 
Instance details

Defined in Text.Blaze.Colonnade

Methods

(<>) :: Cell -> Cell -> Cell #

sconcat :: NonEmpty Cell -> Cell #

stimes :: Integral b => b -> Cell -> Cell #

Semigroup AttributeValue 
Instance details

Defined in Text.Blaze.Internal

Semigroup ChoiceString 
Instance details

Defined in Text.Blaze.Internal

Semigroup IntSet

Since: containers-0.5.7

Instance details

Defined in Data.IntSet.Internal

Semigroup Name 
Instance details

Defined in Diagrams.Core.Names

Methods

(<>) :: Name -> Name -> Name #

sconcat :: NonEmpty Name -> Name #

stimes :: Integral b => b -> Name -> Name #

Semigroup Font 
Instance details

Defined in Diagrams.TwoD.Text

Methods

(<>) :: Font -> Font -> Font #

sconcat :: NonEmpty Font -> Font #

stimes :: Integral b => b -> Font -> Font #

Semigroup FontSlant 
Instance details

Defined in Diagrams.TwoD.Text

Semigroup FontWeight

Last semigroup structure

Instance details

Defined in Diagrams.TwoD.Text

Semigroup Crossings 
Instance details

Defined in Diagrams.TwoD.Path

Semigroup FillRule 
Instance details

Defined in Diagrams.TwoD.Path

Semigroup SegCount 
Instance details

Defined in Diagrams.Segment

Semigroup Highlight 
Instance details

Defined in Diagrams.ThreeD.Attributes

Semigroup SurfaceColor 
Instance details

Defined in Diagrams.ThreeD.Attributes

Semigroup Diffuse 
Instance details

Defined in Diagrams.ThreeD.Attributes

Semigroup Ambient 
Instance details

Defined in Diagrams.ThreeD.Attributes

Semigroup Opacity 
Instance details

Defined in Diagrams.Attributes

Semigroup FillOpacity 
Instance details

Defined in Diagrams.Attributes

Semigroup StrokeOpacity 
Instance details

Defined in Diagrams.Attributes

Semigroup LineCap

Last semigroup structure.

Instance details

Defined in Diagrams.Attributes

Semigroup LineJoin

Last semigroup structure.

Instance details

Defined in Diagrams.Attributes

Semigroup LineMiterLimit 
Instance details

Defined in Diagrams.Attributes

Semigroup Element 
Instance details

Defined in Graphics.Svg.Core

Semigroup CookieJar 
Instance details

Defined in Network.HTTP.Client.Types

Semigroup RequestBody 
Instance details

Defined in Network.HTTP.Client.Types

Semigroup Source 
Instance details

Defined in Data.Ipynb

Semigroup MimeBundle 
Instance details

Defined in Data.Ipynb

Semigroup Pandoc 
Instance details

Defined in Text.Pandoc.Definition

Semigroup Inlines 
Instance details

Defined in Text.Pandoc.Builder

Semigroup Meta 
Instance details

Defined in Text.Pandoc.Definition

Methods

(<>) :: Meta -> Meta -> Meta #

sconcat :: NonEmpty Meta -> Meta #

stimes :: Integral b => b -> Meta -> Meta #

Semigroup FileTree 
Instance details

Defined in Text.Pandoc.Class

Semigroup Translations 
Instance details

Defined in Text.Pandoc.Translations

Semigroup MediaBag 
Instance details

Defined in Text.Pandoc.MediaBag

Semigroup Extensions 
Instance details

Defined in Text.Pandoc.Extensions

Semigroup Doc 
Instance details

Defined in Text.PrettyPrint.HughesPJ

Methods

(<>) :: Doc -> Doc -> Doc #

sconcat :: NonEmpty Doc -> Doc #

stimes :: Integral b => b -> Doc -> Doc #

Semigroup ByteArray 
Instance details

Defined in Data.Primitive.ByteArray

Semigroup PandocWithRequirements Source # 
Instance details

Defined in Knit.Effect.Pandoc

Semigroup [a]

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: [a] -> [a] -> [a] #

sconcat :: NonEmpty [a] -> [a] #

stimes :: Integral b => b -> [a] -> [a] #

Semigroup a => Semigroup (Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: Maybe a -> Maybe a -> Maybe a #

sconcat :: NonEmpty (Maybe a) -> Maybe a #

stimes :: Integral b => b -> Maybe a -> Maybe a #

Semigroup a => Semigroup (IO a)

Since: base-4.10.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: IO a -> IO a -> IO a #

sconcat :: NonEmpty (IO a) -> IO a #

stimes :: Integral b => b -> IO a -> IO a #

Semigroup p => Semigroup (Par1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: Par1 p -> Par1 p -> Par1 p #

sconcat :: NonEmpty (Par1 p) -> Par1 p #

stimes :: Integral b => b -> Par1 p -> Par1 p #

Ord a => Semigroup (Set a)

Since: containers-0.5.7

Instance details

Defined in Data.Set.Internal

Methods

(<>) :: Set a -> Set a -> Set a #

sconcat :: NonEmpty (Set a) -> Set a #

stimes :: Integral b => b -> Set a -> Set a #

Semigroup a => Semigroup (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(<>) :: Identity a -> Identity a -> Identity a #

sconcat :: NonEmpty (Identity a) -> Identity a #

stimes :: Integral b => b -> Identity a -> Identity a #

Storable a => Semigroup (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

(<>) :: Vector a -> Vector a -> Vector a #

sconcat :: NonEmpty (Vector a) -> Vector a #

stimes :: Integral b => b -> Vector a -> Vector a #

Ord n => Semigroup (Era n) 
Instance details

Defined in Data.Active

Methods

(<>) :: Era n -> Era n -> Era n #

sconcat :: NonEmpty (Era n) -> Era n #

stimes :: Integral b => b -> Era n -> Era n #

Semigroup a => Semigroup (Dynamic a)

Dynamic a is a Semigroup whenever a is: the eras are combined according to their semigroup structure, and the values of type a are combined pointwise. Note that Dynamic a cannot be an instance of Monoid since Era is not.

Instance details

Defined in Data.Active

Methods

(<>) :: Dynamic a -> Dynamic a -> Dynamic a #

sconcat :: NonEmpty (Dynamic a) -> Dynamic a #

stimes :: Integral b => b -> Dynamic a -> Dynamic a #

Semigroup a => Semigroup (Active a)

Active values over a type with a Semigroup instance are also an instance of Semigroup. Two active values are combined pointwise; the resulting value is constant iff both inputs are.

Instance details

Defined in Data.Active

Methods

(<>) :: Active a -> Active a -> Active a #

sconcat :: NonEmpty (Active a) -> Active a #

stimes :: Integral b => b -> Active a -> Active a #

Num n => Semigroup (Duration n) 
Instance details

Defined in Data.Active

Methods

(<>) :: Duration n -> Duration n -> Duration n #

sconcat :: NonEmpty (Duration n) -> Duration n #

stimes :: Integral b => b -> Duration n -> Duration n #

Semigroup (IResult a) 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

(<>) :: IResult a -> IResult a -> IResult a #

sconcat :: NonEmpty (IResult a) -> IResult a #

stimes :: Integral b => b -> IResult a -> IResult a #

Semigroup (Result a) 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

(<>) :: Result a -> Result a -> Result a #

sconcat :: NonEmpty (Result a) -> Result a #

stimes :: Integral b => b -> Result a -> Result a #

Semigroup (Parser a) 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

(<>) :: Parser a -> Parser a -> Parser a #

sconcat :: NonEmpty (Parser a) -> Parser a #

stimes :: Integral b => b -> Parser a -> Parser a #

Semigroup (Predicate a) 
Instance details

Defined in Data.Functor.Contravariant

Methods

(<>) :: Predicate a -> Predicate a -> Predicate a #

sconcat :: NonEmpty (Predicate a) -> Predicate a #

stimes :: Integral b => b -> Predicate a -> Predicate a #

Semigroup (Comparison a) 
Instance details

Defined in Data.Functor.Contravariant

Semigroup (Equivalence a) 
Instance details

Defined in Data.Functor.Contravariant

Ord a => Semigroup (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Min a -> Min a -> Min a #

sconcat :: NonEmpty (Min a) -> Min a #

stimes :: Integral b => b -> Min a -> Min a #

Ord a => Semigroup (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Max a -> Max a -> Max a #

sconcat :: NonEmpty (Max a) -> Max a #

stimes :: Integral b => b -> Max a -> Max a #

Semigroup (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: First a -> First a -> First a #

sconcat :: NonEmpty (First a) -> First a #

stimes :: Integral b => b -> First a -> First a #

Semigroup (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Last a -> Last a -> Last a #

sconcat :: NonEmpty (Last a) -> Last a #

stimes :: Integral b => b -> Last a -> Last a #

Monoid m => Semigroup (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Semigroup a => Semigroup (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Option a -> Option a -> Option a #

sconcat :: NonEmpty (Option a) -> Option a #

stimes :: Integral b => b -> Option a -> Option a #

Semigroup (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: First a -> First a -> First a #

sconcat :: NonEmpty (First a) -> First a #

stimes :: Integral b => b -> First a -> First a #

Semigroup (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: Last a -> Last a -> Last a #

sconcat :: NonEmpty (Last a) -> Last a #

stimes :: Integral b => b -> Last a -> Last a #

Semigroup a => Semigroup (Dual a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Dual a -> Dual a -> Dual a #

sconcat :: NonEmpty (Dual a) -> Dual a #

stimes :: Integral b => b -> Dual a -> Dual a #

Semigroup (Endo a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Endo a -> Endo a -> Endo a #

sconcat :: NonEmpty (Endo a) -> Endo a #

stimes :: Integral b => b -> Endo a -> Endo a #

Num a => Semigroup (Sum a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Sum a -> Sum a -> Sum a #

sconcat :: NonEmpty (Sum a) -> Sum a #

stimes :: Integral b => b -> Sum a -> Sum a #

Num a => Semigroup (Product a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Product a -> Product a -> Product a #

sconcat :: NonEmpty (Product a) -> Product a #

stimes :: Integral b => b -> Product a -> Product a #

Semigroup a => Semigroup (Down a)

Since: base-4.11.0.0

Instance details

Defined in Data.Ord

Methods

(<>) :: Down a -> Down a -> Down a #

sconcat :: NonEmpty (Down a) -> Down a #

stimes :: Integral b => b -> Down a -> Down a #

Semigroup (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #

sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a #

stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #

PrimType ty => Semigroup (UArray ty) 
Instance details

Defined in Basement.UArray.Base

Methods

(<>) :: UArray ty -> UArray ty -> UArray ty #

sconcat :: NonEmpty (UArray ty) -> UArray ty #

stimes :: Integral b => b -> UArray ty -> UArray ty #

PrimType ty => Semigroup (Block ty) 
Instance details

Defined in Basement.Block.Base

Methods

(<>) :: Block ty -> Block ty -> Block ty #

sconcat :: NonEmpty (Block ty) -> Block ty #

stimes :: Integral b => b -> Block ty -> Block ty #

Semigroup (CountOf ty) 
Instance details

Defined in Basement.Types.OffsetSize

Methods

(<>) :: CountOf ty -> CountOf ty -> CountOf ty #

sconcat :: NonEmpty (CountOf ty) -> CountOf ty #

stimes :: Integral b => b -> CountOf ty -> CountOf ty #

Monoid a => Semigroup (MarkupM a) 
Instance details

Defined in Text.Blaze.Internal

Methods

(<>) :: MarkupM a -> MarkupM a -> MarkupM a #

sconcat :: NonEmpty (MarkupM a) -> MarkupM a #

stimes :: Integral b => b -> MarkupM a -> MarkupM a #

Semigroup s => Semigroup (CI s) 
Instance details

Defined in Data.CaseInsensitive.Internal

Methods

(<>) :: CI s -> CI s -> CI s #

sconcat :: NonEmpty (CI s) -> CI s #

stimes :: Integral b => b -> CI s -> CI s #

Semigroup (Vector a) 
Instance details

Defined in Data.Vector

Methods

(<>) :: Vector a -> Vector a -> Vector a #

sconcat :: NonEmpty (Vector a) -> Vector a #

stimes :: Integral b => b -> Vector a -> Vector a #

Num a => Semigroup (TransferFunction a) 
Instance details

Defined in Data.Colour.RGBSpace

Num a => Semigroup (Colour a) 
Instance details

Defined in Data.Colour.Internal

Methods

(<>) :: Colour a -> Colour a -> Colour a #

sconcat :: NonEmpty (Colour a) -> Colour a #

stimes :: Integral b => b -> Colour a -> Colour a #

Num a => Semigroup (AlphaColour a)

AlphaColour forms a monoid with over and transparent.

Instance details

Defined in Data.Colour.Internal

Semigroup (IntMap a)

Since: containers-0.5.7

Instance details

Defined in Data.IntMap.Internal

Methods

(<>) :: IntMap a -> IntMap a -> IntMap a #

sconcat :: NonEmpty (IntMap a) -> IntMap a #

stimes :: Integral b => b -> IntMap a -> IntMap a #

Semigroup (Seq a)

Since: containers-0.5.7

Instance details

Defined in Data.Sequence.Internal

Methods

(<>) :: Seq a -> Seq a -> Seq a #

sconcat :: NonEmpty (Seq a) -> Seq a #

stimes :: Integral b => b -> Seq a -> Seq a #

Ord a => Semigroup (SortedList a)

SortedList forms a semigroup with merge as composition.

Instance details

Defined in Diagrams.Core.Trace

Semigroup t => Semigroup (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

(<>) :: TransInv t -> TransInv t -> TransInv t #

sconcat :: NonEmpty (TransInv t) -> TransInv t #

stimes :: Integral b => b -> TransInv t -> TransInv t #

Semigroup a => Semigroup (Recommend a)

Commit overrides Recommend. Two values wrapped in the same constructor (both Recommend or both Commit) are combined according to the underlying Semigroup instance.

Instance details

Defined in Data.Monoid.Recommend

Methods

(<>) :: Recommend a -> Recommend a -> Recommend a #

sconcat :: NonEmpty (Recommend a) -> Recommend a #

stimes :: Integral b => b -> Recommend a -> Recommend a #

Semigroup (FontSize n) 
Instance details

Defined in Diagrams.TwoD.Text

Methods

(<>) :: FontSize n -> FontSize n -> FontSize n #

sconcat :: NonEmpty (FontSize n) -> FontSize n #

stimes :: Integral b => b -> FontSize n -> FontSize n #

Semigroup (LineTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Semigroup (FillTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Semigroup (Clip n) 
Instance details

Defined in Diagrams.TwoD.Path

Methods

(<>) :: Clip n -> Clip n -> Clip n #

sconcat :: NonEmpty (Clip n) -> Clip n #

stimes :: Integral b => b -> Clip n -> Clip n #

(Num n, Ord n) => Semigroup (ArcLength n) 
Instance details

Defined in Diagrams.Segment

Methods

(<>) :: ArcLength n -> ArcLength n -> ArcLength n #

sconcat :: NonEmpty (ArcLength n) -> ArcLength n #

stimes :: Integral b => b -> ArcLength n -> ArcLength n #

Num n => Semigroup (Angle n) 
Instance details

Defined in Diagrams.Angle

Methods

(<>) :: Angle n -> Angle n -> Angle n #

sconcat :: NonEmpty (Angle n) -> Angle n #

stimes :: Integral b => b -> Angle n -> Angle n #

Semigroup (LineWidth n) 
Instance details

Defined in Diagrams.Attributes

Methods

(<>) :: LineWidth n -> LineWidth n -> LineWidth n #

sconcat :: NonEmpty (LineWidth n) -> LineWidth n #

stimes :: Integral b => b -> LineWidth n -> LineWidth n #

Semigroup (Dashing n) 
Instance details

Defined in Diagrams.Attributes

Methods

(<>) :: Dashing n -> Dashing n -> Dashing n #

sconcat :: NonEmpty (Dashing n) -> Dashing n #

stimes :: Integral b => b -> Dashing n -> Dashing n #

Semigroup (Rightmost a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Rightmost a -> Rightmost a -> Rightmost a #

sconcat :: NonEmpty (Rightmost a) -> Rightmost a #

stimes :: Integral b => b -> Rightmost a -> Rightmost a #

Semigroup (Leftmost a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Leftmost a -> Leftmost a -> Leftmost a #

sconcat :: NonEmpty (Leftmost a) -> Leftmost a #

stimes :: Integral b => b -> Leftmost a -> Leftmost a #

Semigroup (DList a) 
Instance details

Defined in Data.DList

Methods

(<>) :: DList a -> DList a -> DList a #

sconcat :: NonEmpty (DList a) -> DList a #

stimes :: Integral b => b -> DList a -> DList a #

Semigroup (Notebook a) 
Instance details

Defined in Data.Ipynb

Methods

(<>) :: Notebook a -> Notebook a -> Notebook a #

sconcat :: NonEmpty (Notebook a) -> Notebook a #

stimes :: Integral b => b -> Notebook a -> Notebook a #

Prim a => Semigroup (Vector a) 
Instance details

Defined in Data.Vector.Primitive

Methods

(<>) :: Vector a -> Vector a -> Vector a #

sconcat :: NonEmpty (Vector a) -> Vector a #

stimes :: Integral b => b -> Vector a -> Vector a #

(Hashable a, Eq a) => Semigroup (HashSet a) 
Instance details

Defined in Data.HashSet.Base

Methods

(<>) :: HashSet a -> HashSet a -> HashSet a #

sconcat :: NonEmpty (HashSet a) -> HashSet a #

stimes :: Integral b => b -> HashSet a -> HashSet a #

Ord a => Semigroup (Min a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Min a -> Min a -> Min a #

sconcat :: NonEmpty (Min a) -> Min a #

stimes :: Integral b => b -> Min a -> Min a #

Ord a => Semigroup (Max a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Max a -> Max a -> Max a #

sconcat :: NonEmpty (Max a) -> Max a #

stimes :: Integral b => b -> Max a -> Max a #

Semigroup (NonEmptyDList a) 
Instance details

Defined in Control.Lens.Internal.Fold

Semigroup (Doc ann)
x <> y = hcat [x, y]
>>> "hello" <> "world" :: Doc ann
helloworld
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

(<>) :: Doc ann -> Doc ann -> Doc ann #

sconcat :: NonEmpty (Doc ann) -> Doc ann #

stimes :: Integral b => b -> Doc ann -> Doc ann #

Semigroup (Many Block) 
Instance details

Defined in Text.Pandoc.Builder

Semigroup (Doc a) 
Instance details

Defined in Text.PrettyPrint.Annotated.HughesPJ

Methods

(<>) :: Doc a -> Doc a -> Doc a #

sconcat :: NonEmpty (Doc a) -> Doc a #

stimes :: Integral b => b -> Doc a -> Doc a #

PrimUnlifted a => Semigroup (UnliftedArray a)

Since: primitive-0.6.4.0

Instance details

Defined in Data.Primitive.UnliftedArray

Semigroup (PrimArray a)

Since: primitive-0.6.4.0

Instance details

Defined in Data.Primitive.PrimArray

Methods

(<>) :: PrimArray a -> PrimArray a -> PrimArray a #

sconcat :: NonEmpty (PrimArray a) -> PrimArray a #

stimes :: Integral b => b -> PrimArray a -> PrimArray a #

Semigroup (SmallArray a)

Since: primitive-0.6.3.0

Instance details

Defined in Data.Primitive.SmallArray

Semigroup (Array a)

Since: primitive-0.6.3.0

Instance details

Defined in Data.Primitive.Array

Methods

(<>) :: Array a -> Array a -> Array a #

sconcat :: NonEmpty (Array a) -> Array a #

stimes :: Integral b => b -> Array a -> Array a #

Semigroup (MergeSet a) 
Instance details

Defined in Data.Set.Internal

Methods

(<>) :: MergeSet a -> MergeSet a -> MergeSet a #

sconcat :: NonEmpty (MergeSet a) -> MergeSet a #

stimes :: Integral b => b -> MergeSet a -> MergeSet a #

Applicative m => Semigroup (Ap m) 
Instance details

Defined in Control.Monad.Log

Methods

(<>) :: Ap m -> Ap m -> Ap m #

sconcat :: NonEmpty (Ap m) -> Ap m #

stimes :: Integral b => b -> Ap m -> Ap m #

Semigroup b => Semigroup (a -> b)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a -> b) -> (a -> b) -> a -> b #

sconcat :: NonEmpty (a -> b) -> a -> b #

stimes :: Integral b0 => b0 -> (a -> b) -> a -> b #

Semigroup (Either a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Either

Methods

(<>) :: Either a b -> Either a b -> Either a b #

sconcat :: NonEmpty (Either a b) -> Either a b #

stimes :: Integral b0 => b0 -> Either a b -> Either a b #

Semigroup (V1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: V1 p -> V1 p -> V1 p #

sconcat :: NonEmpty (V1 p) -> V1 p #

stimes :: Integral b => b -> V1 p -> V1 p #

Semigroup (U1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: U1 p -> U1 p -> U1 p #

sconcat :: NonEmpty (U1 p) -> U1 p #

stimes :: Integral b => b -> U1 p -> U1 p #

(Semigroup a, Semigroup b) => Semigroup (a, b)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a, b) -> (a, b) -> (a, b) #

sconcat :: NonEmpty (a, b) -> (a, b) #

stimes :: Integral b0 => b0 -> (a, b) -> (a, b) #

Ord k => Semigroup (Map k v) 
Instance details

Defined in Data.Map.Internal

Methods

(<>) :: Map k v -> Map k v -> Map k v #

sconcat :: NonEmpty (Map k v) -> Map k v #

stimes :: Integral b => b -> Map k v -> Map k v #

Semigroup a => Semigroup (Op a b) 
Instance details

Defined in Data.Functor.Contravariant

Methods

(<>) :: Op a b -> Op a b -> Op a b #

sconcat :: NonEmpty (Op a b) -> Op a b #

stimes :: Integral b0 => b0 -> Op a b -> Op a b #

(Eq k, Hashable k) => Semigroup (HashMap k v) 
Instance details

Defined in Data.HashMap.Base

Methods

(<>) :: HashMap k v -> HashMap k v -> HashMap k v #

sconcat :: NonEmpty (HashMap k v) -> HashMap k v #

stimes :: Integral b => b -> HashMap k v -> HashMap k v #

Semigroup (Parser i a) 
Instance details

Defined in Data.Attoparsec.Internal.Types

Methods

(<>) :: Parser i a -> Parser i a -> Parser i a #

sconcat :: NonEmpty (Parser i a) -> Parser i a #

stimes :: Integral b => b -> Parser i a -> Parser i a #

Semigroup (Proxy s)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Ord n => Semigroup (Envelope v n)

Envelopes form a semigroup with pointwise maximum as composition. Hence, if e1 is the envelope for diagram d1, and e2 is the envelope for d2, then e1 `mappend` e2 is the envelope for d1 `atop` d2.

Instance details

Defined in Diagrams.Core.Envelope

Methods

(<>) :: Envelope v n -> Envelope v n -> Envelope v n #

sconcat :: NonEmpty (Envelope v n) -> Envelope v n #

stimes :: Integral b => b -> Envelope v n -> Envelope v n #

Ord n => Semigroup (Trace v n)

Traces form a semigroup with pointwise minimum as composition. Hence, if t1 is the trace for diagram d1, and e2 is the trace for d2, then e1 `mappend` e2 is the trace for d1 `atop` d2.

Instance details

Defined in Diagrams.Core.Trace

Methods

(<>) :: Trace v n -> Trace v n -> Trace v n #

sconcat :: NonEmpty (Trace v n) -> Trace v n #

stimes :: Integral b => b -> Trace v n -> Trace v n #

Typeable n => Semigroup (Attribute v n)

Attributes form a semigroup, where the semigroup operation simply returns the right-hand attribute when the types do not match, and otherwise uses the semigroup operation specific to the (matching) types.

Instance details

Defined in Diagrams.Core.Style

Methods

(<>) :: Attribute v n -> Attribute v n -> Attribute v n #

sconcat :: NonEmpty (Attribute v n) -> Attribute v n #

stimes :: Integral b => b -> Attribute v n -> Attribute v n #

Typeable n => Semigroup (Style v n)

Combine a style by combining the attributes; if the two styles have attributes of the same type they are combined according to their semigroup structure.

Instance details

Defined in Diagrams.Core.Style

Methods

(<>) :: Style v n -> Style v n -> Style v n #

sconcat :: NonEmpty (Style v n) -> Style v n #

stimes :: Integral b => b -> Style v n -> Style v n #

Semigroup (a :-: a) 
Instance details

Defined in Diagrams.Core.Transform

Methods

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

sconcat :: NonEmpty (a :-: a) -> a :-: a #

stimes :: Integral b => b -> (a :-: a) -> a :-: a #

(Additive v, Num n) => Semigroup (Transformation v n)

Transformations are closed under composition; t1 <> t2 is the transformation which performs first t2, then t1.

Instance details

Defined in Diagrams.Core.Transform

Semigroup a => Semigroup (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

Methods

(<>) :: Measured n a -> Measured n a -> Measured n a #

sconcat :: NonEmpty (Measured n a) -> Measured n a #

stimes :: Integral b => b -> Measured n a -> Measured n a #

(Additive v, Ord n) => Semigroup (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

(<>) :: BoundingBox v n -> BoundingBox v n -> BoundingBox v n #

sconcat :: NonEmpty (BoundingBox v n) -> BoundingBox v n #

stimes :: Integral b => b -> BoundingBox v n -> BoundingBox v n #

Semigroup (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

(<>) :: Path v n -> Path v n -> Path v n #

sconcat :: NonEmpty (Path v n) -> Path v n #

stimes :: Integral b => b -> Path v n -> Path v n #

(Ord n, Floating n, Metric v) => Semigroup (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

(<>) :: SegTree v n -> SegTree v n -> SegTree v n #

sconcat :: NonEmpty (SegTree v n) -> SegTree v n #

stimes :: Integral b => b -> SegTree v n -> SegTree v n #

(OrderedField n, Metric v) => Semigroup (Trail v n)

Two Trails are combined by first ensuring they are both lines (using cutTrail on loops) and then concatenating them. The result, in general, is a line. However, there is a special case for the empty line, which acts as the identity (so combining the empty line with a loop results in a loop).

Instance details

Defined in Diagrams.Trail

Methods

(<>) :: Trail v n -> Trail v n -> Trail v n #

sconcat :: NonEmpty (Trail v n) -> Trail v n #

stimes :: Integral b => b -> Trail v n -> Trail v n #

(Num n, Additive v) => Semigroup (TotalOffset v n) 
Instance details

Defined in Diagrams.Segment

Methods

(<>) :: TotalOffset v n -> TotalOffset v n -> TotalOffset v n #

sconcat :: NonEmpty (TotalOffset v n) -> TotalOffset v n #

stimes :: Integral b => b -> TotalOffset v n -> TotalOffset v n #

(Metric v, OrderedField n) => Semigroup (OffsetEnvelope v n) 
Instance details

Defined in Diagrams.Segment

Monad m => Semigroup (Sequenced a m) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Sequenced a m -> Sequenced a m -> Sequenced a m #

sconcat :: NonEmpty (Sequenced a m) -> Sequenced a m #

stimes :: Integral b => b -> Sequenced a m -> Sequenced a m #

Applicative f => Semigroup (Traversed a f) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Traversed a f -> Traversed a f -> Traversed a f #

sconcat :: NonEmpty (Traversed a f) -> Traversed a f #

stimes :: Integral b => b -> Traversed a f -> Traversed a f #

Semigroup (ReifiedFold s a) 
Instance details

Defined in Control.Lens.Reified

Methods

(<>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

sconcat :: NonEmpty (ReifiedFold s a) -> ReifiedFold s a #

stimes :: Integral b => b -> ReifiedFold s a -> ReifiedFold s a #

Measured v a => Semigroup (FingerTree v a) 
Instance details

Defined in Data.FingerTree

Methods

(<>) :: FingerTree v a -> FingerTree v a -> FingerTree v a #

sconcat :: NonEmpty (FingerTree v a) -> FingerTree v a #

stimes :: Integral b => b -> FingerTree v a -> FingerTree v a #

Semigroup (Deepening i a) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

(<>) :: Deepening i a -> Deepening i a -> Deepening i a #

sconcat :: NonEmpty (Deepening i a) -> Deepening i a #

stimes :: Integral b => b -> Deepening i a -> Deepening i a #

Semigroup (f a) => Semigroup (Indexing f a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

(<>) :: Indexing f a -> Indexing f a -> Indexing f a #

sconcat :: NonEmpty (Indexing f a) -> Indexing f a #

stimes :: Integral b => b -> Indexing f a -> Indexing f a #

(Contravariant f, Applicative f) => Semigroup (Folding f a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Folding f a -> Folding f a -> Folding f a #

sconcat :: NonEmpty (Folding f a) -> Folding f a #

stimes :: Integral b => b -> Folding f a -> Folding f a #

Apply f => Semigroup (TraversedF a f) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: TraversedF a f -> TraversedF a f -> TraversedF a f #

sconcat :: NonEmpty (TraversedF a f) -> TraversedF a f #

stimes :: Integral b => b -> TraversedF a f -> TraversedF a f #

(a ~ (), Applicative m) => Semigroup (HtmlT m a)

Since: lucid-2.9.7

Instance details

Defined in Lucid.Base

Methods

(<>) :: HtmlT m a -> HtmlT m a -> HtmlT m a #

sconcat :: NonEmpty (HtmlT m a) -> HtmlT m a #

stimes :: Integral b => b -> HtmlT m a -> HtmlT m a #

(Additive v, Ord n) => Semigroup (NonEmptyBoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

(<>) :: NonEmptyBoundingBox v n -> NonEmptyBoundingBox v n -> NonEmptyBoundingBox v n #

sconcat :: NonEmpty (NonEmptyBoundingBox v n) -> NonEmptyBoundingBox v n #

stimes :: Integral b => b -> NonEmptyBoundingBox v n -> NonEmptyBoundingBox v n #

Semigroup (f p) => Semigroup (Rec1 f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: Rec1 f p -> Rec1 f p -> Rec1 f p #

sconcat :: NonEmpty (Rec1 f p) -> Rec1 f p #

stimes :: Integral b => b -> Rec1 f p -> Rec1 f p #

(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a, b, c) -> (a, b, c) -> (a, b, c) #

sconcat :: NonEmpty (a, b, c) -> (a, b, c) #

stimes :: Integral b0 => b0 -> (a, b, c) -> (a, b, c) #

Semigroup a => Semigroup (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(<>) :: Const a b -> Const a b -> Const a b #

sconcat :: NonEmpty (Const a b) -> Const a b #

stimes :: Integral b0 => b0 -> Const a b -> Const a b #

(Applicative f, Semigroup a) => Semigroup (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: Ap f a -> Ap f a -> Ap f a #

sconcat :: NonEmpty (Ap f a) -> Ap f a #

stimes :: Integral b => b -> Ap f a -> Ap f a #

Alternative f => Semigroup (Alt f a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Alt f a -> Alt f a -> Alt f a #

sconcat :: NonEmpty (Alt f a) -> Alt f a #

stimes :: Integral b => b -> Alt f a -> Alt f a #

Semigroup (Colonnade h a c) 
Instance details

Defined in Colonnade.Encode

Methods

(<>) :: Colonnade h a c -> Colonnade h a c -> Colonnade h a c #

sconcat :: NonEmpty (Colonnade h a c) -> Colonnade h a c #

stimes :: Integral b => b -> Colonnade h a c -> Colonnade h a c #

Semigroup (Render NullBackend v n) 
Instance details

Defined in Diagrams.Core.Types

Semigroup (Render SVG V2 n) 
Instance details

Defined in Diagrams.Backend.SVG

Methods

(<>) :: Render SVG V2 n -> Render SVG V2 n -> Render SVG V2 n #

sconcat :: NonEmpty (Render SVG V2 n) -> Render SVG V2 n #

stimes :: Integral b => b -> Render SVG V2 n -> Render SVG V2 n #

Semigroup m => Semigroup (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Methods

(<>) :: Query v n m -> Query v n m -> Query v n m #

sconcat :: NonEmpty (Query v n m) -> Query v n m #

stimes :: Integral b => b -> Query v n m -> Query v n m #

Semigroup (Deformation v v n) 
Instance details

Defined in Diagrams.Deform

Methods

(<>) :: Deformation v v n -> Deformation v v n -> Deformation v v n #

sconcat :: NonEmpty (Deformation v v n) -> Deformation v v n #

stimes :: Integral b => b -> Deformation v v n -> Deformation v v n #

(OrderedField n, Metric v) => Semigroup (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

(<>) :: Trail' Line v n -> Trail' Line v n -> Trail' Line v n #

sconcat :: NonEmpty (Trail' Line v n) -> Trail' Line v n #

stimes :: Integral b => b -> Trail' Line v n -> Trail' Line v n #

Semigroup (ReifiedIndexedFold i s a) 
Instance details

Defined in Control.Lens.Reified

ArrowPlus p => Semigroup (Tambara p a b) 
Instance details

Defined in Data.Profunctor.Strong

Methods

(<>) :: Tambara p a b -> Tambara p a b -> Tambara p a b #

sconcat :: NonEmpty (Tambara p a b) -> Tambara p a b #

stimes :: Integral b0 => b0 -> Tambara p a b -> Tambara p a b #

Reifies s (ReifiedMonoid a) => Semigroup (ReflectedMonoid a s) 
Instance details

Defined in Data.Reflection

Semigroup a => Semigroup (Tagged s a) 
Instance details

Defined in Data.Tagged

Methods

(<>) :: Tagged s a -> Tagged s a -> Tagged s a #

sconcat :: NonEmpty (Tagged s a) -> Tagged s a #

stimes :: Integral b => b -> Tagged s a -> Tagged s a #

Semigroup c => Semigroup (K1 i c p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: K1 i c p -> K1 i c p -> K1 i c p #

sconcat :: NonEmpty (K1 i c p) -> K1 i c p #

stimes :: Integral b => b -> K1 i c p -> K1 i c p #

(Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

sconcat :: NonEmpty ((f :*: g) p) -> (f :*: g) p #

stimes :: Integral b => b -> (f :*: g) p -> (f :*: g) p #

(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

sconcat :: NonEmpty (a, b, c, d) -> (a, b, c, d) #

stimes :: Integral b0 => b0 -> (a, b, c, d) -> (a, b, c, d) #

Semigroup (Cornice h p a c) 
Instance details

Defined in Colonnade.Encode

Methods

(<>) :: Cornice h p a c -> Cornice h p a c -> Cornice h p a c #

sconcat :: NonEmpty (Cornice h p a c) -> Cornice h p a c #

stimes :: Integral b => b -> Cornice h p a c -> Cornice h p a c #

(Metric v, OrderedField n, Semigroup m) => Semigroup (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

(<>) :: QDiagram b v n m -> QDiagram b v n m -> QDiagram b v n m #

sconcat :: NonEmpty (QDiagram b v n m) -> QDiagram b v n m #

stimes :: Integral b0 => b0 -> QDiagram b v n m -> QDiagram b v n m #

Semigroup (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

(<>) :: SubMap b v n m -> SubMap b v n m -> SubMap b v n m #

sconcat :: NonEmpty (SubMap b v n m) -> SubMap b v n m #

stimes :: Integral b0 => b0 -> SubMap b v n m -> SubMap b v n m #

(Action d u, Semigroup u) => Semigroup (DUALTreeNE d u a l) 
Instance details

Defined in Data.Tree.DUAL.Internal

Methods

(<>) :: DUALTreeNE d u a l -> DUALTreeNE d u a l -> DUALTreeNE d u a l #

sconcat :: NonEmpty (DUALTreeNE d u a l) -> DUALTreeNE d u a l #

stimes :: Integral b => b -> DUALTreeNE d u a l -> DUALTreeNE d u a l #

(Semigroup u, Action d u) => Semigroup (DUALTreeU d u a l) 
Instance details

Defined in Data.Tree.DUAL.Internal

Methods

(<>) :: DUALTreeU d u a l -> DUALTreeU d u a l -> DUALTreeU d u a l #

sconcat :: NonEmpty (DUALTreeU d u a l) -> DUALTreeU d u a l #

stimes :: Integral b => b -> DUALTreeU d u a l -> DUALTreeU d u a l #

(Semigroup u, Action d u) => Semigroup (DUALTree d u a l) 
Instance details

Defined in Data.Tree.DUAL.Internal

Methods

(<>) :: DUALTree d u a l -> DUALTree d u a l -> DUALTree d u a l #

sconcat :: NonEmpty (DUALTree d u a l) -> DUALTree d u a l #

stimes :: Integral b => b -> DUALTree d u a l -> DUALTree d u a l #

Semigroup a => Semigroup (ParsecT s u m a)

The Semigroup instance for ParsecT is used to append the result of several parsers, for example:

(many $ char a) <> (many $ char b)

The above will parse a string like "aabbb" and return a successful parse result "aabbb". Compare against the below which will produce a result of "bbb" for the same input:

(many $ char a) >> (many $ char b)
(many $ char a) *> (many $ char b)

Since: parsec-3.1.12

Instance details

Defined in Text.Parsec.Prim

Methods

(<>) :: ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a #

sconcat :: NonEmpty (ParsecT s u m a) -> ParsecT s u m a #

stimes :: Integral b => b -> ParsecT s u m a -> ParsecT s u m a #

Semigroup (f p) => Semigroup (M1 i c f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: M1 i c f p -> M1 i c f p -> M1 i c f p #

sconcat :: NonEmpty (M1 i c f p) -> M1 i c f p #

stimes :: Integral b => b -> M1 i c f p -> M1 i c f p #

Semigroup (f (g p)) => Semigroup ((f :.: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

sconcat :: NonEmpty ((f :.: g) p) -> (f :.: g) p #

stimes :: Integral b => b -> (f :.: g) p -> (f :.: g) p #

(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

sconcat :: NonEmpty (a, b, c, d, e) -> (a, b, c, d, e) #

stimes :: Integral b0 => b0 -> (a, b, c, d, e) -> (a, b, c, d, e) #

Contravariant g => Semigroup (BazaarT p g a b t) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

(<>) :: BazaarT p g a b t -> BazaarT p g a b t -> BazaarT p g a b t #

sconcat :: NonEmpty (BazaarT p g a b t) -> BazaarT p g a b t #

stimes :: Integral b0 => b0 -> BazaarT p g a b t -> BazaarT p g a b t #

Contravariant g => Semigroup (BazaarT1 p g a b t) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

(<>) :: BazaarT1 p g a b t -> BazaarT1 p g a b t -> BazaarT1 p g a b t #

sconcat :: NonEmpty (BazaarT1 p g a b t) -> BazaarT1 p g a b t #

stimes :: Integral b0 => b0 -> BazaarT1 p g a b t -> BazaarT1 p g a b t #

liftA :: Applicative f => (a -> b) -> f a -> f b #

Lift a function to actions. This function may be used as a value for fmap in a Functor instance.

liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d #

Lift a ternary function to actions.

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #

An infix synonym for fmap.

The name of this operator is an allusion to $. Note the similarities between their types:

 ($)  ::              (a -> b) ->   a ->   b
(<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas $ is function application, <$> is function application lifted over a Functor.

Examples

Expand

Convert from a Maybe Int to a Maybe String using show:

>>> show <$> Nothing
Nothing
>>> show <$> Just 3
Just "3"

Convert from an Either Int Int to an Either Int String using show:

>>> show <$> Left 17
Left 17
>>> show <$> Right 17
Right "17"

Double each element of a list:

>>> (*2) <$> [1,2,3]
[2,4,6]

Apply even to the second element of a pair:

>>> even <$> (2,2)
(2,True)

newtype Const a (b :: k) :: forall k. Type -> k -> Type #

The Const functor.

Constructors

Const 

Fields

Instances
Generic1 (Const a :: k -> Type) 
Instance details

Defined in Data.Functor.Const

Associated Types

type Rep1 (Const a) :: k -> Type #

Methods

from1 :: Const a a0 -> Rep1 (Const a) a0 #

to1 :: Rep1 (Const a) a0 -> Const a a0 #

ToJSON2 (Const :: Type -> Type -> Type) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> Const a b -> Value #

liftToJSONList2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> [Const a b] -> Value #

liftToEncoding2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> Const a b -> Encoding #

liftToEncodingList2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> [Const a b] -> Encoding #

Bitraversable (Const :: Type -> Type -> Type)

Since: base-4.10.0.0

Instance details

Defined in Data.Bitraversable

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Const a b -> f (Const c d) #

Bifoldable (Const :: Type -> Type -> Type)

Since: base-4.10.0.0

Instance details

Defined in Data.Bifoldable

Methods

bifold :: Monoid m => Const m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Const a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Const a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Const a b -> c #

Bifunctor (Const :: Type -> Type -> Type)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d #

first :: (a -> b) -> Const a c -> Const b c #

second :: (b -> c) -> Const a b -> Const a c #

Biapplicative (Const :: Type -> Type -> Type) 
Instance details

Defined in Data.Biapplicative

Methods

bipure :: a -> b -> Const a b #

(<<*>>) :: Const (a -> b) (c -> d) -> Const a c -> Const b d #

biliftA2 :: (a -> b -> c) -> (d -> e -> f) -> Const a d -> Const b e -> Const c f #

(*>>) :: Const a b -> Const c d -> Const c d #

(<<*) :: Const a b -> Const c d -> Const a b #

Bitraversable1 (Const :: Type -> Type -> Type) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

bitraverse1 :: Apply f => (a -> f b) -> (c -> f d) -> Const a c -> f (Const b d) #

bisequence1 :: Apply f => Const (f a) (f b) -> f (Const a b) #

Biapply (Const :: Type -> Type -> Type) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<<.>>) :: Const (a -> b) (c -> d) -> Const a c -> Const b d #

(.>>) :: Const a b -> Const c d -> Const c d #

(<<.) :: Const a b -> Const c d -> Const a b #

Functor (Const m :: Type -> Type)

Since: base-2.1

Instance details

Defined in Data.Functor.Const

Methods

fmap :: (a -> b) -> Const m a -> Const m b #

(<$) :: a -> Const m b -> Const m a #

Monoid m => Applicative (Const m :: Type -> Type)

Since: base-2.0.1

Instance details

Defined in Data.Functor.Const

Methods

pure :: a -> Const m a #

(<*>) :: Const m (a -> b) -> Const m a -> Const m b #

liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c #

(*>) :: Const m a -> Const m b -> Const m b #

(<*) :: Const m a -> Const m b -> Const m a #

Foldable (Const m :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Functor.Const

Methods

fold :: Monoid m0 => Const m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 #

foldr :: (a -> b -> b) -> b -> Const m a -> b #

foldr' :: (a -> b -> b) -> b -> Const m a -> b #

foldl :: (b -> a -> b) -> b -> Const m a -> b #

foldl' :: (b -> a -> b) -> b -> Const m a -> b #

foldr1 :: (a -> a -> a) -> Const m a -> a #

foldl1 :: (a -> a -> a) -> Const m a -> a #

toList :: Const m a -> [a] #

null :: Const m a -> Bool #

length :: Const m a -> Int #

elem :: Eq a => a -> Const m a -> Bool #

maximum :: Ord a => Const m a -> a #

minimum :: Ord a => Const m a -> a #

sum :: Num a => Const m a -> a #

product :: Num a => Const m a -> a #

Traversable (Const m :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) #

sequenceA :: Applicative f => Const m (f a) -> f (Const m a) #

mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) #

sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #

Semigroup m => Apply (Const m :: Type -> Type) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Const m (a -> b) -> Const m a -> Const m b #

(.>) :: Const m a -> Const m b -> Const m b #

(<.) :: Const m a -> Const m b -> Const m a #

liftF2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c #

Contravariant (Const a :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a0 -> b) -> Const a b -> Const a a0 #

(>$) :: b -> Const a b -> Const a a0 #

ToJSON a => ToJSON1 (Const a :: Type -> Type) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a0 -> Value) -> ([a0] -> Value) -> Const a a0 -> Value #

liftToJSONList :: (a0 -> Value) -> ([a0] -> Value) -> [Const a a0] -> Value #

liftToEncoding :: (a0 -> Encoding) -> ([a0] -> Encoding) -> Const a a0 -> Encoding #

liftToEncodingList :: (a0 -> Encoding) -> ([a0] -> Encoding) -> [Const a a0] -> Encoding #

Bounded a => Bounded (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

minBound :: Const a b #

maxBound :: Const a b #

Enum a => Enum (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

succ :: Const a b -> Const a b #

pred :: Const a b -> Const a b #

toEnum :: Int -> Const a b #

fromEnum :: Const a b -> Int #

enumFrom :: Const a b -> [Const a b] #

enumFromThen :: Const a b -> Const a b -> [Const a b] #

enumFromTo :: Const a b -> Const a b -> [Const a b] #

enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] #

Eq a => Eq (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(==) :: Const a b -> Const a b -> Bool #

(/=) :: Const a b -> Const a b -> Bool #

Floating a => Floating (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

pi :: Const a b #

exp :: Const a b -> Const a b #

log :: Const a b -> Const a b #

sqrt :: Const a b -> Const a b #

(**) :: Const a b -> Const a b -> Const a b #

logBase :: Const a b -> Const a b -> Const a b #

sin :: Const a b -> Const a b #

cos :: Const a b -> Const a b #

tan :: Const a b -> Const a b #

asin :: Const a b -> Const a b #

acos :: Const a b -> Const a b #

atan :: Const a b -> Const a b #

sinh :: Const a b -> Const a b #

cosh :: Const a b -> Const a b #

tanh :: Const a b -> Const a b #

asinh :: Const a b -> Const a b #

acosh :: Const a b -> Const a b #

atanh :: Const a b -> Const a b #

log1p :: Const a b -> Const a b #

expm1 :: Const a b -> Const a b #

log1pexp :: Const a b -> Const a b #

log1mexp :: Const a b -> Const a b #

Fractional a => Fractional (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(/) :: Const a b -> Const a b -> Const a b #

recip :: Const a b -> Const a b #

fromRational :: Rational -> Const a b #

Integral a => Integral (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

quot :: Const a b -> Const a b -> Const a b #

rem :: Const a b -> Const a b -> Const a b #

div :: Const a b -> Const a b -> Const a b #

mod :: Const a b -> Const a b -> Const a b #

quotRem :: Const a b -> Const a b -> (Const a b, Const a b) #

divMod :: Const a b -> Const a b -> (Const a b, Const a b) #

toInteger :: Const a b -> Integer #

Num a => Num (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(+) :: Const a b -> Const a b -> Const a b #

(-) :: Const a b -> Const a b -> Const a b #

(*) :: Const a b -> Const a b -> Const a b #

negate :: Const a b -> Const a b #

abs :: Const a b -> Const a b #

signum :: Const a b -> Const a b #

fromInteger :: Integer -> Const a b #

Ord a => Ord (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

compare :: Const a b -> Const a b -> Ordering #

(<) :: Const a b -> Const a b -> Bool #

(<=) :: Const a b -> Const a b -> Bool #

(>) :: Const a b -> Const a b -> Bool #

(>=) :: Const a b -> Const a b -> Bool #

max :: Const a b -> Const a b -> Const a b #

min :: Const a b -> Const a b -> Const a b #

Read a => Read (Const a b)

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Const

Real a => Real (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

toRational :: Const a b -> Rational #

RealFloat a => RealFloat (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

floatRadix :: Const a b -> Integer #

floatDigits :: Const a b -> Int #

floatRange :: Const a b -> (Int, Int) #

decodeFloat :: Const a b -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Const a b #

exponent :: Const a b -> Int #

significand :: Const a b -> Const a b #

scaleFloat :: Int -> Const a b -> Const a b #

isNaN :: Const a b -> Bool #

isInfinite :: Const a b -> Bool #

isDenormalized :: Const a b -> Bool #

isNegativeZero :: Const a b -> Bool #

isIEEE :: Const a b -> Bool #

atan2 :: Const a b -> Const a b -> Const a b #

RealFrac a => RealFrac (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

properFraction :: Integral b0 => Const a b -> (b0, Const a b) #

truncate :: Integral b0 => Const a b -> b0 #

round :: Integral b0 => Const a b -> b0 #

ceiling :: Integral b0 => Const a b -> b0 #

floor :: Integral b0 => Const a b -> b0 #

Show a => Show (Const a b)

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Const

Methods

showsPrec :: Int -> Const a b -> ShowS #

show :: Const a b -> String #

showList :: [Const a b] -> ShowS #

Ix a => Ix (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

range :: (Const a b, Const a b) -> [Const a b] #

index :: (Const a b, Const a b) -> Const a b -> Int #

unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int

inRange :: (Const a b, Const a b) -> Const a b -> Bool #

rangeSize :: (Const a b, Const a b) -> Int #

unsafeRangeSize :: (Const a b, Const a b) -> Int

IsString a => IsString (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.String

Methods

fromString :: String -> Const a b #

Generic (Const a b) 
Instance details

Defined in Data.Functor.Const

Associated Types

type Rep (Const a b) :: Type -> Type #

Methods

from :: Const a b -> Rep (Const a b) x #

to :: Rep (Const a b) x -> Const a b #

Semigroup a => Semigroup (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(<>) :: Const a b -> Const a b -> Const a b #

sconcat :: NonEmpty (Const a b) -> Const a b #

stimes :: Integral b0 => b0 -> Const a b -> Const a b #

Monoid a => Monoid (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

mempty :: Const a b #

mappend :: Const a b -> Const a b -> Const a b #

mconcat :: [Const a b] -> Const a b #

ToJSON a => ToJSON (Const a b) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

toJSON :: Const a b -> Value #

toEncoding :: Const a b -> Encoding #

toJSONList :: [Const a b] -> Value #

toEncodingList :: [Const a b] -> Encoding #

Storable a => Storable (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

sizeOf :: Const a b -> Int #

alignment :: Const a b -> Int #

peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) #

pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () #

peekByteOff :: Ptr b0 -> Int -> IO (Const a b) #

pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () #

peek :: Ptr (Const a b) -> IO (Const a b) #

poke :: Ptr (Const a b) -> Const a b -> IO () #

Bits a => Bits (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(.&.) :: Const a b -> Const a b -> Const a b #

(.|.) :: Const a b -> Const a b -> Const a b #

xor :: Const a b -> Const a b -> Const a b #

complement :: Const a b -> Const a b #

shift :: Const a b -> Int -> Const a b #

rotate :: Const a b -> Int -> Const a b #

zeroBits :: Const a b #

bit :: Int -> Const a b #

setBit :: Const a b -> Int -> Const a b #

clearBit :: Const a b -> Int -> Const a b #

complementBit :: Const a b -> Int -> Const a b #

testBit :: Const a b -> Int -> Bool #

bitSizeMaybe :: Const a b -> Maybe Int #

bitSize :: Const a b -> Int #

isSigned :: Const a b -> Bool #

shiftL :: Const a b -> Int -> Const a b #

unsafeShiftL :: Const a b -> Int -> Const a b #

shiftR :: Const a b -> Int -> Const a b #

unsafeShiftR :: Const a b -> Int -> Const a b #

rotateL :: Const a b -> Int -> Const a b #

rotateR :: Const a b -> Int -> Const a b #

popCount :: Const a b -> Int #

FiniteBits a => FiniteBits (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Wrapped (Const a x) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Const a x) :: Type #

Methods

_Wrapped' :: Iso' (Const a x) (Unwrapped (Const a x)) #

Newtype (Const a x) 
Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Const a x) :: Type #

Methods

pack :: O (Const a x) -> Const a x #

unpack :: Const a x -> O (Const a x) #

Pretty a => Pretty (Const a b) 
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Const a b -> Doc ann #

prettyList :: [Const a b] -> Doc ann #

t ~ Const a' x' => Rewrapped (Const a x) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep1 (Const a :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

type Rep1 (Const a :: k -> Type) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

type Rep (Const a b) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Const a x) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Const a x) = a
type O (Const a x) 
Instance details

Defined in Control.Newtype.Generics

type O (Const a x) = a

newtype Identity a #

Identity functor and monad. (a non-strict monad)

Since: base-4.8.0.0

Constructors

Identity 

Fields

Instances
Monad Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(>>=) :: Identity a -> (a -> Identity b) -> Identity b #

(>>) :: Identity a -> Identity b -> Identity b #

return :: a -> Identity a #

fail :: String -> Identity a #

Functor Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fmap :: (a -> b) -> Identity a -> Identity b #

(<$) :: a -> Identity b -> Identity a #

MonadFix Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mfix :: (a -> Identity a) -> Identity a #

Applicative Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pure :: a -> Identity a #

(<*>) :: Identity (a -> b) -> Identity a -> Identity b #

liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

(*>) :: Identity a -> Identity b -> Identity b #

(<*) :: Identity a -> Identity b -> Identity a #

Foldable Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fold :: Monoid m => Identity m -> m #

foldMap :: Monoid m => (a -> m) -> Identity a -> m #

foldr :: (a -> b -> b) -> b -> Identity a -> b #

foldr' :: (a -> b -> b) -> b -> Identity a -> b #

foldl :: (b -> a -> b) -> b -> Identity a -> b #

foldl' :: (b -> a -> b) -> b -> Identity a -> b #

foldr1 :: (a -> a -> a) -> Identity a -> a #

foldl1 :: (a -> a -> a) -> Identity a -> a #

toList :: Identity a -> [a] #

null :: Identity a -> Bool #

length :: Identity a -> Int #

elem :: Eq a => a -> Identity a -> Bool #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

sum :: Num a => Identity a -> a #

product :: Num a => Identity a -> a #

Traversable Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) #

sequenceA :: Applicative f => Identity (f a) -> f (Identity a) #

mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) #

sequence :: Monad m => Identity (m a) -> m (Identity a) #

Apply Identity 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Identity (a -> b) -> Identity a -> Identity b #

(.>) :: Identity a -> Identity b -> Identity b #

(<.) :: Identity a -> Identity b -> Identity a #

liftF2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

Representable Identity 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep Identity :: Type #

Methods

tabulate :: (Rep Identity -> a) -> Identity a #

index :: Identity a -> Rep Identity -> a #

ToJSON1 Identity 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Identity a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Identity a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Identity a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Identity a] -> Encoding #

Additive Identity 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => Identity a #

(^+^) :: Num a => Identity a -> Identity a -> Identity a #

(^-^) :: Num a => Identity a -> Identity a -> Identity a #

lerp :: Num a => a -> Identity a -> Identity a -> Identity a #

liftU2 :: (a -> a -> a) -> Identity a -> Identity a -> Identity a #

liftI2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

Metric Identity 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => Identity a -> Identity a -> a #

quadrance :: Num a => Identity a -> a #

qd :: Num a => Identity a -> Identity a -> a #

distance :: Floating a => Identity a -> Identity a -> a #

norm :: Floating a => Identity a -> a #

signorm :: Floating a => Identity a -> Identity a #

Affine Identity 
Instance details

Defined in Linear.Affine

Associated Types

type Diff Identity :: Type -> Type #

Methods

(.-.) :: Num a => Identity a -> Identity a -> Diff Identity a #

(.+^) :: Num a => Identity a -> Diff Identity a -> Identity a #

(.-^) :: Num a => Identity a -> Diff Identity a -> Identity a #

R1 Identity 
Instance details

Defined in Linear.V1

Methods

_x :: Lens' (Identity a) a #

Traversable1 Identity 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Identity a -> f (Identity b) #

sequence1 :: Apply f => Identity (f b) -> f (Identity b) #

Settable Identity

So you can pass our Setter into combinators from other lens libraries.

Instance details

Defined in Control.Lens.Internal.Setter

Methods

untainted :: Identity a -> a #

untaintedDot :: Profunctor p => p a (Identity b) -> p a b #

taintedDot :: Profunctor p => p a b -> p a (Identity b) #

Bind Identity 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Identity a -> (a -> Identity b) -> Identity b #

join :: Identity (Identity a) -> Identity a #

TraversableWithIndex () Identity 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Identity a -> f (Identity b) #

itraversed :: IndexedTraversal () (Identity a) (Identity b) a b #

FoldableWithIndex () Identity 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Identity a -> m #

ifolded :: IndexedFold () (Identity a) a #

ifoldr :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Identity a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Identity a -> b #

FunctorWithIndex () Identity 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (() -> a -> b) -> Identity a -> Identity b #

imapped :: IndexedSetter () (Identity a) (Identity b) a b #

MonadBaseControl Identity Identity 
Instance details

Defined in Control.Monad.Trans.Control

Associated Types

type StM Identity a :: Type #

Sieve ReifiedGetter Identity 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedGetter a b -> a -> Identity b #

Cosieve ReifiedGetter Identity 
Instance details

Defined in Control.Lens.Reified

Methods

cosieve :: ReifiedGetter a b -> Identity a -> b #

Monad m => Lift Identity m

This instance is incoherent with the others. However, by the law lift (return x) == return x, the results must always be the same.

Instance details

Defined in Data.Random.Lift

Methods

lift :: Identity a -> m a #

MonadTrans t => Lift Identity (t Identity)

This instance is again incoherent with the others, but provides a more-specific instance to resolve the overlap between the Lift m (t m) and Lift Identity m instances.

Instance details

Defined in Data.Random.Lift

Methods

lift :: Identity a -> t Identity a #

Bounded a => Bounded (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Enum a => Enum (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Eq a => Eq (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

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

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

Floating a => Floating (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Fractional a => Fractional (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Integral a => Integral (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Num a => Num (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Ord a => Ord (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

compare :: Identity a -> Identity a -> Ordering #

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

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

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

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

max :: Identity a -> Identity a -> Identity a #

min :: Identity a -> Identity a -> Identity a #

Read a => Read (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Real a => Real (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

toRational :: Identity a -> Rational #

RealFloat a => RealFloat (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

RealFrac a => RealFrac (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

properFraction :: Integral b => Identity a -> (b, Identity a) #

truncate :: Integral b => Identity a -> b #

round :: Integral b => Identity a -> b #

ceiling :: Integral b => Identity a -> b #

floor :: Integral b => Identity a -> b #

Show a => Show (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

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

show :: Identity a -> String #

showList :: [Identity a] -> ShowS #

Ix a => Ix (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

IsString a => IsString (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.String

Methods

fromString :: String -> Identity a #

Generic (Identity a) 
Instance details

Defined in Data.Functor.Identity

Associated Types

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

Methods

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

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

Semigroup a => Semigroup (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(<>) :: Identity a -> Identity a -> Identity a #

sconcat :: NonEmpty (Identity a) -> Identity a #

stimes :: Integral b => b -> Identity a -> Identity a #

Monoid a => Monoid (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

ToJSON a => ToJSON (Identity a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

ToJSONKey a => ToJSONKey (Identity a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Storable a => Storable (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

sizeOf :: Identity a -> Int #

alignment :: Identity a -> Int #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Identity a) #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () #

peek :: Ptr (Identity a) -> IO (Identity a) #

poke :: Ptr (Identity a) -> Identity a -> IO () #

Bits a => Bits (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

FiniteBits a => FiniteBits (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Wrapped (Identity a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Identity a) :: Type #

Ixed (Identity a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Identity a) -> Traversal' (Identity a) (IxValue (Identity a)) #

Newtype (Identity a)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Identity a) :: Type #

Methods

pack :: O (Identity a) -> Identity a #

unpack :: Identity a -> O (Identity a) #

Pretty a => Pretty (Identity a)
>>> pretty (Identity 1)
1
Instance details

Defined in Data.Text.Prettyprint.Doc.Internal

Methods

pretty :: Identity a -> Doc ann #

prettyList :: [Identity a] -> Doc ann #

Generic1 Identity 
Instance details

Defined in Data.Functor.Identity

Associated Types

type Rep1 Identity :: k -> Type #

Methods

from1 :: Identity a -> Rep1 Identity a #

to1 :: Rep1 Identity a -> Identity a #

t ~ Identity b => Rewrapped (Identity a) t 
Instance details

Defined in Control.Lens.Wrapped

Lift (RVarT Identity) (RVarT m) 
Instance details

Defined in Data.Random.Lift

Methods

lift :: RVarT Identity a -> RVarT m a #

Field1 (Identity a) (Identity b) a b 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (Identity a) (Identity b) a b #

Each (Identity a) (Identity b) a b
each :: Traversal (Identity a) (Identity b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Identity a) (Identity b) a b #

type Rep Identity 
Instance details

Defined in Data.Functor.Rep

type Rep Identity = ()
type Diff Identity 
Instance details

Defined in Linear.Affine

type StM Identity a 
Instance details

Defined in Control.Monad.Trans.Control

type StM Identity a = a
type Rep (Identity a)

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

type Rep (Identity a) = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Identity a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Identity a) = a
type IxValue (Identity a) 
Instance details

Defined in Control.Lens.At

type IxValue (Identity a) = a
type Index (Identity a) 
Instance details

Defined in Control.Lens.At

type Index (Identity a) = ()
type O (Identity a) 
Instance details

Defined in Control.Newtype.Generics

type O (Identity a) = a
type Rep1 Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

type Rep1 Identity = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

simulate :: Rational -> Active a -> [a] #

simulate r act simulates the Active value act, returning a list of "snapshots" taken at regular intervals from the start time to the end time. The interval used is determined by the rate r, which denotes the "frame rate", that is, the number of snapshots per unit time.

If the Active value is constant (and thus has no start or end times), a list of length 1 is returned, containing the constant value.

discrete :: [a] -> Active a #

Create an Active which takes on each value in the given list in turn during the time [0,1], with each value getting an equal amount of time. In other words, discrete creates a "slide show" that starts at time 0 and ends at time 1. The first element is used prior to time 0, and the last element is used after time 1.

It is an error to call discrete on the empty list.

movie :: [Active a] -> Active a #

Splice together a list of active values using |>>. The list must be nonempty.

(|>>) :: Active a -> Active a -> Active a #

"Splice" two Active values together: shift the second to start immediately after the first (using after), and produce the value which acts like the first up to the common end/start point, then like the second after that. If both are constant, return the first.

(->>) :: Semigroup a => Active a -> Active a -> Active a infixr 5 #

Sequence/overlay two Active values: shift the second to start immediately after the first (using after), then compose them (using <>).

after :: Active a -> Active a -> Active a #

a1 `after` a2 produces an active that behaves like a1 but is shifted to start at the end time of a2. If either a1 or a2 are constant, a1 is returned unchanged.

atTime :: Time Rational -> Active a -> Active a #

atTime t a is an active value with the same behavior as a, shifted so that it starts at time t. If a is constant it is returned unchanged.

setEra :: Era Rational -> Active a -> Active a #

Set the era of an Active value. Note that this will change a constant Active into a dynamic one which happens to have the same value at all times.

trimAfter :: Monoid a => Active a -> Active a #

"Trim" an active value so that it is empty after the end of its era. For example, trimAfter ui can be visualized as

See the documentation of trim for more details.

trimBefore :: Monoid a => Active a -> Active a #

"Trim" an active value so that it is empty before the start of its era. For example, trimBefore ui can be visualized as

See the documentation of trim for more details.

trim :: Monoid a => Active a -> Active a #

"Trim" an active value so that it is empty outside its era. trim has no effect on constant values.

For example, trim ui can be visualized as

Actually, trim ui is not well-typed, since it is not guaranteed that ui's values will be monoidal (and usually they won't be)! But the above image still provides a good intuitive idea of what trim is doing. To make this precise we could consider something like trim (First . Just $ ui).

See also trimBefore and trimActive, which trim only before or after the era, respectively.

clampAfter :: Active a -> Active a #

"Clamp" an active value so that it is constant after the end of its era. For example, clampBefore ui can be visualized as

See the documentation of clamp for more information.

clampBefore :: Active a -> Active a #

"Clamp" an active value so that it is constant before the start of its era. For example, clampBefore ui can be visualized as

See the documentation of clamp for more information.

clamp :: Active a -> Active a #

"Clamp" an active value so that it is constant before and after its era. Before the era, clamp a takes on the value of a at the start of the era. Likewise, after the era, clamp a takes on the value of a at the end of the era. clamp has no effect on constant values.

For example, clamp ui can be visualized as

See also clampBefore and clampAfter, which clamp only before or after the era, respectively.

snapshot :: Time Rational -> Active a -> Active a #

Take a "snapshot" of an active value at a particular time, resulting in a constant value.

backwards :: Active a -> Active a #

Reverse an active value so the start of its era gets mapped to the end and vice versa. For example, backwards ui can be visualized as

shift :: Duration Rational -> Active a -> Active a #

shift d act shifts the start time of act by duration d. Has no effect on constant values.

during :: Active a -> Active a -> Active a #

a1 `during` a2 stretches and shifts a1 so that it has the same era as a2. Has no effect if either of a1 or a2 are constant.

stretchTo :: Duration Rational -> Active a -> Active a #

stretchTo d stretches an Active so it has duration d. Has no effect if (1) d is non-positive, or (2) the Active value is constant, or (3) the Active value has zero duration. [AJG: conditions (1) and (3) no longer true: to consider changing]

stretch :: Rational -> Active a -> Active a #

stretch s act "stretches" the active act so that it takes s times as long (retaining the same start time).

interval :: Fractional a => Time Rational -> Time Rational -> Active a #

interval a b is an active value starting at time a, ending at time b, and taking the value t at time t.

ui :: Fractional a => Active a #

ui represents the unit interval, which takes on the value t at time t, and has as its era [0,1]. It is equivalent to interval 0 1, and can be visualized as follows:

On the x-axis is time, and the value that ui takes on is on the y-axis. The shaded portion represents the era. Note that the value of ui (as with any active) is still defined outside its era, and this can make a difference when it is combined with other active values with different eras. Applying a function with fmap affects all values, both inside and outside the era. To manipulate values outside the era specifically, see clamp and trim.

To alter the values that ui takes on without altering its era, use its Functor and Applicative instances. For example, (*2) <$> ui varies from 0 to 2 over the era [0,1]. To alter the era, you can use stretch or shift.

isDynamic :: Active a -> Bool #

Test whether an Active value is Dynamic.

isConstant :: Active a -> Bool #

Test whether an Active value is constant.

activeEra :: Active a -> Maybe (Era Rational) #

Get the Era of an Active value (or Nothing if it is a constant/pure value).

activeEnd :: Active a -> a #

Get the value of an Active a at the end of its era.

activeStart :: Active a -> a #

Get the value of an Active a at the beginning of its era.

runActive :: Active a -> Time Rational -> a #

Interpret an Active value as a function from time.

modActive :: (a -> b) -> (Dynamic a -> Dynamic b) -> Active a -> Active b #

Modify an Active value using a case analysis to see whether it is constant or dynamic.

onActive :: (a -> b) -> (Dynamic a -> b) -> Active a -> b #

Fold for Actives. Process an 'Active a', given a function to apply if it is a pure (constant) value, and a function to apply if it is a Dynamic.

mkActive :: Time Rational -> Time Rational -> (Time Rational -> a) -> Active a #

Create a dynamic Active from a start time, an end time, and a time-varying value.

fromDynamic :: Dynamic a -> Active a #

Create an Active value from a Dynamic.

shiftDynamic :: Duration Rational -> Dynamic a -> Dynamic a #

Shift a Dynamic value by a certain duration.

onDynamic :: (Time Rational -> Time Rational -> (Time Rational -> a) -> b) -> Dynamic a -> b #

Fold for Dynamic.

mkDynamic :: Time Rational -> Time Rational -> (Time Rational -> a) -> Dynamic a #

Create a Dynamic from a start time, an end time, and a time-varying value.

duration :: Num n => Era n -> Duration n #

Compute the Duration of an Era.

end :: Era n -> Time n #

Get the end Time of an Era.

start :: Era n -> Time n #

Get the start Time of an Era.

mkEra :: Time n -> Time n -> Era n #

Create an Era by specifying start and end Times.

fromDuration :: Duration n -> n #

A convenient unwrapper function to turn a duration into a numeric value.

toDuration :: n -> Duration n #

A convenient wrapper function to convert a numeric value into a duration.

data Era n #

An Era is a concrete span of time, that is, a pair of times representing the start and end of the era. Eras form a semigroup: the combination of two Eras is the smallest Era which contains both. They do not form a Monoid, since there is no Era which acts as the identity with respect to this combining operation.

Era is abstract. To construct Era values, use mkEra; to deconstruct, use start and end.

Instances
Show n => Show (Era n) 
Instance details

Defined in Data.Active

Methods

showsPrec :: Int -> Era n -> ShowS #

show :: Era n -> String #

showList :: [Era n] -> ShowS #

Ord n => Semigroup (Era n) 
Instance details

Defined in Data.Active

Methods

(<>) :: Era n -> Era n -> Era n #

sconcat :: NonEmpty (Era n) -> Era n #

stimes :: Integral b => b -> Era n -> Era n #

data Dynamic a #

A Dynamic a can be thought of as an a value that changes over the course of a particular Era. It's envisioned that Dynamic will be mostly an internal implementation detail and that Active will be most commonly used. But you never know what uses people might find for things.

Constructors

Dynamic 

Fields

Instances
Functor Dynamic 
Instance details

Defined in Data.Active

Methods

fmap :: (a -> b) -> Dynamic a -> Dynamic b #

(<$) :: a -> Dynamic b -> Dynamic a #

Apply Dynamic

Dynamic is an instance of Apply (i.e. Applicative without pure): a time-varying function is applied to a time-varying value pointwise; the era of the result is the combination of the function and value eras. Note, however, that Dynamic is not an instance of Applicative since there is no way to implement pure: the era would have to be empty, but there is no such thing as an empty era (that is, Era is not an instance of Monoid).

Instance details

Defined in Data.Active

Methods

(<.>) :: Dynamic (a -> b) -> Dynamic a -> Dynamic b #

(.>) :: Dynamic a -> Dynamic b -> Dynamic b #

(<.) :: Dynamic a -> Dynamic b -> Dynamic a #

liftF2 :: (a -> b -> c) -> Dynamic a -> Dynamic b -> Dynamic c #

Semigroup a => Semigroup (Dynamic a)

Dynamic a is a Semigroup whenever a is: the eras are combined according to their semigroup structure, and the values of type a are combined pointwise. Note that Dynamic a cannot be an instance of Monoid since Era is not.

Instance details

Defined in Data.Active

Methods

(<>) :: Dynamic a -> Dynamic a -> Dynamic a #

sconcat :: NonEmpty (Dynamic a) -> Dynamic a #

stimes :: Integral b => b -> Dynamic a -> Dynamic a #

data Active a #

There are two types of Active values:

  • An Active can simply be a Dynamic, that is, a time-varying value with start and end times.
  • An Active value can also be a constant: a single value, constant across time, with no start and end times.

The addition of constant values enable Monoid and Applicative instances for Active.

Instances
Functor Active 
Instance details

Defined in Data.Active

Methods

fmap :: (a -> b) -> Active a -> Active b #

(<$) :: a -> Active b -> Active a #

Applicative Active 
Instance details

Defined in Data.Active

Methods

pure :: a -> Active a #

(<*>) :: Active (a -> b) -> Active a -> Active b #

liftA2 :: (a -> b -> c) -> Active a -> Active b -> Active c #

(*>) :: Active a -> Active b -> Active b #

(<*) :: Active a -> Active b -> Active a #

Apply Active 
Instance details

Defined in Data.Active

Methods

(<.>) :: Active (a -> b) -> Active a -> Active b #

(.>) :: Active a -> Active b -> Active b #

(<.) :: Active a -> Active b -> Active a #

liftF2 :: (a -> b -> c) -> Active a -> Active b -> Active c #

Semigroup a => Semigroup (Active a)

Active values over a type with a Semigroup instance are also an instance of Semigroup. Two active values are combined pointwise; the resulting value is constant iff both inputs are.

Instance details

Defined in Data.Active

Methods

(<>) :: Active a -> Active a -> Active a #

sconcat :: NonEmpty (Active a) -> Active a #

stimes :: Integral b => b -> Active a -> Active a #

(Monoid a, Semigroup a) => Monoid (Active a) 
Instance details

Defined in Data.Active

Methods

mempty :: Active a #

mappend :: Active a -> Active a -> Active a #

mconcat :: [Active a] -> Active a #

Wrapped (Active a) 
Instance details

Defined in Data.Active

Associated Types

type Unwrapped (Active a) :: Type #

Methods

_Wrapped' :: Iso' (Active a) (Unwrapped (Active a)) #

Active a1 ~ t => Rewrapped (Active a2) t 
Instance details

Defined in Data.Active

type V (Active a) 
Instance details

Defined in Diagrams.Animation.Active

type V (Active a) = V a
type N (Active a) 
Instance details

Defined in Diagrams.Animation.Active

type N (Active a) = N a
type Unwrapped (Active a) 
Instance details

Defined in Data.Active

fromTime :: Time n -> n #

A convenient unwrapper function to turn a time into a numeric value.

toTime :: n -> Time n #

A convenient wrapper function to convert a numeric value into a time.

data Duration n #

An abstract type representing elapsed time between two points in time. Note that durations can be negative. Literal numeric values may be used as Durations thanks to the Num and Fractional instances.

Instances
Functor Duration 
Instance details

Defined in Data.Active

Methods

fmap :: (a -> b) -> Duration a -> Duration b #

(<$) :: a -> Duration b -> Duration a #

Applicative Duration 
Instance details

Defined in Data.Active

Methods

pure :: a -> Duration a #

(<*>) :: Duration (a -> b) -> Duration a -> Duration b #

liftA2 :: (a -> b -> c) -> Duration a -> Duration b -> Duration c #

(*>) :: Duration a -> Duration b -> Duration b #

(<*) :: Duration a -> Duration b -> Duration a #

Additive Duration 
Instance details

Defined in Data.Active

Methods

zero :: Num a => Duration a #

(^+^) :: Num a => Duration a -> Duration a -> Duration a #

(^-^) :: Num a => Duration a -> Duration a -> Duration a #

lerp :: Num a => a -> Duration a -> Duration a -> Duration a #

liftU2 :: (a -> a -> a) -> Duration a -> Duration a -> Duration a #

liftI2 :: (a -> b -> c) -> Duration a -> Duration b -> Duration c #

Enum n => Enum (Duration n) 
Instance details

Defined in Data.Active

Eq n => Eq (Duration n) 
Instance details

Defined in Data.Active

Methods

(==) :: Duration n -> Duration n -> Bool #

(/=) :: Duration n -> Duration n -> Bool #

Fractional n => Fractional (Duration n) 
Instance details

Defined in Data.Active

Num n => Num (Duration n) 
Instance details

Defined in Data.Active

Ord n => Ord (Duration n) 
Instance details

Defined in Data.Active

Methods

compare :: Duration n -> Duration n -> Ordering #

(<) :: Duration n -> Duration n -> Bool #

(<=) :: Duration n -> Duration n -> Bool #

(>) :: Duration n -> Duration n -> Bool #

(>=) :: Duration n -> Duration n -> Bool #

max :: Duration n -> Duration n -> Duration n #

min :: Duration n -> Duration n -> Duration n #

Read n => Read (Duration n) 
Instance details

Defined in Data.Active

Real n => Real (Duration n) 
Instance details

Defined in Data.Active

Methods

toRational :: Duration n -> Rational #

RealFrac n => RealFrac (Duration n) 
Instance details

Defined in Data.Active

Methods

properFraction :: Integral b => Duration n -> (b, Duration n) #

truncate :: Integral b => Duration n -> b #

round :: Integral b => Duration n -> b #

ceiling :: Integral b => Duration n -> b #

floor :: Integral b => Duration n -> b #

Show n => Show (Duration n) 
Instance details

Defined in Data.Active

Methods

showsPrec :: Int -> Duration n -> ShowS #

show :: Duration n -> String #

showList :: [Duration n] -> ShowS #

Num n => Semigroup (Duration n) 
Instance details

Defined in Data.Active

Methods

(<>) :: Duration n -> Duration n -> Duration n #

sconcat :: NonEmpty (Duration n) -> Duration n #

stimes :: Integral b => b -> Duration n -> Duration n #

Num n => Monoid (Duration n) 
Instance details

Defined in Data.Active

Methods

mempty :: Duration n #

mappend :: Duration n -> Duration n -> Duration n #

mconcat :: [Duration n] -> Duration n #

Wrapped (Duration n) 
Instance details

Defined in Data.Active

Associated Types

type Unwrapped (Duration n) :: Type #

Duration n1 ~ t => Rewrapped (Duration n2) t 
Instance details

Defined in Data.Active

type Unwrapped (Duration n) 
Instance details

Defined in Data.Active

type Unwrapped (Duration n) = n

data Time n #

An abstract type for representing points in time. Note that literal numeric values may be used as Times, thanks to the the Num and Fractional instances.

Instances
Functor Time 
Instance details

Defined in Data.Active

Methods

fmap :: (a -> b) -> Time a -> Time b #

(<$) :: a -> Time b -> Time a #

Affine Time 
Instance details

Defined in Data.Active

Associated Types

type Diff Time :: Type -> Type #

Methods

(.-.) :: Num a => Time a -> Time a -> Diff Time a #

(.+^) :: Num a => Time a -> Diff Time a -> Time a #

(.-^) :: Num a => Time a -> Diff Time a -> Time a #

Enum n => Enum (Time n) 
Instance details

Defined in Data.Active

Methods

succ :: Time n -> Time n #

pred :: Time n -> Time n #

toEnum :: Int -> Time n #

fromEnum :: Time n -> Int #

enumFrom :: Time n -> [Time n] #

enumFromThen :: Time n -> Time n -> [Time n] #

enumFromTo :: Time n -> Time n -> [Time n] #

enumFromThenTo :: Time n -> Time n -> Time n -> [Time n] #

Eq n => Eq (Time n) 
Instance details

Defined in Data.Active

Methods

(==) :: Time n -> Time n -> Bool #

(/=) :: Time n -> Time n -> Bool #

Fractional n => Fractional (Time n) 
Instance details

Defined in Data.Active

Methods

(/) :: Time n -> Time n -> Time n #

recip :: Time n -> Time n #

fromRational :: Rational -> Time n #

Num n => Num (Time n) 
Instance details

Defined in Data.Active

Methods

(+) :: Time n -> Time n -> Time n #

(-) :: Time n -> Time n -> Time n #

(*) :: Time n -> Time n -> Time n #

negate :: Time n -> Time n #

abs :: Time n -> Time n #

signum :: Time n -> Time n #

fromInteger :: Integer -> Time n #

Ord n => Ord (Time n) 
Instance details

Defined in Data.Active

Methods

compare :: Time n -> Time n -> Ordering #

(<) :: Time n -> Time n -> Bool #

(<=) :: Time n -> Time n -> Bool #

(>) :: Time n -> Time n -> Bool #

(>=) :: Time n -> Time n -> Bool #

max :: Time n -> Time n -> Time n #

min :: Time n -> Time n -> Time n #

Read n => Read (Time n) 
Instance details

Defined in Data.Active

Real n => Real (Time n) 
Instance details

Defined in Data.Active

Methods

toRational :: Time n -> Rational #

RealFrac n => RealFrac (Time n) 
Instance details

Defined in Data.Active

Methods

properFraction :: Integral b => Time n -> (b, Time n) #

truncate :: Integral b => Time n -> b #

round :: Integral b => Time n -> b #

ceiling :: Integral b => Time n -> b #

floor :: Integral b => Time n -> b #

Show n => Show (Time n) 
Instance details

Defined in Data.Active

Methods

showsPrec :: Int -> Time n -> ShowS #

show :: Time n -> String #

showList :: [Time n] -> ShowS #

Wrapped (Time n) 
Instance details

Defined in Data.Active

Associated Types

type Unwrapped (Time n) :: Type #

Methods

_Wrapped' :: Iso' (Time n) (Unwrapped (Time n)) #

Time n1 ~ t => Rewrapped (Time n2) t 
Instance details

Defined in Data.Active

type Diff Time 
Instance details

Defined in Data.Active

type Unwrapped (Time n) 
Instance details

Defined in Data.Active

type Unwrapped (Time n) = n

class Contravariant (f :: Type -> Type) where #

The class of contravariant functors.

Whereas in Haskell, one can think of a Functor as containing or producing values, a contravariant functor is a functor that can be thought of as consuming values.

As an example, consider the type of predicate functions a -> Bool. One such predicate might be negative x = x < 0, which classifies integers as to whether they are negative. However, given this predicate, we can re-use it in other situations, providing we have a way to map values to integers. For instance, we can use the negative predicate on a person's bank balance to work out if they are currently overdrawn:

newtype Predicate a = Predicate { getPredicate :: a -> Bool }

instance Contravariant Predicate where
  contramap f (Predicate p) = Predicate (p . f)
                                         |   `- First, map the input...
                                         `----- then apply the predicate.

overdrawn :: Predicate Person
overdrawn = contramap personBankBalance negative

Any instance should be subject to the following laws:

contramap id = id
contramap f . contramap g = contramap (g . f)

Note, that the second law follows from the free theorem of the type of contramap and the first law, so you need only check that the former condition holds.

Minimal complete definition

contramap

Methods

contramap :: (a -> b) -> f b -> f a #

(>$) :: b -> f b -> f a infixl 4 #

Replace all locations in the output with the same value. The default definition is contramap . const, but this may be overridden with a more efficient version.

Instances
Contravariant ToJSONKeyFunction 
Instance details

Defined in Data.Aeson.Types.ToJSON

Contravariant Predicate

A Predicate is a Contravariant Functor, because contramap can apply its function argument to the input of the predicate.

Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Predicate b -> Predicate a #

(>$) :: b -> Predicate b -> Predicate a #

Contravariant Comparison

A Comparison is a Contravariant Functor, because contramap can apply its function argument to each input of the comparison function.

Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Comparison b -> Comparison a #

(>$) :: b -> Comparison b -> Comparison a #

Contravariant Equivalence

Equivalence relations are Contravariant, because you can apply the contramapped function to each input to the equivalence relation.

Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Equivalence b -> Equivalence a #

(>$) :: b -> Equivalence b -> Equivalence a #

Contravariant Headless 
Instance details

Defined in Colonnade.Encode

Methods

contramap :: (a -> b) -> Headless b -> Headless a #

(>$) :: b -> Headless b -> Headless a #

Contravariant (V1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> V1 b -> V1 a #

(>$) :: b -> V1 b -> V1 a #

Contravariant (U1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> U1 b -> U1 a #

(>$) :: b -> U1 b -> U1 a #

Contravariant (Op a) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a0 -> b) -> Op a b -> Op a a0 #

(>$) :: b -> Op a b -> Op a a0 #

Contravariant (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Proxy b -> Proxy a #

(>$) :: b -> Proxy b -> Proxy a #

Contravariant m => Contravariant (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

contramap :: (a -> b) -> MaybeT m b -> MaybeT m a #

(>$) :: b -> MaybeT m b -> MaybeT m a #

Contravariant f => Contravariant (Indexing f) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

contramap :: (a -> b) -> Indexing f b -> Indexing f a #

(>$) :: b -> Indexing f b -> Indexing f a #

Contravariant f => Contravariant (Indexing64 f) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

contramap :: (a -> b) -> Indexing64 f b -> Indexing64 f a #

(>$) :: b -> Indexing64 f b -> Indexing64 f a #

Contravariant m => Contravariant (ListT m) 
Instance details

Defined in Control.Monad.Trans.List

Methods

contramap :: (a -> b) -> ListT m b -> ListT m a #

(>$) :: b -> ListT m b -> ListT m a #

Contravariant f => Contravariant (Rec1 f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Rec1 f b -> Rec1 f a #

(>$) :: b -> Rec1 f b -> Rec1 f a #

Contravariant f => Contravariant (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

contramap :: (a -> b) -> IdentityT f b -> IdentityT f a #

(>$) :: b -> IdentityT f b -> IdentityT f a #

Contravariant (Const a :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a0 -> b) -> Const a b -> Const a a0 #

(>$) :: b -> Const a b -> Const a a0 #

Contravariant f => Contravariant (Alt f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Alt f b -> Alt f a #

(>$) :: b -> Alt f b -> Alt f a #

Contravariant m => Contravariant (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

contramap :: (a -> b) -> ExceptT e m b -> ExceptT e m a #

(>$) :: b -> ExceptT e m b -> ExceptT e m a #

Contravariant m => Contravariant (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

contramap :: (a -> b) -> ErrorT e m b -> ErrorT e m a #

(>$) :: b -> ErrorT e m b -> ErrorT e m a #

Contravariant m => Contravariant (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

contramap :: (a -> b) -> StateT s m b -> StateT s m a #

(>$) :: b -> StateT s m b -> StateT s m a #

Contravariant f => Contravariant (Backwards f)

Derived instance.

Instance details

Defined in Control.Applicative.Backwards

Methods

contramap :: (a -> b) -> Backwards f b -> Backwards f a #

(>$) :: b -> Backwards f b -> Backwards f a #

Contravariant f => Contravariant (AlongsideLeft f b) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

contramap :: (a -> b0) -> AlongsideLeft f b b0 -> AlongsideLeft f b a #

(>$) :: b0 -> AlongsideLeft f b b0 -> AlongsideLeft f b a #

Contravariant f => Contravariant (AlongsideRight f a) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

contramap :: (a0 -> b) -> AlongsideRight f a b -> AlongsideRight f a a0 #

(>$) :: b -> AlongsideRight f a b -> AlongsideRight f a a0 #

Contravariant m => Contravariant (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

contramap :: (a -> b) -> WriterT w m b -> WriterT w m a #

(>$) :: b -> WriterT w m b -> WriterT w m a #

Contravariant m => Contravariant (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

contramap :: (a -> b) -> StateT s m b -> StateT s m a #

(>$) :: b -> StateT s m b -> StateT s m a #

Contravariant m => Contravariant (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

contramap :: (a -> b) -> WriterT w m b -> WriterT w m a #

(>$) :: b -> WriterT w m b -> WriterT w m a #

Contravariant f => Contravariant (Reverse f)

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

contramap :: (a -> b) -> Reverse f b -> Reverse f a #

(>$) :: b -> Reverse f b -> Reverse f a #

Contravariant (K1 i c :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> K1 i c b -> K1 i c a #

(>$) :: b -> K1 i c b -> K1 i c a #

(Contravariant f, Contravariant g) => Contravariant (f :+: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> (f :+: g) b -> (f :+: g) a #

(>$) :: b -> (f :+: g) b -> (f :+: g) a #

(Contravariant f, Contravariant g) => Contravariant (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> (f :*: g) b -> (f :*: g) a #

(>$) :: b -> (f :*: g) b -> (f :*: g) a #

(Contravariant f, Contravariant g) => Contravariant (Product f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Product f g b -> Product f g a #

(>$) :: b -> Product f g b -> Product f g a #

(Contravariant f, Contravariant g) => Contravariant (Sum f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Sum f g b -> Sum f g a #

(>$) :: b -> Sum f g b -> Sum f g a #

Contravariant m => Contravariant (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

contramap :: (a -> b) -> ReaderT r m b -> ReaderT r m a #

(>$) :: b -> ReaderT r m b -> ReaderT r m a #

Contravariant f => Contravariant (M1 i c f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> M1 i c f b -> M1 i c f a #

(>$) :: b -> M1 i c f b -> M1 i c f a #

(Functor f, Contravariant g) => Contravariant (f :.: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> (f :.: g) b -> (f :.: g) a #

(>$) :: b -> (f :.: g) b -> (f :.: g) a #

(Functor f, Contravariant g) => Contravariant (Compose f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> Compose f g b -> Compose f g a #

(>$) :: b -> Compose f g b -> Compose f g a #

Contravariant m => Contravariant (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

contramap :: (a -> b) -> RWST r w s m b -> RWST r w s m a #

(>$) :: b -> RWST r w s m b -> RWST r w s m a #

Contravariant f => Contravariant (TakingWhile p f a b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

contramap :: (a0 -> b0) -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 #

(>$) :: b0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 #

(Profunctor p, Contravariant g) => Contravariant (BazaarT p g a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

contramap :: (a0 -> b0) -> BazaarT p g a b b0 -> BazaarT p g a b a0 #

(>$) :: b0 -> BazaarT p g a b b0 -> BazaarT p g a b a0 #

(Profunctor p, Contravariant g) => Contravariant (BazaarT1 p g a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

contramap :: (a0 -> b0) -> BazaarT1 p g a b b0 -> BazaarT1 p g a b a0 #

(>$) :: b0 -> BazaarT1 p g a b b0 -> BazaarT1 p g a b a0 #

(Profunctor p, Contravariant g) => Contravariant (PretextT p g a b) 
Instance details

Defined in Control.Lens.Internal.Context

Methods

contramap :: (a0 -> b0) -> PretextT p g a b b0 -> PretextT p g a b a0 #

(>$) :: b0 -> PretextT p g a b b0 -> PretextT p g a b a0 #

Contravariant m => Contravariant (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

contramap :: (a -> b) -> RWST r w s m b -> RWST r w s m a #

(>$) :: b -> RWST r w s m b -> RWST r w s m a #

option :: b -> (a -> b) -> Option a -> b #

Fold an Option case-wise, just like maybe.

mtimesDefault :: (Integral b, Monoid a) => b -> a -> a #

Repeat a value n times.

mtimesDefault n a = a <> a <> ... <> a  -- using <> (n-1) times

Implemented using stimes and mempty.

This is a suitable definition for an mtimes member of Monoid.

diff :: Semigroup m => m -> Endo m #

This lets you use a difference list of a Semigroup as a Monoid.

cycle1 :: Semigroup m => m -> m #

A generalization of cycle to an arbitrary Semigroup. May fail to terminate for some values in some semigroups.

newtype Min a #

Constructors

Min 

Fields

Instances
Monad Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(>>=) :: Min a -> (a -> Min b) -> Min b #

(>>) :: Min a -> Min b -> Min b #

return :: a -> Min a #

fail :: String -> Min a #

Functor Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fmap :: (a -> b) -> Min a -> Min b #

(<$) :: a -> Min b -> Min a #

MonadFix Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mfix :: (a -> Min a) -> Min a #

Applicative Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Min a #

(<*>) :: Min (a -> b) -> Min a -> Min b #

liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c #

(*>) :: Min a -> Min b -> Min b #

(<*) :: Min a -> Min b -> Min a #

Foldable Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Min m -> m #

foldMap :: Monoid m => (a -> m) -> Min a -> m #

foldr :: (a -> b -> b) -> b -> Min a -> b #

foldr' :: (a -> b -> b) -> b -> Min a -> b #

foldl :: (b -> a -> b) -> b -> Min a -> b #

foldl' :: (b -> a -> b) -> b -> Min a -> b #

foldr1 :: (a -> a -> a) -> Min a -> a #

foldl1 :: (a -> a -> a) -> Min a -> a #

toList :: Min a -> [a] #

null :: Min a -> Bool #

length :: Min a -> Int #

elem :: Eq a => a -> Min a -> Bool #

maximum :: Ord a => Min a -> a #

minimum :: Ord a => Min a -> a #

sum :: Num a => Min a -> a #

product :: Num a => Min a -> a #

Traversable Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) #

sequenceA :: Applicative f => Min (f a) -> f (Min a) #

mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) #

sequence :: Monad m => Min (m a) -> m (Min a) #

Apply Min 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Min (a -> b) -> Min a -> Min b #

(.>) :: Min a -> Min b -> Min b #

(<.) :: Min a -> Min b -> Min a #

liftF2 :: (a -> b -> c) -> Min a -> Min b -> Min c #

ToJSON1 Min 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Min a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Min a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Min a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Min a] -> Encoding #

Traversable1 Min 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Min a -> f (Min b) #

sequence1 :: Apply f => Min (f b) -> f (Min b) #

Bind Min 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Min a -> (a -> Min b) -> Min b #

join :: Min (Min a) -> Min a #

Bounded a => Bounded (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

minBound :: Min a #

maxBound :: Min a #

Enum a => Enum (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

succ :: Min a -> Min a #

pred :: Min a -> Min a #

toEnum :: Int -> Min a #

fromEnum :: Min a -> Int #

enumFrom :: Min a -> [Min a] #

enumFromThen :: Min a -> Min a -> [Min a] #

enumFromTo :: Min a -> Min a -> [Min a] #

enumFromThenTo :: Min a -> Min a -> Min a -> [Min a] #

Eq a => Eq (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

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

Data a => Data (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Min a -> c (Min a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Min a) #

toConstr :: Min a -> Constr #

dataTypeOf :: Min a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Min a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Min a)) #

gmapT :: (forall b. Data b => b -> b) -> Min a -> Min a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Min a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Min a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) #

Num a => Num (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(+) :: Min a -> Min a -> Min a #

(-) :: Min a -> Min a -> Min a #

(*) :: Min a -> Min a -> Min a #

negate :: Min a -> Min a #

abs :: Min a -> Min a #

signum :: Min a -> Min a #

fromInteger :: Integer -> Min a #

Ord a => Ord (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

compare :: Min a -> Min a -> Ordering #

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

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

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

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

max :: Min a -> Min a -> Min a #

min :: Min a -> Min a -> Min a #

Read a => Read (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

show :: Min a -> String #

showList :: [Min a] -> ShowS #

Generic (Min a) 
Instance details

Defined in Data.Semigroup

Associated Types

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

Methods

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

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

Ord a => Semigroup (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Min a -> Min a -> Min a #

sconcat :: NonEmpty (Min a) -> Min a #

stimes :: Integral b => b -> Min a -> Min a #

(Ord a, Bounded a) => Monoid (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Min a #

mappend :: Min a -> Min a -> Min a #

mconcat :: [Min a] -> Min a #

ToJSON a => ToJSON (Min a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

toJSON :: Min a -> Value #

toEncoding :: Min a -> Encoding #

toJSONList :: [Min a] -> Value #

toEncodingList :: [Min a] -> Encoding #

Wrapped (Min a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Min a) :: Type #

Methods

_Wrapped' :: Iso' (Min a) (Unwrapped (Min a)) #

Newtype (Min a)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Min a) :: Type #

Methods

pack :: O (Min a) -> Min a #

unpack :: Min a -> O (Min a) #

Generic1 Min 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Min :: k -> Type #

Methods

from1 :: Min a -> Rep1 Min a #

to1 :: Rep1 Min a -> Min a #

t ~ Min b => Rewrapped (Min a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep (Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep (Min a) = D1 (MetaData "Min" "Data.Semigroup" "base" True) (C1 (MetaCons "Min" PrefixI True) (S1 (MetaSel (Just "getMin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Min a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Min a) = a
type O (Min a) 
Instance details

Defined in Control.Newtype.Generics

type O (Min a) = a
type Rep1 Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep1 Min = D1 (MetaData "Min" "Data.Semigroup" "base" True) (C1 (MetaCons "Min" PrefixI True) (S1 (MetaSel (Just "getMin") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Max a #

Constructors

Max 

Fields

Instances
Monad Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(>>=) :: Max a -> (a -> Max b) -> Max b #

(>>) :: Max a -> Max b -> Max b #

return :: a -> Max a #

fail :: String -> Max a #

Functor Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fmap :: (a -> b) -> Max a -> Max b #

(<$) :: a -> Max b -> Max a #

MonadFix Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mfix :: (a -> Max a) -> Max a #

Applicative Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Max a #

(<*>) :: Max (a -> b) -> Max a -> Max b #

liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c #

(*>) :: Max a -> Max b -> Max b #

(<*) :: Max a -> Max b -> Max a #

Foldable Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Max m -> m #

foldMap :: Monoid m => (a -> m) -> Max a -> m #

foldr :: (a -> b -> b) -> b -> Max a -> b #

foldr' :: (a -> b -> b) -> b -> Max a -> b #

foldl :: (b -> a -> b) -> b -> Max a -> b #

foldl' :: (b -> a -> b) -> b -> Max a -> b #

foldr1 :: (a -> a -> a) -> Max a -> a #

foldl1 :: (a -> a -> a) -> Max a -> a #

toList :: Max a -> [a] #

null :: Max a -> Bool #

length :: Max a -> Int #

elem :: Eq a => a -> Max a -> Bool #

maximum :: Ord a => Max a -> a #

minimum :: Ord a => Max a -> a #

sum :: Num a => Max a -> a #

product :: Num a => Max a -> a #

Traversable Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) #

sequenceA :: Applicative f => Max (f a) -> f (Max a) #

mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) #

sequence :: Monad m => Max (m a) -> m (Max a) #

Apply Max 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Max (a -> b) -> Max a -> Max b #

(.>) :: Max a -> Max b -> Max b #

(<.) :: Max a -> Max b -> Max a #

liftF2 :: (a -> b -> c) -> Max a -> Max b -> Max c #

ToJSON1 Max 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Max a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Max a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Max a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Max a] -> Encoding #

Traversable1 Max 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Max a -> f (Max b) #

sequence1 :: Apply f => Max (f b) -> f (Max b) #

Bind Max 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Max a -> (a -> Max b) -> Max b #

join :: Max (Max a) -> Max a #

Bounded a => Bounded (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

minBound :: Max a #

maxBound :: Max a #

Enum a => Enum (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

succ :: Max a -> Max a #

pred :: Max a -> Max a #

toEnum :: Int -> Max a #

fromEnum :: Max a -> Int #

enumFrom :: Max a -> [Max a] #

enumFromThen :: Max a -> Max a -> [Max a] #

enumFromTo :: Max a -> Max a -> [Max a] #

enumFromThenTo :: Max a -> Max a -> Max a -> [Max a] #

Eq a => Eq (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

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

Data a => Data (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Max a -> c (Max a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Max a) #

toConstr :: Max a -> Constr #

dataTypeOf :: Max a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Max a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Max a)) #

gmapT :: (forall b. Data b => b -> b) -> Max a -> Max a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Max a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Max a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) #

Num a => Num (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(+) :: Max a -> Max a -> Max a #

(-) :: Max a -> Max a -> Max a #

(*) :: Max a -> Max a -> Max a #

negate :: Max a -> Max a #

abs :: Max a -> Max a #

signum :: Max a -> Max a #

fromInteger :: Integer -> Max a #

Ord a => Ord (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

compare :: Max a -> Max a -> Ordering #

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

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

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

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

max :: Max a -> Max a -> Max a #

min :: Max a -> Max a -> Max a #

Read a => Read (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

show :: Max a -> String #

showList :: [Max a] -> ShowS #

Generic (Max a) 
Instance details

Defined in Data.Semigroup

Associated Types

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

Methods

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

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

Ord a => Semigroup (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Max a -> Max a -> Max a #

sconcat :: NonEmpty (Max a) -> Max a #

stimes :: Integral b => b -> Max a -> Max a #

(Ord a, Bounded a) => Monoid (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Max a #

mappend :: Max a -> Max a -> Max a #

mconcat :: [Max a] -> Max a #

ToJSON a => ToJSON (Max a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

toJSON :: Max a -> Value #

toEncoding :: Max a -> Encoding #

toJSONList :: [Max a] -> Value #

toEncodingList :: [Max a] -> Encoding #

Wrapped (Max a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Max a) :: Type #

Methods

_Wrapped' :: Iso' (Max a) (Unwrapped (Max a)) #

Newtype (Max a)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Max a) :: Type #

Methods

pack :: O (Max a) -> Max a #

unpack :: Max a -> O (Max a) #

Generic1 Max 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Max :: k -> Type #

Methods

from1 :: Max a -> Rep1 Max a #

to1 :: Rep1 Max a -> Max a #

t ~ Max b => Rewrapped (Max a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep (Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep (Max a) = D1 (MetaData "Max" "Data.Semigroup" "base" True) (C1 (MetaCons "Max" PrefixI True) (S1 (MetaSel (Just "getMax") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Max a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Max a) = a
type O (Max a) 
Instance details

Defined in Control.Newtype.Generics

type O (Max a) = a
type Rep1 Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep1 Max = D1 (MetaData "Max" "Data.Semigroup" "base" True) (C1 (MetaCons "Max" PrefixI True) (S1 (MetaSel (Just "getMax") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

data Arg a b #

Arg isn't itself a Semigroup in its own right, but it can be placed inside Min and Max to compute an arg min or arg max.

Constructors

Arg a b 
Instances
Bitraversable Arg

Since: base-4.10.0.0

Instance details

Defined in Data.Semigroup

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Arg a b -> f (Arg c d) #

Bifoldable Arg

Since: base-4.10.0.0

Instance details

Defined in Data.Semigroup

Methods

bifold :: Monoid m => Arg m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Arg a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Arg a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Arg a b -> c #

Bifunctor Arg

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

bimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d #

first :: (a -> b) -> Arg a c -> Arg b c #

second :: (b -> c) -> Arg a b -> Arg a c #

Biapplicative Arg 
Instance details

Defined in Data.Biapplicative

Methods

bipure :: a -> b -> Arg a b #

(<<*>>) :: Arg (a -> b) (c -> d) -> Arg a c -> Arg b d #

biliftA2 :: (a -> b -> c) -> (d -> e -> f) -> Arg a d -> Arg b e -> Arg c f #

(*>>) :: Arg a b -> Arg c d -> Arg c d #

(<<*) :: Arg a b -> Arg c d -> Arg a b #

Bitraversable1 Arg 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

bitraverse1 :: Apply f => (a -> f b) -> (c -> f d) -> Arg a c -> f (Arg b d) #

bisequence1 :: Apply f => Arg (f a) (f b) -> f (Arg a b) #

Biapply Arg 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<<.>>) :: Arg (a -> b) (c -> d) -> Arg a c -> Arg b d #

(.>>) :: Arg a b -> Arg c d -> Arg c d #

(<<.) :: Arg a b -> Arg c d -> Arg a b #

Functor (Arg a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fmap :: (a0 -> b) -> Arg a a0 -> Arg a b #

(<$) :: a0 -> Arg a b -> Arg a a0 #

Foldable (Arg a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Arg a m -> m #

foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 #

toList :: Arg a a0 -> [a0] #

null :: Arg a a0 -> Bool #

length :: Arg a a0 -> Int #

elem :: Eq a0 => a0 -> Arg a a0 -> Bool #

maximum :: Ord a0 => Arg a a0 -> a0 #

minimum :: Ord a0 => Arg a a0 -> a0 #

sum :: Num a0 => Arg a a0 -> a0 #

product :: Num a0 => Arg a a0 -> a0 #

Traversable (Arg a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) #

sequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) #

mapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) #

sequence :: Monad m => Arg a (m a0) -> m (Arg a a0) #

Generic1 (Arg a :: Type -> Type) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 (Arg a) :: k -> Type #

Methods

from1 :: Arg a a0 -> Rep1 (Arg a) a0 #

to1 :: Rep1 (Arg a) a0 -> Arg a a0 #

Eq a => Eq (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(==) :: Arg a b -> Arg a b -> Bool #

(/=) :: Arg a b -> Arg a b -> Bool #

(Data a, Data b) => Data (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Arg a b -> c (Arg a b) #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Arg a b) #

toConstr :: Arg a b -> Constr #

dataTypeOf :: Arg a b -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Arg a b)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Arg a b)) #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Arg a b -> Arg a b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Arg a b -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Arg a b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Arg a b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Arg a b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Arg a b -> m (Arg a b) #

Ord a => Ord (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

compare :: Arg a b -> Arg a b -> Ordering #

(<) :: Arg a b -> Arg a b -> Bool #

(<=) :: Arg a b -> Arg a b -> Bool #

(>) :: Arg a b -> Arg a b -> Bool #

(>=) :: Arg a b -> Arg a b -> Bool #

max :: Arg a b -> Arg a b -> Arg a b #

min :: Arg a b -> Arg a b -> Arg a b #

(Read a, Read b) => Read (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

readsPrec :: Int -> ReadS (Arg a b) #

readList :: ReadS [Arg a b] #

readPrec :: ReadPrec (Arg a b) #

readListPrec :: ReadPrec [Arg a b] #

(Show a, Show b) => Show (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

showsPrec :: Int -> Arg a b -> ShowS #

show :: Arg a b -> String #

showList :: [Arg a b] -> ShowS #

Generic (Arg a b) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (Arg a b) :: Type -> Type #

Methods

from :: Arg a b -> Rep (Arg a b) x #

to :: Rep (Arg a b) x -> Arg a b #

type Rep1 (Arg a :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep (Arg a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type ArgMin a b = Min (Arg a b) #

type ArgMax a b = Max (Arg a b) #

newtype First a #

Use Option (First a) to get the behavior of First from Data.Monoid.

Constructors

First 

Fields

Instances
Monad First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(>>=) :: First a -> (a -> First b) -> First b #

(>>) :: First a -> First b -> First b #

return :: a -> First a #

fail :: String -> First a #

Functor First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fmap :: (a -> b) -> First a -> First b #

(<$) :: a -> First b -> First a #

MonadFix First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mfix :: (a -> First a) -> First a #

Applicative First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> First a #

(<*>) :: First (a -> b) -> First a -> First b #

liftA2 :: (a -> b -> c) -> First a -> First b -> First c #

(*>) :: First a -> First b -> First b #

(<*) :: First a -> First b -> First a #

Foldable First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => First m -> m #

foldMap :: Monoid m => (a -> m) -> First a -> m #

foldr :: (a -> b -> b) -> b -> First a -> b #

foldr' :: (a -> b -> b) -> b -> First a -> b #

foldl :: (b -> a -> b) -> b -> First a -> b #

foldl' :: (b -> a -> b) -> b -> First a -> b #

foldr1 :: (a -> a -> a) -> First a -> a #

foldl1 :: (a -> a -> a) -> First a -> a #

toList :: First a -> [a] #

null :: First a -> Bool #

length :: First a -> Int #

elem :: Eq a => a -> First a -> Bool #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

sum :: Num a => First a -> a #

product :: Num a => First a -> a #

Traversable First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) #

sequenceA :: Applicative f => First (f a) -> f (First a) #

mapM :: Monad m => (a -> m b) -> First a -> m (First b) #

sequence :: Monad m => First (m a) -> m (First a) #

Apply First 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: First (a -> b) -> First a -> First b #

(.>) :: First a -> First b -> First b #

(<.) :: First a -> First b -> First a #

liftF2 :: (a -> b -> c) -> First a -> First b -> First c #

ToJSON1 First 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> First a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [First a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> First a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [First a] -> Encoding #

Traversable1 First 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> First a -> f (First b) #

sequence1 :: Apply f => First (f b) -> f (First b) #

Bind First 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: First a -> (a -> First b) -> First b #

join :: First (First a) -> First a #

Bounded a => Bounded (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

minBound :: First a #

maxBound :: First a #

Enum a => Enum (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

succ :: First a -> First a #

pred :: First a -> First a #

toEnum :: Int -> First a #

fromEnum :: First a -> Int #

enumFrom :: First a -> [First a] #

enumFromThen :: First a -> First a -> [First a] #

enumFromTo :: First a -> First a -> [First a] #

enumFromThenTo :: First a -> First a -> First a -> [First a] #

Eq a => Eq (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

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

Data a => Data (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) #

toConstr :: First a -> Constr #

dataTypeOf :: First a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) #

gmapT :: (forall b. Data b => b -> b) -> First a -> First a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r #

gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #

Ord a => Ord (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

compare :: First a -> First a -> Ordering #

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

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

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

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

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Read a => Read (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

show :: First a -> String #

showList :: [First a] -> ShowS #

Generic (First a) 
Instance details

Defined in Data.Semigroup

Associated Types

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

Methods

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

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

Semigroup (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: First a -> First a -> First a #

sconcat :: NonEmpty (First a) -> First a #

stimes :: Integral b => b -> First a -> First a #

ToJSON a => ToJSON (First a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Wrapped (First a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (First a) :: Type #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Newtype (First a)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (First a) :: Type #

Methods

pack :: O (First a) -> First a #

unpack :: First a -> O (First a) #

Generic1 First 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 First :: k -> Type #

Methods

from1 :: First a -> Rep1 First a #

to1 :: Rep1 First a -> First a #

t ~ First b => Rewrapped (First a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep (First a) = D1 (MetaData "First" "Data.Semigroup" "base" True) (C1 (MetaCons "First" PrefixI True) (S1 (MetaSel (Just "getFirst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (First a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (First a) = a
type O (First a) 
Instance details

Defined in Control.Newtype.Generics

type O (First a) = a
type Rep1 First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep1 First = D1 (MetaData "First" "Data.Semigroup" "base" True) (C1 (MetaCons "First" PrefixI True) (S1 (MetaSel (Just "getFirst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Last a #

Use Option (Last a) to get the behavior of Last from Data.Monoid

Constructors

Last 

Fields

Instances
Monad Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(>>=) :: Last a -> (a -> Last b) -> Last b #

(>>) :: Last a -> Last b -> Last b #

return :: a -> Last a #

fail :: String -> Last a #

Functor Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fmap :: (a -> b) -> Last a -> Last b #

(<$) :: a -> Last b -> Last a #

MonadFix Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mfix :: (a -> Last a) -> Last a #

Applicative Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Last a #

(<*>) :: Last (a -> b) -> Last a -> Last b #

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c #

(*>) :: Last a -> Last b -> Last b #

(<*) :: Last a -> Last b -> Last a #

Foldable Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Last m -> m #

foldMap :: Monoid m => (a -> m) -> Last a -> m #

foldr :: (a -> b -> b) -> b -> Last a -> b #

foldr' :: (a -> b -> b) -> b -> Last a -> b #

foldl :: (b -> a -> b) -> b -> Last a -> b #

foldl' :: (b -> a -> b) -> b -> Last a -> b #

foldr1 :: (a -> a -> a) -> Last a -> a #

foldl1 :: (a -> a -> a) -> Last a -> a #

toList :: Last a -> [a] #

null :: Last a -> Bool #

length :: Last a -> Int #

elem :: Eq a => a -> Last a -> Bool #

maximum :: Ord a => Last a -> a #

minimum :: Ord a => Last a -> a #

sum :: Num a => Last a -> a #

product :: Num a => Last a -> a #

Traversable Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) #

sequenceA :: Applicative f => Last (f a) -> f (Last a) #

mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) #

sequence :: Monad m => Last (m a) -> m (Last a) #

Apply Last 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Last (a -> b) -> Last a -> Last b #

(.>) :: Last a -> Last b -> Last b #

(<.) :: Last a -> Last b -> Last a #

liftF2 :: (a -> b -> c) -> Last a -> Last b -> Last c #

ToJSON1 Last 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Last a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Last a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Last a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Last a] -> Encoding #

Traversable1 Last 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Last a -> f (Last b) #

sequence1 :: Apply f => Last (f b) -> f (Last b) #

Bind Last 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Last a -> (a -> Last b) -> Last b #

join :: Last (Last a) -> Last a #

Bounded a => Bounded (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

minBound :: Last a #

maxBound :: Last a #

Enum a => Enum (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

succ :: Last a -> Last a #

pred :: Last a -> Last a #

toEnum :: Int -> Last a #

fromEnum :: Last a -> Int #

enumFrom :: Last a -> [Last a] #

enumFromThen :: Last a -> Last a -> [Last a] #

enumFromTo :: Last a -> Last a -> [Last a] #

enumFromThenTo :: Last a -> Last a -> Last a -> [Last a] #

Eq a => Eq (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

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

Data a => Data (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Last a -> c (Last a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Last a) #

toConstr :: Last a -> Constr #

dataTypeOf :: Last a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Last a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Last a)) #

gmapT :: (forall b. Data b => b -> b) -> Last a -> Last a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Last a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Last a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #

Ord a => Ord (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

compare :: Last a -> Last a -> Ordering #

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

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

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

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

max :: Last a -> Last a -> Last a #

min :: Last a -> Last a -> Last a #

Read a => Read (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

show :: Last a -> String #

showList :: [Last a] -> ShowS #

Generic (Last a) 
Instance details

Defined in Data.Semigroup

Associated Types

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

Methods

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

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

Semigroup (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Last a -> Last a -> Last a #

sconcat :: NonEmpty (Last a) -> Last a #

stimes :: Integral b => b -> Last a -> Last a #

ToJSON a => ToJSON (Last a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Wrapped (Last a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Last a) :: Type #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Newtype (Last a)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Last a) :: Type #

Methods

pack :: O (Last a) -> Last a #

unpack :: Last a -> O (Last a) #

Generic1 Last 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Last :: k -> Type #

Methods

from1 :: Last a -> Rep1 Last a #

to1 :: Rep1 Last a -> Last a #

t ~ Last b => Rewrapped (Last a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep (Last a) = D1 (MetaData "Last" "Data.Semigroup" "base" True) (C1 (MetaCons "Last" PrefixI True) (S1 (MetaSel (Just "getLast") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Last a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Last a) = a
type O (Last a) 
Instance details

Defined in Control.Newtype.Generics

type O (Last a) = a
type Rep1 Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep1 Last = D1 (MetaData "Last" "Data.Semigroup" "base" True) (C1 (MetaCons "Last" PrefixI True) (S1 (MetaSel (Just "getLast") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype WrappedMonoid m #

Provide a Semigroup for an arbitrary Monoid.

NOTE: This is not needed anymore since Semigroup became a superclass of Monoid in base-4.11 and this newtype be deprecated at some point in the future.

Constructors

WrapMonoid 

Fields

Instances
ToJSON1 WrappedMonoid 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> WrappedMonoid a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [WrappedMonoid a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> WrappedMonoid a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [WrappedMonoid a] -> Encoding #

Bounded m => Bounded (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Enum a => Enum (WrappedMonoid a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Eq m => Eq (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Data m => Data (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WrappedMonoid m -> c (WrappedMonoid m) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WrappedMonoid m) #

toConstr :: WrappedMonoid m -> Constr #

dataTypeOf :: WrappedMonoid m -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (WrappedMonoid m)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WrappedMonoid m)) #

gmapT :: (forall b. Data b => b -> b) -> WrappedMonoid m -> WrappedMonoid m #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r #

gmapQ :: (forall d. Data d => d -> u) -> WrappedMonoid m -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedMonoid m -> u #

gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) #

gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) #

gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) #

Ord m => Ord (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Read m => Read (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show m => Show (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Generic (WrappedMonoid m) 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep (WrappedMonoid m) :: Type -> Type #

Monoid m => Semigroup (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Monoid m => Monoid (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

ToJSON a => ToJSON (WrappedMonoid a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Wrapped (WrappedMonoid a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedMonoid a) :: Type #

Newtype (WrappedMonoid m)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (WrappedMonoid m) :: Type #

Generic1 WrappedMonoid 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 WrappedMonoid :: k -> Type #

t ~ WrappedMonoid b => Rewrapped (WrappedMonoid a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep (WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep (WrappedMonoid m) = D1 (MetaData "WrappedMonoid" "Data.Semigroup" "base" True) (C1 (MetaCons "WrapMonoid" PrefixI True) (S1 (MetaSel (Just "unwrapMonoid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 m)))
type Unwrapped (WrappedMonoid a) 
Instance details

Defined in Control.Lens.Wrapped

type O (WrappedMonoid m) 
Instance details

Defined in Control.Newtype.Generics

type O (WrappedMonoid m) = m
type Rep1 WrappedMonoid

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep1 WrappedMonoid = D1 (MetaData "WrappedMonoid" "Data.Semigroup" "base" True) (C1 (MetaCons "WrapMonoid" PrefixI True) (S1 (MetaSel (Just "unwrapMonoid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Option a #

Option is effectively Maybe with a better instance of Monoid, built off of an underlying Semigroup instead of an underlying Monoid.

Ideally, this type would not exist at all and we would just fix the Monoid instance of Maybe.

In GHC 8.4 and higher, the Monoid instance for Maybe has been corrected to lift a Semigroup instance instead of a Monoid instance. Consequently, this type is no longer useful. It will be marked deprecated in GHC 8.8 and removed in GHC 8.10.

Constructors

Option 

Fields

Instances
Monad Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(>>=) :: Option a -> (a -> Option b) -> Option b #

(>>) :: Option a -> Option b -> Option b #

return :: a -> Option a #

fail :: String -> Option a #

Functor Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fmap :: (a -> b) -> Option a -> Option b #

(<$) :: a -> Option b -> Option a #

MonadFix Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mfix :: (a -> Option a) -> Option a #

Applicative Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Option a #

(<*>) :: Option (a -> b) -> Option a -> Option b #

liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c #

(*>) :: Option a -> Option b -> Option b #

(<*) :: Option a -> Option b -> Option a #

Foldable Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Option m -> m #

foldMap :: Monoid m => (a -> m) -> Option a -> m #

foldr :: (a -> b -> b) -> b -> Option a -> b #

foldr' :: (a -> b -> b) -> b -> Option a -> b #

foldl :: (b -> a -> b) -> b -> Option a -> b #

foldl' :: (b -> a -> b) -> b -> Option a -> b #

foldr1 :: (a -> a -> a) -> Option a -> a #

foldl1 :: (a -> a -> a) -> Option a -> a #

toList :: Option a -> [a] #

null :: Option a -> Bool #

length :: Option a -> Int #

elem :: Eq a => a -> Option a -> Bool #

maximum :: Ord a => Option a -> a #

minimum :: Ord a => Option a -> a #

sum :: Num a => Option a -> a #

product :: Num a => Option a -> a #

Traversable Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

traverse :: Applicative f => (a -> f b) -> Option a -> f (Option b) #

sequenceA :: Applicative f => Option (f a) -> f (Option a) #

mapM :: Monad m => (a -> m b) -> Option a -> m (Option b) #

sequence :: Monad m => Option (m a) -> m (Option a) #

MonadPlus Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mzero :: Option a #

mplus :: Option a -> Option a -> Option a #

Alternative Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

empty :: Option a #

(<|>) :: Option a -> Option a -> Option a #

some :: Option a -> Option [a] #

many :: Option a -> Option [a] #

Apply Option 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Option (a -> b) -> Option a -> Option b #

(.>) :: Option a -> Option b -> Option b #

(<.) :: Option a -> Option b -> Option a #

liftF2 :: (a -> b -> c) -> Option a -> Option b -> Option c #

ToJSON1 Option 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Option a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Option a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Option a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Option a] -> Encoding #

Bind Option 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Option a -> (a -> Option b) -> Option b #

join :: Option (Option a) -> Option a #

(Selector s, GToJSON enc arity (K1 i (Maybe a) :: Type -> Type), KeyValuePair enc pairs, Monoid pairs) => RecordToPairs enc pairs arity (S1 s (K1 i (Option a) :: Type -> Type)) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

recordToPairs :: Options -> ToArgs enc arity a0 -> S1 s (K1 i (Option a)) a0 -> pairs

Eq a => Eq (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

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

Data a => Data (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Option a -> c (Option a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Option a) #

toConstr :: Option a -> Constr #

dataTypeOf :: Option a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Option a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Option a)) #

gmapT :: (forall b. Data b => b -> b) -> Option a -> Option a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Option a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Option a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Option a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Option a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Option a -> m (Option a) #

Ord a => Ord (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

compare :: Option a -> Option a -> Ordering #

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

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

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

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

max :: Option a -> Option a -> Option a #

min :: Option a -> Option a -> Option a #

Read a => Read (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

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

show :: Option a -> String #

showList :: [Option a] -> ShowS #

Generic (Option a) 
Instance details

Defined in Data.Semigroup

Associated Types

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

Methods

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

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

Semigroup a => Semigroup (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

(<>) :: Option a -> Option a -> Option a #

sconcat :: NonEmpty (Option a) -> Option a #

stimes :: Integral b => b -> Option a -> Option a #

Semigroup a => Monoid (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

mempty :: Option a #

mappend :: Option a -> Option a -> Option a #

mconcat :: [Option a] -> Option a #

ToJSON a => ToJSON (Option a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Wrapped (Option a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Option a) :: Type #

Methods

_Wrapped' :: Iso' (Option a) (Unwrapped (Option a)) #

Newtype (Option a)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Option a) :: Type #

Methods

pack :: O (Option a) -> Option a #

unpack :: Option a -> O (Option a) #

Generic1 Option 
Instance details

Defined in Data.Semigroup

Associated Types

type Rep1 Option :: k -> Type #

Methods

from1 :: Option a -> Rep1 Option a #

to1 :: Rep1 Option a -> Option a #

t ~ Option b => Rewrapped (Option a) t 
Instance details

Defined in Control.Lens.Wrapped

(Action a a', Action (SM a) l) => Action (SM a) (Option a', l) 
Instance details

Defined in Data.Monoid.MList

Methods

act :: SM a -> (Option a', l) -> (Option a', l) #

MList l => MList (a ::: l) 
Instance details

Defined in Data.Monoid.MList

Methods

empty :: a ::: l #

MList t => (a ::: t) :>: a 
Instance details

Defined in Data.Monoid.MList

Methods

inj :: a -> a ::: t #

get :: (a ::: t) -> Option a #

alt :: (Option a -> Option a) -> (a ::: t) -> a ::: t #

t :>: a => (b ::: t) :>: a 
Instance details

Defined in Data.Monoid.MList

Methods

inj :: a -> b ::: t #

get :: (b ::: t) -> Option a #

alt :: (Option a -> Option a) -> (b ::: t) -> b ::: t #

(Metric v, OrderedField n) => Measured (SegMeasure v n) (SegMeasure v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: SegMeasure v n -> SegMeasure v n #

(Floating n, Ord n, Metric v) => Measured (SegMeasure v n) (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

measure :: SegTree v n -> SegMeasure v n #

(OrderedField n, Metric v) => Measured (SegMeasure v n) (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: Segment Closed v n -> SegMeasure v n #

type Rep (Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep (Option a) = D1 (MetaData "Option" "Data.Semigroup" "base" True) (C1 (MetaCons "Option" PrefixI True) (S1 (MetaSel (Just "getOption") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a))))
type V (Option a) 
Instance details

Defined in Diagrams.Core.V

type V (Option a) = V a
type N (Option a) 
Instance details

Defined in Diagrams.Core.V

type N (Option a) = N a
type Unwrapped (Option a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Option a) = Maybe a
type O (Option a) 
Instance details

Defined in Control.Newtype.Generics

type O (Option a) = Maybe a
type Rep1 Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

type Rep1 Option = D1 (MetaData "Option" "Data.Semigroup" "base" True) (C1 (MetaCons "Option" PrefixI True) (S1 (MetaSel (Just "getOption") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 Maybe)))

class Bifunctor (p :: Type -> Type -> Type) where #

A bifunctor is a type constructor that takes two type arguments and is a functor in both arguments. That is, unlike with Functor, a type constructor such as Either does not need to be partially applied for a Bifunctor instance, and the methods in this class permit mapping functions over the Left value or the Right value, or both at the same time.

Formally, the class Bifunctor represents a bifunctor from Hask -> Hask.

Intuitively it is a bifunctor where both the first and second arguments are covariant.

You can define a Bifunctor by either defining bimap or by defining both first and second.

If you supply bimap, you should ensure that:

bimap id idid

If you supply first and second, ensure:

first idid
second idid

If you supply both, you should also ensure:

bimap f g ≡ first f . second g

These ensure by parametricity:

bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
first  (f . g) ≡ first  f . first  g
second (f . g) ≡ second f . second g

Since: base-4.8.0.0

Minimal complete definition

bimap | first, second

Methods

bimap :: (a -> b) -> (c -> d) -> p a c -> p b d #

Map over both arguments at the same time.

bimap f g ≡ first f . second g

Examples

Expand
>>> bimap toUpper (+1) ('j', 3)
('J',4)
>>> bimap toUpper (+1) (Left 'j')
Left 'J'
>>> bimap toUpper (+1) (Right 3)
Right 4
Instances
Bifunctor Either

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d #

first :: (a -> b) -> Either a c -> Either b c #

second :: (b -> c) -> Either a b -> Either a c #

Bifunctor (,)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) #

first :: (a -> b) -> (a, c) -> (b, c) #

second :: (b -> c) -> (a, b) -> (a, c) #

Bifunctor Arg

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

bimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d #

first :: (a -> b) -> Arg a c -> Arg b c #

second :: (b -> c) -> Arg a b -> Arg a c #

Bifunctor ((,,) x1)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, a, c) -> (x1, b, d) #

first :: (a -> b) -> (x1, a, c) -> (x1, b, c) #

second :: (b -> c) -> (x1, a, b) -> (x1, a, c) #

Bifunctor (Const :: Type -> Type -> Type)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d #

first :: (a -> b) -> Const a c -> Const b c #

second :: (b -> c) -> Const a b -> Const a c #

Functor f => Bifunctor (FreeF f) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

bimap :: (a -> b) -> (c -> d) -> FreeF f a c -> FreeF f b d #

first :: (a -> b) -> FreeF f a c -> FreeF f b c #

second :: (b -> c) -> FreeF f a b -> FreeF f a c #

Functor f => Bifunctor (CofreeF f) 
Instance details

Defined in Control.Comonad.Trans.Cofree

Methods

bimap :: (a -> b) -> (c -> d) -> CofreeF f a c -> CofreeF f b d #

first :: (a -> b) -> CofreeF f a c -> CofreeF f b c #

second :: (b -> c) -> CofreeF f a b -> CofreeF f a c #

Functor f => Bifunctor (AlongsideLeft f) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

bimap :: (a -> b) -> (c -> d) -> AlongsideLeft f a c -> AlongsideLeft f b d #

first :: (a -> b) -> AlongsideLeft f a c -> AlongsideLeft f b c #

second :: (b -> c) -> AlongsideLeft f a b -> AlongsideLeft f a c #

Functor f => Bifunctor (AlongsideRight f) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

bimap :: (a -> b) -> (c -> d) -> AlongsideRight f a c -> AlongsideRight f b d #

first :: (a -> b) -> AlongsideRight f a c -> AlongsideRight f b c #

second :: (b -> c) -> AlongsideRight f a b -> AlongsideRight f a c #

Bifunctor (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Tagged

Methods

bimap :: (a -> b) -> (c -> d) -> Tagged a c -> Tagged b d #

first :: (a -> b) -> Tagged a c -> Tagged b c #

second :: (b -> c) -> Tagged a b -> Tagged a c #

Bifunctor (K1 i :: Type -> Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> K1 i a c -> K1 i b d #

first :: (a -> b) -> K1 i a c -> K1 i b c #

second :: (b -> c) -> K1 i a b -> K1 i a c #

Bifunctor ((,,,) x1 x2)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, a, c) -> (x1, x2, b, d) #

first :: (a -> b) -> (x1, x2, a, c) -> (x1, x2, b, c) #

second :: (b -> c) -> (x1, x2, a, b) -> (x1, x2, a, c) #

Bifunctor ((,,,,) x1 x2 x3)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, d) #

first :: (a -> b) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, c) #

second :: (b -> c) -> (x1, x2, x3, a, b) -> (x1, x2, x3, a, c) #

Bifunctor p => Bifunctor (WrappedBifunctor p) 
Instance details

Defined in Data.Bifunctor.Wrapped

Methods

bimap :: (a -> b) -> (c -> d) -> WrappedBifunctor p a c -> WrappedBifunctor p b d #

first :: (a -> b) -> WrappedBifunctor p a c -> WrappedBifunctor p b c #

second :: (b -> c) -> WrappedBifunctor p a b -> WrappedBifunctor p a c #

Functor g => Bifunctor (Joker g :: Type -> Type -> Type) 
Instance details

Defined in Data.Bifunctor.Joker

Methods

bimap :: (a -> b) -> (c -> d) -> Joker g a c -> Joker g b d #

first :: (a -> b) -> Joker g a c -> Joker g b c #

second :: (b -> c) -> Joker g a b -> Joker g a c #

Bifunctor p => Bifunctor (Flip p) 
Instance details

Defined in Data.Bifunctor.Flip

Methods

bimap :: (a -> b) -> (c -> d) -> Flip p a c -> Flip p b d #

first :: (a -> b) -> Flip p a c -> Flip p b c #

second :: (b -> c) -> Flip p a b -> Flip p a c #

Functor f => Bifunctor (Clown f :: Type -> Type -> Type) 
Instance details

Defined in Data.Bifunctor.Clown

Methods

bimap :: (a -> b) -> (c -> d) -> Clown f a c -> Clown f b d #

first :: (a -> b) -> Clown f a c -> Clown f b c #

second :: (b -> c) -> Clown f a b -> Clown f a c #

Bifunctor ((,,,,,) x1 x2 x3 x4)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, d) #

first :: (a -> b) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, c) #

second :: (b -> c) -> (x1, x2, x3, x4, a, b) -> (x1, x2, x3, x4, a, c) #

(Bifunctor p, Bifunctor q) => Bifunctor (Sum p q) 
Instance details

Defined in Data.Bifunctor.Sum

Methods

bimap :: (a -> b) -> (c -> d) -> Sum p q a c -> Sum p q b d #

first :: (a -> b) -> Sum p q a c -> Sum p q b c #

second :: (b -> c) -> Sum p q a b -> Sum p q a c #

(Bifunctor f, Bifunctor g) => Bifunctor (Product f g) 
Instance details

Defined in Data.Bifunctor.Product

Methods

bimap :: (a -> b) -> (c -> d) -> Product f g a c -> Product f g b d #

first :: (a -> b) -> Product f g a c -> Product f g b c #

second :: (b -> c) -> Product f g a b -> Product f g a c #

Bifunctor ((,,,,,,) x1 x2 x3 x4 x5)

Since: base-4.8.0.0

Instance details

Defined in Data.Bifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, d) #

first :: (a -> b) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, c) #

second :: (b -> c) -> (x1, x2, x3, x4, x5, a, b) -> (x1, x2, x3, x4, x5, a, c) #

(Functor f, Bifunctor p) => Bifunctor (Tannen f p) 
Instance details

Defined in Data.Bifunctor.Tannen

Methods

bimap :: (a -> b) -> (c -> d) -> Tannen f p a c -> Tannen f p b d #

first :: (a -> b) -> Tannen f p a c -> Tannen f p b c #

second :: (b -> c) -> Tannen f p a b -> Tannen f p a c #

(Bifunctor p, Functor f, Functor g) => Bifunctor (Biff p f g) 
Instance details

Defined in Data.Bifunctor.Biff

Methods

bimap :: (a -> b) -> (c -> d) -> Biff p f g a c -> Biff p f g b d #

first :: (a -> b) -> Biff p f g a c -> Biff p f g b c #

second :: (b -> c) -> Biff p f g a b -> Biff p f g a c #

stimesMonoid :: (Integral b, Monoid a) => b -> a -> a #

This is a valid definition of stimes for a Monoid.

Unlike the default definition of stimes, it is defined for 0 and so it should be preferred where possible.

stimesIdempotent :: Integral b => b -> a -> a #

This is a valid definition of stimes for an idempotent Semigroup.

When x <> x = x, this definition should be preferred, because it works in O(1) rather than O(log n).

newtype Dual a #

The dual of a Monoid, obtained by swapping the arguments of mappend.

>>> getDual (mappend (Dual "Hello") (Dual "World"))
"WorldHello"

Constructors

Dual 

Fields

Instances
Monad Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Dual a -> (a -> Dual b) -> Dual b #

(>>) :: Dual a -> Dual b -> Dual b #

return :: a -> Dual a #

fail :: String -> Dual a #

Functor Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Dual a -> Dual b #

(<$) :: a -> Dual b -> Dual a #

Applicative Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Dual a #

(<*>) :: Dual (a -> b) -> Dual a -> Dual b #

liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c #

(*>) :: Dual a -> Dual b -> Dual b #

(<*) :: Dual a -> Dual b -> Dual a #

Foldable Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Dual m -> m #

foldMap :: Monoid m => (a -> m) -> Dual a -> m #

foldr :: (a -> b -> b) -> b -> Dual a -> b #

foldr' :: (a -> b -> b) -> b -> Dual a -> b #

foldl :: (b -> a -> b) -> b -> Dual a -> b #

foldl' :: (b -> a -> b) -> b -> Dual a -> b #

foldr1 :: (a -> a -> a) -> Dual a -> a #

foldl1 :: (a -> a -> a) -> Dual a -> a #

toList :: Dual a -> [a] #

null :: Dual a -> Bool #

length :: Dual a -> Int #

elem :: Eq a => a -> Dual a -> Bool #

maximum :: Ord a => Dual a -> a #

minimum :: Ord a => Dual a -> a #

sum :: Num a => Dual a -> a #

product :: Num a => Dual a -> a #

Traversable Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) #

sequenceA :: Applicative f => Dual (f a) -> f (Dual a) #

mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) #

sequence :: Monad m => Dual (m a) -> m (Dual a) #

Apply Dual 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Dual (a -> b) -> Dual a -> Dual b #

(.>) :: Dual a -> Dual b -> Dual b #

(<.) :: Dual a -> Dual b -> Dual a #

liftF2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c #

Representable Dual 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep Dual :: Type #

Methods

tabulate :: (Rep Dual -> a) -> Dual a #

index :: Dual a -> Rep Dual -> a #

ToJSON1 Dual 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Dual a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Dual a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Dual a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Dual a] -> Encoding #

Traversable1 Dual 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Dual a -> f (Dual b) #

sequence1 :: Apply f => Dual (f b) -> f (Dual b) #

Bind Dual 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Dual a -> (a -> Dual b) -> Dual b #

join :: Dual (Dual a) -> Dual a #

Bounded a => Bounded (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: Dual a #

maxBound :: Dual a #

Eq a => Eq (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

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

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

Ord a => Ord (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: Dual a -> Dual a -> Ordering #

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

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

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

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

max :: Dual a -> Dual a -> Dual a #

min :: Dual a -> Dual a -> Dual a #

Read a => Read (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

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

show :: Dual a -> String #

showList :: [Dual a] -> ShowS #

Generic (Dual a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

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

Methods

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

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

Semigroup a => Semigroup (Dual a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Dual a -> Dual a -> Dual a #

sconcat :: NonEmpty (Dual a) -> Dual a #

stimes :: Integral b => b -> Dual a -> Dual a #

Monoid a => Monoid (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Dual a #

mappend :: Dual a -> Dual a -> Dual a #

mconcat :: [Dual a] -> Dual a #

ToJSON a => ToJSON (Dual a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Default a => Default (Dual a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Dual a #

AsEmpty a => AsEmpty (Dual a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Dual a) () #

Wrapped (Dual a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Dual a) :: Type #

Methods

_Wrapped' :: Iso' (Dual a) (Unwrapped (Dual a)) #

Newtype (Dual a)

Since: newtype-generics-0.5.1

Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Dual a) :: Type #

Methods

pack :: O (Dual a) -> Dual a #

unpack :: Dual a -> O (Dual a) #

Generic1 Dual 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Dual :: k -> Type #

Methods

from1 :: Dual a -> Rep1 Dual a #

to1 :: Rep1 Dual a -> Dual a #

t ~ Dual b => Rewrapped (Dual a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep Dual 
Instance details

Defined in Data.Functor.Rep

type Rep Dual = ()
type Rep (Dual a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep (Dual a) = D1 (MetaData "Dual" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Dual" PrefixI True) (S1 (MetaSel (Just "getDual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Dual a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Dual a) = a
type O (Dual a) 
Instance details

Defined in Control.Newtype.Generics

type O (Dual a) = a
type Rep1 Dual

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep1 Dual = D1 (MetaData "Dual" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Dual" PrefixI True) (S1 (MetaSel (Just "getDual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Endo a #

The monoid of endomorphisms under composition.

>>> let computation = Endo ("Hello, " ++) <> Endo (++ "!")
>>> appEndo computation "Haskell"
"Hello, Haskell!"

Constructors

Endo 

Fields

Instances
Generic (Endo a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

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

Methods

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

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

Semigroup (Endo a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Endo a -> Endo a -> Endo a #

sconcat :: NonEmpty (Endo a) -> Endo a #

stimes :: Integral b => b -> Endo a -> Endo a #

Monoid (Endo a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Endo a #

mappend :: Endo a -> Endo a -> Endo a #

mconcat :: [Endo a] -> Endo a #

Default (Endo a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Endo a #

Wrapped (Endo a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Endo a) :: Type #

Methods

_Wrapped' :: Iso' (Endo a) (Unwrapped (Endo a)) #

Newtype (Endo a) 
Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Endo a) :: Type #

Methods

pack :: O (Endo a) -> Endo a #

unpack :: Endo a -> O (Endo a) #

t ~ Endo b => Rewrapped (Endo a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep (Endo a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep (Endo a) = D1 (MetaData "Endo" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Endo" PrefixI True) (S1 (MetaSel (Just "appEndo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a -> a))))
type Unwrapped (Endo a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Endo a) = a -> a
type O (Endo a) 
Instance details

Defined in Control.Newtype.Generics

type O (Endo a) = a -> a

newtype All #

Boolean monoid under conjunction (&&).

>>> getAll (All True <> mempty <> All False)
False
>>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8]))
False

Constructors

All 

Fields

Instances
Bounded All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: All #

maxBound :: All #

Eq All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

(==) :: All -> All -> Bool #

(/=) :: All -> All -> Bool #

Ord All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: All -> All -> Ordering #

(<) :: All -> All -> Bool #

(<=) :: All -> All -> Bool #

(>) :: All -> All -> Bool #

(>=) :: All -> All -> Bool #

max :: All -> All -> All #

min :: All -> All -> All #

Read All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> All -> ShowS #

show :: All -> String #

showList :: [All] -> ShowS #

Generic All 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep All :: Type -> Type #

Methods

from :: All -> Rep All x #

to :: Rep All x -> All #

Semigroup All

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: All -> All -> All #

sconcat :: NonEmpty All -> All #

stimes :: Integral b => b -> All -> All #

Monoid All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: All #

mappend :: All -> All -> All #

mconcat :: [All] -> All #

Default All 
Instance details

Defined in Data.Default.Class

Methods

def :: All #

AsEmpty All 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' All () #

Wrapped All 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped All :: Type #

Newtype All 
Instance details

Defined in Control.Newtype.Generics

Associated Types

type O All :: Type #

Methods

pack :: O All -> All #

unpack :: All -> O All #

t ~ All => Rewrapped All t 
Instance details

Defined in Control.Lens.Wrapped

RealFloat n => HasQuery (Clip n) All

A point inside a clip if the point is in All invididual clipping paths.

Instance details

Defined in Diagrams.TwoD.Path

Methods

getQuery :: Clip n -> Query (V (Clip n)) (N (Clip n)) All #

type Rep All

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep All = D1 (MetaData "All" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "All" PrefixI True) (S1 (MetaSel (Just "getAll") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))
type Unwrapped All 
Instance details

Defined in Control.Lens.Wrapped

type O All 
Instance details

Defined in Control.Newtype.Generics

type O All = Bool

newtype Any #

Boolean monoid under disjunction (||).

>>> getAny (Any True <> mempty <> Any False)
True
>>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
True

Constructors

Any 

Fields

Instances
Bounded Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: Any #

maxBound :: Any #

Eq Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

(==) :: Any -> Any -> Bool #

(/=) :: Any -> Any -> Bool #

Ord Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: Any -> Any -> Ordering #

(<) :: Any -> Any -> Bool #

(<=) :: Any -> Any -> Bool #

(>) :: Any -> Any -> Bool #

(>=) :: Any -> Any -> Bool #

max :: Any -> Any -> Any #

min :: Any -> Any -> Any #

Read Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> Any -> ShowS #

show :: Any -> String #

showList :: [Any] -> ShowS #

Generic Any 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep Any :: Type -> Type #

Methods

from :: Any -> Rep Any x #

to :: Rep Any x -> Any #

Semigroup Any

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Any -> Any -> Any #

sconcat :: NonEmpty Any -> Any #

stimes :: Integral b => b -> Any -> Any #

Monoid Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Any #

mappend :: Any -> Any -> Any #

mconcat :: [Any] -> Any #

Default Any 
Instance details

Defined in Data.Default.Class

Methods

def :: Any #

AsEmpty Any 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' Any () #

Wrapped Any 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped Any :: Type #

Newtype Any 
Instance details

Defined in Control.Newtype.Generics

Associated Types

type O Any :: Type #

Methods

pack :: O Any -> Any #

unpack :: Any -> O Any #

t ~ Any => Rewrapped Any t 
Instance details

Defined in Control.Lens.Wrapped

(Num n, Ord n) => HasQuery (Ellipsoid n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Ellipsoid n -> Query (V (Ellipsoid n)) (N (Ellipsoid n)) Any #

(Num n, Ord n) => HasQuery (Box n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Box n -> Query (V (Box n)) (N (Box n)) Any #

OrderedField n => HasQuery (Frustum n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Frustum n -> Query (V (Frustum n)) (N (Frustum n)) Any #

(Floating n, Ord n) => HasQuery (CSG n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: CSG n -> Query (V (CSG n)) (N (CSG n)) Any #

(Additive v, Foldable v, Ord n) => HasQuery (BoundingBox v n) Any 
Instance details

Defined in Diagrams.BoundingBox

Methods

getQuery :: BoundingBox v n -> Query (V (BoundingBox v n)) (N (BoundingBox v n)) Any #

RealFloat n => HasQuery (DImage n a) Any 
Instance details

Defined in Diagrams.TwoD.Image

Methods

getQuery :: DImage n a -> Query (V (DImage n a)) (N (DImage n a)) Any #

type Rep Any

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep Any = D1 (MetaData "Any" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Any" PrefixI True) (S1 (MetaSel (Just "getAny") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))
type Unwrapped Any 
Instance details

Defined in Control.Lens.Wrapped

type O Any 
Instance details

Defined in Control.Newtype.Generics

type O Any = Bool

newtype Sum a #

Monoid under addition.

>>> getSum (Sum 1 <> Sum 2 <> mempty)
3

Constructors

Sum 

Fields

Instances
Monad Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Sum a -> (a -> Sum b) -> Sum b #

(>>) :: Sum a -> Sum b -> Sum b #

return :: a -> Sum a #

fail :: String -> Sum a #

Functor Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Sum a -> Sum b #

(<$) :: a -> Sum b -> Sum a #

Applicative Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Sum a #

(<*>) :: Sum (a -> b) -> Sum a -> Sum b #

liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c #

(*>) :: Sum a -> Sum b -> Sum b #

(<*) :: Sum a -> Sum b -> Sum a #

Foldable Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Sum m -> m #

foldMap :: Monoid m => (a -> m) -> Sum a -> m #

foldr :: (a -> b -> b) -> b -> Sum a -> b #

foldr' :: (a -> b -> b) -> b -> Sum a -> b #

foldl :: (b -> a -> b) -> b -> Sum a -> b #

foldl' :: (b -> a -> b) -> b -> Sum a -> b #

foldr1 :: (a -> a -> a) -> Sum a -> a #

foldl1 :: (a -> a -> a) -> Sum a -> a #

toList :: Sum a -> [a] #

null :: Sum a -> Bool #

length :: Sum a -> Int #

elem :: Eq a => a -> Sum a -> Bool #

maximum :: Ord a => Sum a -> a #

minimum :: Ord a => Sum a -> a #

sum :: Num a => Sum a -> a #

product :: Num a => Sum a -> a #

Traversable Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) #

sequenceA :: Applicative f => Sum (f a) -> f (Sum a) #

mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) #

sequence :: Monad m => Sum (m a) -> m (Sum a) #

Apply Sum 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Sum (a -> b) -> Sum a -> Sum b #

(.>) :: Sum a -> Sum b -> Sum b #

(<.) :: Sum a -> Sum b -> Sum a #

liftF2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c #

Representable Sum 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep Sum :: Type #

Methods

tabulate :: (Rep Sum -> a) -> Sum a #

index :: Sum a -> Rep Sum -> a #

Traversable1 Sum 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Sum a -> f (Sum b) #

sequence1 :: Apply f => Sum (f b) -> f (Sum b) #

Bind Sum 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Sum a -> (a -> Sum b) -> Sum b #

join :: Sum (Sum a) -> Sum a #

Bounded a => Bounded (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: Sum a #

maxBound :: Sum a #

Eq a => Eq (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

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

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

Num a => Num (Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(+) :: Sum a -> Sum a -> Sum a #

(-) :: Sum a -> Sum a -> Sum a #

(*) :: Sum a -> Sum a -> Sum a #

negate :: Sum a -> Sum a #

abs :: Sum a -> Sum a #

signum :: Sum a -> Sum a #

fromInteger :: Integer -> Sum a #

Ord a => Ord (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: Sum a -> Sum a -> Ordering #

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

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

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

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

max :: Sum a -> Sum a -> Sum a #

min :: Sum a -> Sum a -> Sum a #

Read a => Read (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

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

show :: Sum a -> String #

showList :: [Sum a] -> ShowS #

Generic (Sum a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

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

Methods

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

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

Num a => Semigroup (Sum a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Sum a -> Sum a -> Sum a #

sconcat :: NonEmpty (Sum a) -> Sum a #

stimes :: Integral b => b -> Sum a -> Sum a #

Num a => Monoid (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

Num a => Default (Sum a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Sum a #

(Eq a, Num a) => AsEmpty (Sum a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Sum a) () #

Wrapped (Sum a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Sum a) :: Type #

Methods

_Wrapped' :: Iso' (Sum a) (Unwrapped (Sum a)) #

Newtype (Sum a) 
Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Sum a) :: Type #

Methods

pack :: O (Sum a) -> Sum a #

unpack :: Sum a -> O (Sum a) #

Generic1 Sum 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Sum :: k -> Type #

Methods

from1 :: Sum a -> Rep1 Sum a #

to1 :: Rep1 Sum a -> Sum a #

t ~ Sum b => Rewrapped (Sum a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep Sum 
Instance details

Defined in Data.Functor.Rep

type Rep Sum = ()
type Rep (Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep (Sum a) = D1 (MetaData "Sum" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Sum" PrefixI True) (S1 (MetaSel (Just "getSum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Sum a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Sum a) = a
type O (Sum a) 
Instance details

Defined in Control.Newtype.Generics

type O (Sum a) = a
type Rep1 Sum

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep1 Sum = D1 (MetaData "Sum" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Sum" PrefixI True) (S1 (MetaSel (Just "getSum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

newtype Product a #

Monoid under multiplication.

>>> getProduct (Product 3 <> Product 4 <> mempty)
12

Constructors

Product 

Fields

Instances
Monad Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Product a -> (a -> Product b) -> Product b #

(>>) :: Product a -> Product b -> Product b #

return :: a -> Product a #

fail :: String -> Product a #

Functor Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Product a -> Product b #

(<$) :: a -> Product b -> Product a #

Applicative Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Product a #

(<*>) :: Product (a -> b) -> Product a -> Product b #

liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c #

(*>) :: Product a -> Product b -> Product b #

(<*) :: Product a -> Product b -> Product a #

Foldable Product

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Product m -> m #

foldMap :: Monoid m => (a -> m) -> Product a -> m #

foldr :: (a -> b -> b) -> b -> Product a -> b #

foldr' :: (a -> b -> b) -> b -> Product a -> b #

foldl :: (b -> a -> b) -> b -> Product a -> b #

foldl' :: (b -> a -> b) -> b -> Product a -> b #

foldr1 :: (a -> a -> a) -> Product a -> a #

foldl1 :: (a -> a -> a) -> Product a -> a #

toList :: Product a -> [a] #

null :: Product a -> Bool #

length :: Product a -> Int #

elem :: Eq a => a -> Product a -> Bool #

maximum :: Ord a => Product a -> a #

minimum :: Ord a => Product a -> a #

sum :: Num a => Product a -> a #

product :: Num a => Product a -> a #

Traversable Product

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) #

sequenceA :: Applicative f => Product (f a) -> f (Product a) #

mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) #

sequence :: Monad m => Product (m a) -> m (Product a) #

Apply Product 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Product (a -> b) -> Product a -> Product b #

(.>) :: Product a -> Product b -> Product b #

(<.) :: Product a -> Product b -> Product a #

liftF2 :: (a -> b -> c) -> Product a -> Product b -> Product c #

Representable Product 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep Product :: Type #

Methods

tabulate :: (Rep Product -> a) -> Product a #

index :: Product a -> Rep Product -> a #

Traversable1 Product 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Product a -> f (Product b) #

sequence1 :: Apply f => Product (f b) -> f (Product b) #

Bind Product 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: Product a -> (a -> Product b) -> Product b #

join :: Product (Product a) -> Product a #

Bounded a => Bounded (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Eq a => Eq (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

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

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

Num a => Num (Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(+) :: Product a -> Product a -> Product a #

(-) :: Product a -> Product a -> Product a #

(*) :: Product a -> Product a -> Product a #

negate :: Product a -> Product a #

abs :: Product a -> Product a #

signum :: Product a -> Product a #

fromInteger :: Integer -> Product a #

Ord a => Ord (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

compare :: Product a -> Product a -> Ordering #

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

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

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

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

max :: Product a -> Product a -> Product a #

min :: Product a -> Product a -> Product a #

Read a => Read (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

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

show :: Product a -> String #

showList :: [Product a] -> ShowS #

Generic (Product a) 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

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

Methods

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

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

Num a => Semigroup (Product a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Product a -> Product a -> Product a #

sconcat :: NonEmpty (Product a) -> Product a #

stimes :: Integral b => b -> Product a -> Product a #

Num a => Monoid (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

mconcat :: [Product a] -> Product a #

Num a => Default (Product a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Product a #

(Eq a, Num a) => AsEmpty (Product a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Product a) () #

Wrapped (Product a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Product a) :: Type #

Methods

_Wrapped' :: Iso' (Product a) (Unwrapped (Product a)) #

Newtype (Product a) 
Instance details

Defined in Control.Newtype.Generics

Associated Types

type O (Product a) :: Type #

Methods

pack :: O (Product a) -> Product a #

unpack :: Product a -> O (Product a) #

Generic1 Product 
Instance details

Defined in Data.Semigroup.Internal

Associated Types

type Rep1 Product :: k -> Type #

Methods

from1 :: Product a -> Rep1 Product a #

to1 :: Rep1 Product a -> Product a #

t ~ Product b => Rewrapped (Product a) t 
Instance details

Defined in Control.Lens.Wrapped

type Rep Product 
Instance details

Defined in Data.Functor.Rep

type Rep Product = ()
type Rep (Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep (Product a) = D1 (MetaData "Product" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Product" PrefixI True) (S1 (MetaSel (Just "getProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Unwrapped (Product a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Product a) = a
type O (Product a) 
Instance details

Defined in Control.Newtype.Generics

type O (Product a) = a
type Rep1 Product

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

type Rep1 Product = D1 (MetaData "Product" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Product" PrefixI True) (S1 (MetaSel (Just "getProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 #

Flipped version of <$>.

(<&>) = flip fmap

Examples

Expand

Apply (+1) to a list, a Just and a Right:

>>> Just 2 <&> (+1)
Just 3
>>> [1,2,3] <&> (+1)
[2,3,4]
>>> Right 3 <&> (+1)
Right 4

Since: base-4.11.0.0

stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a #

This is a valid definition of stimes for an idempotent Monoid.

When mappend x x = x, this definition should be preferred, because it works in O(1) rather than O(log n)

yellow :: (Ord a, Floating a) => Colour a #

whitesmoke :: (Ord a, Floating a) => Colour a #

white :: (Ord a, Floating a) => Colour a #

wheat :: (Ord a, Floating a) => Colour a #

violet :: (Ord a, Floating a) => Colour a #

turquoise :: (Ord a, Floating a) => Colour a #

tomato :: (Ord a, Floating a) => Colour a #

thistle :: (Ord a, Floating a) => Colour a #

teal :: (Ord a, Floating a) => Colour a #

steelblue :: (Ord a, Floating a) => Colour a #

snow :: (Ord a, Floating a) => Colour a #

slategrey :: (Ord a, Floating a) => Colour a #

slategray :: (Ord a, Floating a) => Colour a #

slateblue :: (Ord a, Floating a) => Colour a #

skyblue :: (Ord a, Floating a) => Colour a #

silver :: (Ord a, Floating a) => Colour a #

sienna :: (Ord a, Floating a) => Colour a #

seashell :: (Ord a, Floating a) => Colour a #

seagreen :: (Ord a, Floating a) => Colour a #

sandybrown :: (Ord a, Floating a) => Colour a #

salmon :: (Ord a, Floating a) => Colour a #

royalblue :: (Ord a, Floating a) => Colour a #

rosybrown :: (Ord a, Floating a) => Colour a #

red :: (Ord a, Floating a) => Colour a #

purple :: (Ord a, Floating a) => Colour a #

powderblue :: (Ord a, Floating a) => Colour a #

plum :: (Ord a, Floating a) => Colour a #

pink :: (Ord a, Floating a) => Colour a #

peru :: (Ord a, Floating a) => Colour a #

peachpuff :: (Ord a, Floating a) => Colour a #

papayawhip :: (Ord a, Floating a) => Colour a #

palegreen :: (Ord a, Floating a) => Colour a #

orchid :: (Ord a, Floating a) => Colour a #

orangered :: (Ord a, Floating a) => Colour a #

orange :: (Ord a, Floating a) => Colour a #

olivedrab :: (Ord a, Floating a) => Colour a #

olive :: (Ord a, Floating a) => Colour a #

oldlace :: (Ord a, Floating a) => Colour a #

navy :: (Ord a, Floating a) => Colour a #

moccasin :: (Ord a, Floating a) => Colour a #

mistyrose :: (Ord a, Floating a) => Colour a #

mintcream :: (Ord a, Floating a) => Colour a #

mediumblue :: (Ord a, Floating a) => Colour a #

maroon :: (Ord a, Floating a) => Colour a #

magenta :: (Ord a, Floating a) => Colour a #

linen :: (Ord a, Floating a) => Colour a #

limegreen :: (Ord a, Floating a) => Colour a #

lime :: (Ord a, Floating a) => Colour a #

lightpink :: (Ord a, Floating a) => Colour a #

lightgrey :: (Ord a, Floating a) => Colour a #

lightgreen :: (Ord a, Floating a) => Colour a #

lightgray :: (Ord a, Floating a) => Colour a #

lightcyan :: (Ord a, Floating a) => Colour a #

lightcoral :: (Ord a, Floating a) => Colour a #

lightblue :: (Ord a, Floating a) => Colour a #

lawngreen :: (Ord a, Floating a) => Colour a #

lavender :: (Ord a, Floating a) => Colour a #

khaki :: (Ord a, Floating a) => Colour a #

ivory :: (Ord a, Floating a) => Colour a #

indigo :: (Ord a, Floating a) => Colour a #

indianred :: (Ord a, Floating a) => Colour a #

hotpink :: (Ord a, Floating a) => Colour a #

honeydew :: (Ord a, Floating a) => Colour a #

green :: (Ord a, Floating a) => Colour a #

grey :: (Ord a, Floating a) => Colour a #

gray :: (Ord a, Floating a) => Colour a #

goldenrod :: (Ord a, Floating a) => Colour a #

gold :: (Ord a, Floating a) => Colour a #

ghostwhite :: (Ord a, Floating a) => Colour a #

gainsboro :: (Ord a, Floating a) => Colour a #

fuchsia :: (Ord a, Floating a) => Colour a #

firebrick :: (Ord a, Floating a) => Colour a #

dodgerblue :: (Ord a, Floating a) => Colour a #

dimgrey :: (Ord a, Floating a) => Colour a #

dimgray :: (Ord a, Floating a) => Colour a #

deeppink :: (Ord a, Floating a) => Colour a #

darkviolet :: (Ord a, Floating a) => Colour a #

darksalmon :: (Ord a, Floating a) => Colour a #

darkred :: (Ord a, Floating a) => Colour a #

darkorchid :: (Ord a, Floating a) => Colour a #

darkorange :: (Ord a, Floating a) => Colour a #

darkkhaki :: (Ord a, Floating a) => Colour a #

darkgrey :: (Ord a, Floating a) => Colour a #

darkgreen :: (Ord a, Floating a) => Colour a #

darkgray :: (Ord a, Floating a) => Colour a #

darkcyan :: (Ord a, Floating a) => Colour a #

darkblue :: (Ord a, Floating a) => Colour a #

cyan :: (Ord a, Floating a) => Colour a #

crimson :: (Ord a, Floating a) => Colour a #

cornsilk :: (Ord a, Floating a) => Colour a #

coral :: (Ord a, Floating a) => Colour a #

chocolate :: (Ord a, Floating a) => Colour a #

chartreuse :: (Ord a, Floating a) => Colour a #

cadetblue :: (Ord a, Floating a) => Colour a #

burlywood :: (Ord a, Floating a) => Colour a #

brown :: (Ord a, Floating a) => Colour a #

blueviolet :: (Ord a, Floating a) => Colour a #

blue :: (Ord a, Floating a) => Colour a #

bisque :: (Ord a, Floating a) => Colour a #

beige :: (Ord a, Floating a) => Colour a #

azure :: (Ord a, Floating a) => Colour a #

aquamarine :: (Ord a, Floating a) => Colour a #

aqua :: (Ord a, Floating a) => Colour a #

aliceblue :: (Ord a, Floating a) => Colour a #

readColourName :: (MonadFail m, Monad m, Ord a, Floating a) => String -> m (Colour a) #

sRGBSpace :: (Ord a, Floating a) => RGBSpace a #

The sRGB colour space

sRGB24read :: (Ord b, Floating b) => String -> Colour b #

Read a colour in hexadecimal form, e.g. "#00aaff" or "00aaff"

sRGB24reads :: (Ord b, Floating b) => ReadS (Colour b) #

Read a colour in hexadecimal form, e.g. "#00aaff" or "00aaff"

sRGB24show :: (RealFrac b, Floating b) => Colour b -> String #

Show a colour in hexadecimal form, e.g. "#00aaff"

sRGB24shows :: (RealFrac b, Floating b) => Colour b -> ShowS #

Show a colour in hexadecimal form, e.g. "#00aaff"

toSRGB24 :: (RealFrac b, Floating b) => Colour b -> RGB Word8 #

Return the approximate 24-bit sRGB colour components as three 8-bit components. Out of range values are clamped.

toSRGBBounded :: (RealFrac b, Floating b, Integral a, Bounded a) => Colour b -> RGB a #

Return the approximate sRGB colour components in the range [0..maxBound]. Out of range values are clamped.

toSRGB :: (Ord b, Floating b) => Colour b -> RGB b #

Return the sRGB colour components in the range [0..1].

sRGB24 :: (Ord b, Floating b) => Word8 -> Word8 -> Word8 -> Colour b #

Construct a colour from a 24-bit (three 8-bit words) sRGB specification.

sRGBBounded :: (Ord b, Floating b, Integral a, Bounded a) => a -> a -> a -> Colour b #

Construct a colour from an sRGB specification. Input components are expected to be in the range [0..maxBound].

sRGB :: (Ord b, Floating b) => b -> b -> b -> Colour b #

Construct a colour from an sRGB specification. Input components are expected to be in the range [0..1].

data RGB a #

An RGB triple for an unspecified colour space.

Constructors

RGB 

Fields

Instances
Functor RGB 
Instance details

Defined in Data.Colour.RGB

Methods

fmap :: (a -> b) -> RGB a -> RGB b #

(<$) :: a -> RGB b -> RGB a #

Applicative RGB 
Instance details

Defined in Data.Colour.RGB

Methods

pure :: a -> RGB a #

(<*>) :: RGB (a -> b) -> RGB a -> RGB b #

liftA2 :: (a -> b -> c) -> RGB a -> RGB b -> RGB c #

(*>) :: RGB a -> RGB b -> RGB b #

(<*) :: RGB a -> RGB b -> RGB a #

Eq a => Eq (RGB a) 
Instance details

Defined in Data.Colour.RGB

Methods

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

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

Read a => Read (RGB a) 
Instance details

Defined in Data.Colour.RGB

Show a => Show (RGB a) 
Instance details

Defined in Data.Colour.RGB

Methods

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

show :: RGB a -> String #

showList :: [RGB a] -> ShowS #

alphaChannel :: AlphaColour a -> a #

Returns the opacity of an AlphaColour.

blend :: (Num a, AffineSpace f) => a -> f a -> f a -> f a #

Compute the weighted average of two points. e.g.

blend 0.4 a b = 0.4*a + 0.6*b

The weight can be negative, or greater than 1.0; however, be aware that non-convex combinations may lead to out of gamut colours.

withOpacity :: Num a => Colour a -> a -> AlphaColour a #

Creates an AlphaColour from a Colour with a given opacity.

c `withOpacity` o == dissolve o (opaque c)

dissolve :: Num a => a -> AlphaColour a -> AlphaColour a #

Returns an AlphaColour more transparent by a factor of o.

opaque :: Num a => Colour a -> AlphaColour a #

Creates an opaque AlphaColour from a Colour.

alphaColourConvert :: (Fractional b, Real a) => AlphaColour a -> AlphaColour b #

Change the type used to represent the colour coordinates.

transparent :: Num a => AlphaColour a #

This AlphaColour is entirely transparent and has no associated colour channel.

black :: Num a => Colour a #

colourConvert :: (Fractional b, Real a) => Colour a -> Colour b #

Change the type used to represent the colour coordinates.

data Colour a #

This type represents the human preception of colour. The a parameter is a numeric type used internally for the representation.

The Monoid instance allows one to add colours, but beware that adding colours can take you out of gamut. Consider using blend whenever possible.

Instances
AffineSpace Colour 
Instance details

Defined in Data.Colour.Internal

Methods

affineCombo :: Num a => [(a, Colour a)] -> Colour a -> Colour a #

ColourOps Colour 
Instance details

Defined in Data.Colour.Internal

Methods

over :: Num a => AlphaColour a -> Colour a -> Colour a #

darken :: Num a => a -> Colour a -> Colour a #

Eq a => Eq (Colour a) 
Instance details

Defined in Data.Colour.Internal

Methods

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

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

Num a => Semigroup (Colour a) 
Instance details

Defined in Data.Colour.Internal

Methods

(<>) :: Colour a -> Colour a -> Colour a #

sconcat :: NonEmpty (Colour a) -> Colour a #

stimes :: Integral b => b -> Colour a -> Colour a #

Num a => Monoid (Colour a) 
Instance details

Defined in Data.Colour.Internal

Methods

mempty :: Colour a #

mappend :: Colour a -> Colour a -> Colour a #

mconcat :: [Colour a] -> Colour a #

a ~ Double => Color (Colour a) 
Instance details

Defined in Diagrams.Attributes

(Ord a, Floating a) => FromColor (Colour a) 
Instance details

Defined in Skylighting.Types

Methods

fromColor :: Color -> Colour a #

(RealFrac a, Floating a) => ToColor (Colour a) 
Instance details

Defined in Skylighting.Types

Methods

toColor :: Colour a -> Maybe Color #

data AlphaColour a #

This type represents a Colour that may be semi-transparent.

The Monoid instance allows you to composite colours.

x `mappend` y == x `over` y

To get the (pre-multiplied) colour channel of an AlphaColour c, simply composite c over black.

c `over` black
Instances
AffineSpace AlphaColour 
Instance details

Defined in Data.Colour.Internal

Methods

affineCombo :: Num a => [(a, AlphaColour a)] -> AlphaColour a -> AlphaColour a #

ColourOps AlphaColour 
Instance details

Defined in Data.Colour.Internal

Methods

over :: Num a => AlphaColour a -> AlphaColour a -> AlphaColour a #

darken :: Num a => a -> AlphaColour a -> AlphaColour a #

Eq a => Eq (AlphaColour a) 
Instance details

Defined in Data.Colour.Internal

Num a => Semigroup (AlphaColour a)

AlphaColour forms a monoid with over and transparent.

Instance details

Defined in Data.Colour.Internal

Num a => Monoid (AlphaColour a) 
Instance details

Defined in Data.Colour.Internal

a ~ Double => Color (AlphaColour a) 
Instance details

Defined in Diagrams.Attributes

class ColourOps (f :: Type -> Type) where #

Minimal complete definition

over, darken

Methods

darken :: Num a => a -> f a -> f a #

darken s c blends a colour with black without changing it's opacity.

For Colour, darken s c = blend s c mempty

Instances
ColourOps Colour 
Instance details

Defined in Data.Colour.Internal

Methods

over :: Num a => AlphaColour a -> Colour a -> Colour a #

darken :: Num a => a -> Colour a -> Colour a #

ColourOps AlphaColour 
Instance details

Defined in Data.Colour.Internal

Methods

over :: Num a => AlphaColour a -> AlphaColour a -> AlphaColour a #

darken :: Num a => a -> AlphaColour a -> AlphaColour a #

class Default a where #

A class for types with a default value.

Minimal complete definition

Nothing

Methods

def :: a #

The default value for this type.

Instances
Default Double 
Instance details

Defined in Data.Default.Class

Methods

def :: Double #

Default Float 
Instance details

Defined in Data.Default.Class

Methods

def :: Float #

Default Int 
Instance details

Defined in Data.Default.Class

Methods

def :: Int #

Default Int8 
Instance details

Defined in Data.Default.Class

Methods

def :: Int8 #

Default Int16 
Instance details

Defined in Data.Default.Class

Methods

def :: Int16 #

Default Int32 
Instance details

Defined in Data.Default.Class

Methods

def :: Int32 #

Default Int64 
Instance details

Defined in Data.Default.Class

Methods

def :: Int64 #

Default Integer 
Instance details

Defined in Data.Default.Class

Methods

def :: Integer #

Default Ordering 
Instance details

Defined in Data.Default.Class

Methods

def :: Ordering #

Default Word 
Instance details

Defined in Data.Default.Class

Methods

def :: Word #

Default Word8 
Instance details

Defined in Data.Default.Class

Methods

def :: Word8 #

Default Word16 
Instance details

Defined in Data.Default.Class

Methods

def :: Word16 #

Default Word32 
Instance details

Defined in Data.Default.Class

Methods

def :: Word32 #

Default Word64 
Instance details

Defined in Data.Default.Class

Methods

def :: Word64 #

Default () 
Instance details

Defined in Data.Default.Class

Methods

def :: () #

Default All 
Instance details

Defined in Data.Default.Class

Methods

def :: All #

Default Any 
Instance details

Defined in Data.Default.Class

Methods

def :: Any #

Default CShort 
Instance details

Defined in Data.Default.Class

Methods

def :: CShort #

Default CUShort 
Instance details

Defined in Data.Default.Class

Methods

def :: CUShort #

Default CInt 
Instance details

Defined in Data.Default.Class

Methods

def :: CInt #

Default CUInt 
Instance details

Defined in Data.Default.Class

Methods

def :: CUInt #

Default CLong 
Instance details

Defined in Data.Default.Class

Methods

def :: CLong #

Default CULong 
Instance details

Defined in Data.Default.Class

Methods

def :: CULong #

Default CLLong 
Instance details

Defined in Data.Default.Class

Methods

def :: CLLong #

Default CULLong 
Instance details

Defined in Data.Default.Class

Methods

def :: CULLong #

Default CFloat 
Instance details

Defined in Data.Default.Class

Methods

def :: CFloat #

Default CDouble 
Instance details

Defined in Data.Default.Class

Methods

def :: CDouble #

Default CPtrdiff 
Instance details

Defined in Data.Default.Class

Methods

def :: CPtrdiff #

Default CSize 
Instance details

Defined in Data.Default.Class

Methods

def :: CSize #

Default CSigAtomic 
Instance details

Defined in Data.Default.Class

Methods

def :: CSigAtomic #

Default CClock 
Instance details

Defined in Data.Default.Class

Methods

def :: CClock #

Default CTime 
Instance details

Defined in Data.Default.Class

Methods

def :: CTime #

Default CUSeconds 
Instance details

Defined in Data.Default.Class

Methods

def :: CUSeconds #

Default CSUSeconds 
Instance details

Defined in Data.Default.Class

Methods

def :: CSUSeconds #

Default CIntPtr 
Instance details

Defined in Data.Default.Class

Methods

def :: CIntPtr #

Default CUIntPtr 
Instance details

Defined in Data.Default.Class

Methods

def :: CUIntPtr #

Default CIntMax 
Instance details

Defined in Data.Default.Class

Methods

def :: CIntMax #

Default CUIntMax 
Instance details

Defined in Data.Default.Class

Methods

def :: CUIntMax #

Default FontSlant 
Instance details

Defined in Diagrams.TwoD.Text

Methods

def :: FontSlant #

Default FontWeight 
Instance details

Defined in Diagrams.TwoD.Text

Methods

def :: FontWeight #

Default FillRule 
Instance details

Defined in Diagrams.TwoD.Path

Methods

def :: FillRule #

Default AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Methods

def :: AdjustSide #

Default LineCap 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineCap #

Default LineJoin 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineJoin #

Default LineMiterLimit 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineMiterLimit #

Default CommonState 
Instance details

Defined in Text.Pandoc.Class

Methods

def :: CommonState #

Default PureState 
Instance details

Defined in Text.Pandoc.Class

Methods

def :: PureState #

Default ReaderOptions 
Instance details

Defined in Text.Pandoc.Options

Methods

def :: ReaderOptions #

Default WriterOptions 
Instance details

Defined in Text.Pandoc.Options

Methods

def :: WriterOptions #

Default DEnv 
Instance details

Defined in Text.Pandoc.Readers.Docx

Methods

def :: DEnv #

Default DState 
Instance details

Defined in Text.Pandoc.Readers.Docx

Methods

def :: DState #

Default HTMLLocal 
Instance details

Defined in Text.Pandoc.Readers.HTML

Methods

def :: HTMLLocal #

Default WriterEnv 
Instance details

Defined in Text.Pandoc.Writers.Markdown

Methods

def :: WriterEnv #

Default WriterState 
Instance details

Defined in Text.Pandoc.Writers.Markdown

Methods

def :: WriterState #

Default [a] 
Instance details

Defined in Data.Default.Class

Methods

def :: [a] #

Default (Maybe a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Maybe a #

Integral a => Default (Ratio a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Ratio a #

Default a => Default (IO a) 
Instance details

Defined in Data.Default.Class

Methods

def :: IO a #

(Default a, RealFloat a) => Default (Complex a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Complex a #

Default (First a) 
Instance details

Defined in Data.Default.Class

Methods

def :: First a #

Default (Last a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Last a #

Default a => Default (Dual a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Dual a #

Default (Endo a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Endo a #

Num a => Default (Sum a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Sum a #

Num a => Default (Product a) 
Instance details

Defined in Data.Default.Class

Methods

def :: Product a #

Floating n => Default (TraceOpts n) 
Instance details

Defined in Diagrams.TwoD.Model

Methods

def :: TraceOpts n #

OrderedField n => Default (EnvelopeOpts n) 
Instance details

Defined in Diagrams.TwoD.Model

Methods

def :: EnvelopeOpts n #

Fractional n => Default (OriginOpts n) 
Instance details

Defined in Diagrams.TwoD.Model

Methods

def :: OriginOpts n #

TypeableFloat n => Default (ArrowOpts n) 
Instance details

Defined in Diagrams.TwoD.Arrow

Methods

def :: ArrowOpts n #

Default (LineTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Methods

def :: LineTexture n #

Default (FillTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Methods

def :: FillTexture n #

Default (StrokeOpts a) 
Instance details

Defined in Diagrams.TwoD.Path

Methods

def :: StrokeOpts a #

Num d => Default (RoundedRectOpts d) 
Instance details

Defined in Diagrams.TwoD.Shapes

Methods

def :: RoundedRectOpts d #

Num n => Default (PolygonOpts n)

The default polygon is a regular pentagon of radius 1, centered at the origin, aligned to the x-axis.

Instance details

Defined in Diagrams.TwoD.Polygons

Methods

def :: PolygonOpts n #

Num n => Default (CatOpts n) 
Instance details

Defined in Diagrams.Combinators

Methods

def :: CatOpts n #

Fractional n => Default (AdjustMethod n) 
Instance details

Defined in Diagrams.Parametric.Adjust

Methods

def :: AdjustMethod n #

Fractional n => Default (AdjustOpts n) 
Instance details

Defined in Diagrams.Parametric.Adjust

Methods

def :: AdjustOpts n #

Num n => Default (FontSizeM n) 
Instance details

Defined in Diagrams.TwoD.Text

Methods

def :: FontSizeM n #

OrderedField n => Default (LineWidthM n) 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineWidthM n #

Default r => Default (e -> r) 
Instance details

Defined in Data.Default.Class

Methods

def :: e -> r #

(Default a, Default b) => Default (a, b) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b) #

(Default a, Default b, Default c) => Default (a, b, c) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c) #

(Default a, Default b, Default c, Default d) => Default (a, b, c, d) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d) #

(Default a, Default b, Default c, Default d, Default e) => Default (a, b, c, d, e) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d, e) #

(Default a, Default b, Default c, Default d, Default e, Default f) => Default (a, b, c, d, e, f) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d, e, f) #

(Default a, Default b, Default c, Default d, Default e, Default f, Default g) => Default (a, b, c, d, e, f, g) 
Instance details

Defined in Data.Default.Class

Methods

def :: (a, b, c, d, e, f, g) #

class Functor f => Additive (f :: Type -> Type) where #

A vector is an additive group with additional structure.

Minimal complete definition

Nothing

Methods

zero :: Num a => f a #

The zero vector

(^+^) :: Num a => f a -> f a -> f a infixl 6 #

Compute the sum of two vectors

>>> V2 1 2 ^+^ V2 3 4
V2 4 6

(^-^) :: Num a => f a -> f a -> f a infixl 6 #

Compute the difference between two vectors

>>> V2 4 5 ^-^ V2 3 1
V2 1 4

lerp :: Num a => a -> f a -> f a -> f a #

Linearly interpolate between two vectors.

liftU2 :: (a -> a -> a) -> f a -> f a -> f a #

Apply a function to merge the 'non-zero' components of two vectors, unioning the rest of the values.

  • For a dense vector this is equivalent to liftA2.
  • For a sparse vector this is equivalent to unionWith.

liftI2 :: (a -> b -> c) -> f a -> f b -> f c #

Apply a function to the components of two vectors.

Instances
Additive [] 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => [a] #

(^+^) :: Num a => [a] -> [a] -> [a] #

(^-^) :: Num a => [a] -> [a] -> [a] #

lerp :: Num a => a -> [a] -> [a] -> [a] #

liftU2 :: (a -> a -> a) -> [a] -> [a] -> [a] #

liftI2 :: (a -> b -> c) -> [a] -> [b] -> [c] #

Additive Maybe 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => Maybe a #

(^+^) :: Num a => Maybe a -> Maybe a -> Maybe a #

(^-^) :: Num a => Maybe a -> Maybe a -> Maybe a #

lerp :: Num a => a -> Maybe a -> Maybe a -> Maybe a #

liftU2 :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a #

liftI2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #

Additive Identity 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => Identity a #

(^+^) :: Num a => Identity a -> Identity a -> Identity a #

(^-^) :: Num a => Identity a -> Identity a -> Identity a #

lerp :: Num a => a -> Identity a -> Identity a -> Identity a #

liftU2 :: (a -> a -> a) -> Identity a -> Identity a -> Identity a #

liftI2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

Additive ZipList 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => ZipList a #

(^+^) :: Num a => ZipList a -> ZipList a -> ZipList a #

(^-^) :: Num a => ZipList a -> ZipList a -> ZipList a #

lerp :: Num a => a -> ZipList a -> ZipList a -> ZipList a #

liftU2 :: (a -> a -> a) -> ZipList a -> ZipList a -> ZipList a #

liftI2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c #

Additive Duration 
Instance details

Defined in Data.Active

Methods

zero :: Num a => Duration a #

(^+^) :: Num a => Duration a -> Duration a -> Duration a #

(^-^) :: Num a => Duration a -> Duration a -> Duration a #

lerp :: Num a => a -> Duration a -> Duration a -> Duration a #

liftU2 :: (a -> a -> a) -> Duration a -> Duration a -> Duration a #

liftI2 :: (a -> b -> c) -> Duration a -> Duration b -> Duration c #

Additive Complex 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => Complex a #

(^+^) :: Num a => Complex a -> Complex a -> Complex a #

(^-^) :: Num a => Complex a -> Complex a -> Complex a #

lerp :: Num a => a -> Complex a -> Complex a -> Complex a #

liftU2 :: (a -> a -> a) -> Complex a -> Complex a -> Complex a #

liftI2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c #

Additive Vector 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => Vector a #

(^+^) :: Num a => Vector a -> Vector a -> Vector a #

(^-^) :: Num a => Vector a -> Vector a -> Vector a #

lerp :: Num a => a -> Vector a -> Vector a -> Vector a #

liftU2 :: (a -> a -> a) -> Vector a -> Vector a -> Vector a #

liftI2 :: (a -> b -> c) -> Vector a -> Vector b -> Vector c #

Additive IntMap 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => IntMap a #

(^+^) :: Num a => IntMap a -> IntMap a -> IntMap a #

(^-^) :: Num a => IntMap a -> IntMap a -> IntMap a #

lerp :: Num a => a -> IntMap a -> IntMap a -> IntMap a #

liftU2 :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #

liftI2 :: (a -> b -> c) -> IntMap a -> IntMap b -> IntMap c #

Additive Angle 
Instance details

Defined in Diagrams.Angle

Methods

zero :: Num a => Angle a #

(^+^) :: Num a => Angle a -> Angle a -> Angle a #

(^-^) :: Num a => Angle a -> Angle a -> Angle a #

lerp :: Num a => a -> Angle a -> Angle a -> Angle a #

liftU2 :: (a -> a -> a) -> Angle a -> Angle a -> Angle a #

liftI2 :: (a -> b -> c) -> Angle a -> Angle b -> Angle c #

Additive V2 
Instance details

Defined in Linear.V2

Methods

zero :: Num a => V2 a #

(^+^) :: Num a => V2 a -> V2 a -> V2 a #

(^-^) :: Num a => V2 a -> V2 a -> V2 a #

lerp :: Num a => a -> V2 a -> V2 a -> V2 a #

liftU2 :: (a -> a -> a) -> V2 a -> V2 a -> V2 a #

liftI2 :: (a -> b -> c) -> V2 a -> V2 b -> V2 c #

Additive V3 
Instance details

Defined in Linear.V3

Methods

zero :: Num a => V3 a #

(^+^) :: Num a => V3 a -> V3 a -> V3 a #

(^-^) :: Num a => V3 a -> V3 a -> V3 a #

lerp :: Num a => a -> V3 a -> V3 a -> V3 a #

liftU2 :: (a -> a -> a) -> V3 a -> V3 a -> V3 a #

liftI2 :: (a -> b -> c) -> V3 a -> V3 b -> V3 c #

Additive Plucker 
Instance details

Defined in Linear.Plucker

Methods

zero :: Num a => Plucker a #

(^+^) :: Num a => Plucker a -> Plucker a -> Plucker a #

(^-^) :: Num a => Plucker a -> Plucker a -> Plucker a #

lerp :: Num a => a -> Plucker a -> Plucker a -> Plucker a #

liftU2 :: (a -> a -> a) -> Plucker a -> Plucker a -> Plucker a #

liftI2 :: (a -> b -> c) -> Plucker a -> Plucker b -> Plucker c #

Additive Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

zero :: Num a => Quaternion a #

(^+^) :: Num a => Quaternion a -> Quaternion a -> Quaternion a #

(^-^) :: Num a => Quaternion a -> Quaternion a -> Quaternion a #

lerp :: Num a => a -> Quaternion a -> Quaternion a -> Quaternion a #

liftU2 :: (a -> a -> a) -> Quaternion a -> Quaternion a -> Quaternion a #

liftI2 :: (a -> b -> c) -> Quaternion a -> Quaternion b -> Quaternion c #

Additive V0 
Instance details

Defined in Linear.V0

Methods

zero :: Num a => V0 a #

(^+^) :: Num a => V0 a -> V0 a -> V0 a #

(^-^) :: Num a => V0 a -> V0 a -> V0 a #

lerp :: Num a => a -> V0 a -> V0 a -> V0 a #

liftU2 :: (a -> a -> a) -> V0 a -> V0 a -> V0 a #

liftI2 :: (a -> b -> c) -> V0 a -> V0 b -> V0 c #

Additive V4 
Instance details

Defined in Linear.V4

Methods

zero :: Num a => V4 a #

(^+^) :: Num a => V4 a -> V4 a -> V4 a #

(^-^) :: Num a => V4 a -> V4 a -> V4 a #

lerp :: Num a => a -> V4 a -> V4 a -> V4 a #

liftU2 :: (a -> a -> a) -> V4 a -> V4 a -> V4 a #

liftI2 :: (a -> b -> c) -> V4 a -> V4 b -> V4 c #

Additive V1 
Instance details

Defined in Linear.V1

Methods

zero :: Num a => V1 a #

(^+^) :: Num a => V1 a -> V1 a -> V1 a #

(^-^) :: Num a => V1 a -> V1 a -> V1 a #

lerp :: Num a => a -> V1 a -> V1 a -> V1 a #

liftU2 :: (a -> a -> a) -> V1 a -> V1 a -> V1 a #

liftI2 :: (a -> b -> c) -> V1 a -> V1 b -> V1 c #

Ord k => Additive (Map k) 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => Map k a #

(^+^) :: Num a => Map k a -> Map k a -> Map k a #

(^-^) :: Num a => Map k a -> Map k a -> Map k a #

lerp :: Num a => a -> Map k a -> Map k a -> Map k a #

liftU2 :: (a -> a -> a) -> Map k a -> Map k a -> Map k a #

liftI2 :: (a -> b -> c) -> Map k a -> Map k b -> Map k c #

(Eq k, Hashable k) => Additive (HashMap k) 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => HashMap k a #

(^+^) :: Num a => HashMap k a -> HashMap k a -> HashMap k a #

(^-^) :: Num a => HashMap k a -> HashMap k a -> HashMap k a #

lerp :: Num a => a -> HashMap k a -> HashMap k a -> HashMap k a #

liftU2 :: (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #

liftI2 :: (a -> b -> c) -> HashMap k a -> HashMap k b -> HashMap k c #

Additive (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

zero :: Num a => Measured n a #

(^+^) :: Num a => Measured n a -> Measured n a -> Measured n a #

(^-^) :: Num a => Measured n a -> Measured n a -> Measured n a #

lerp :: Num a => a -> Measured n a -> Measured n a -> Measured n a #

liftU2 :: (a -> a -> a) -> Measured n a -> Measured n a -> Measured n a #

liftI2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c #

Additive f => Additive (Point f) 
Instance details

Defined in Linear.Affine

Methods

zero :: Num a => Point f a #

(^+^) :: Num a => Point f a -> Point f a -> Point f a #

(^-^) :: Num a => Point f a -> Point f a -> Point f a #

lerp :: Num a => a -> Point f a -> Point f a -> Point f a #

liftU2 :: (a -> a -> a) -> Point f a -> Point f a -> Point f a #

liftI2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c #

Dim n => Additive (V n) 
Instance details

Defined in Linear.V

Methods

zero :: Num a => V n a #

(^+^) :: Num a => V n a -> V n a -> V n a #

(^-^) :: Num a => V n a -> V n a -> V n a #

lerp :: Num a => a -> V n a -> V n a -> V n a #

liftU2 :: (a -> a -> a) -> V n a -> V n a -> V n a #

liftI2 :: (a -> b -> c) -> V n a -> V n b -> V n c #

Additive ((->) b :: Type -> Type) 
Instance details

Defined in Linear.Vector

Methods

zero :: Num a => b -> a #

(^+^) :: Num a => (b -> a) -> (b -> a) -> b -> a #

(^-^) :: Num a => (b -> a) -> (b -> a) -> b -> a #

lerp :: Num a => a -> (b -> a) -> (b -> a) -> b -> a #

liftU2 :: (a -> a -> a) -> (b -> a) -> (b -> a) -> b -> a #

liftI2 :: (a -> b0 -> c) -> (b -> a) -> (b -> b0) -> b -> c #

renderDia :: (Backend b v n, HasLinearMap v, Metric v, Typeable n, OrderedField n, Monoid' m) => b -> Options b v n -> QDiagram b v n m -> Result b v n #

Render a diagram.

renderDiaT :: (Backend b v n, HasLinearMap v, Metric v, Typeable n, OrderedField n, Monoid' m) => b -> Options b v n -> QDiagram b v n m -> (Transformation v n, Result b v n) #

Render a diagram, returning also the transformation which was used to convert the diagram from its ("global") coordinate system into the output coordinate system. The inverse of this transformation can be used, for example, to convert output/screen coordinates back into diagram coordinates. See also adjustDia.

lookupSub :: IsName nm => nm -> SubMap b v n m -> Maybe [Subdiagram b v n m] #

Look for the given name in a name map, returning a list of subdiagrams associated with that name. If no names match the given name exactly, return all the subdiagrams associated with names of which the given name is a suffix.

rememberAs :: IsName a => a -> QDiagram b v n m -> SubMap b v n m -> SubMap b v n m #

Add a name/diagram association to a submap.

fromNames :: IsName a => [(a, Subdiagram b v n m)] -> SubMap b v n m #

Construct a SubMap from a list of associations between names and subdiagrams.

rawSub :: Subdiagram b v n m -> QDiagram b v n m #

Extract the "raw" content of a subdiagram, by throwing away the context.

getSub :: (Metric v, OrderedField n, Semigroup m) => Subdiagram b v n m -> QDiagram b v n m #

Turn a subdiagram into a normal diagram, including the enclosing context. Concretely, a subdiagram is a pair of (1) a diagram and (2) a "context" consisting of an extra transformation and attributes. getSub simply applies the transformation and attributes to the diagram to get the corresponding "top-level" diagram.

location :: (Additive v, Num n) => Subdiagram b v n m -> Point v n #

Get the location of a subdiagram; that is, the location of its local origin with respect to the vector space of its parent diagram. In other words, the point where its local origin "ended up".

subPoint :: (Metric v, OrderedField n) => Point v n -> Subdiagram b v n m #

Create a "point subdiagram", that is, a pointDiagram (with no content and a point envelope) treated as a subdiagram with local origin at the given point. Note this is not the same as mkSubdiagram . pointDiagram, which would result in a subdiagram with local origin at the parent origin, rather than at the given point.

mkSubdiagram :: QDiagram b v n m -> Subdiagram b v n m #

Turn a diagram into a subdiagram with no accumulated context.

atop :: (OrderedField n, Metric v, Semigroup m) => QDiagram b v n m -> QDiagram b v n m -> QDiagram b v n m infixl 6 #

A convenient synonym for mappend on diagrams, designed to be used infix (to help remember which diagram goes on top of which when combining them, namely, the first on top of the second).

mkQD :: Prim b v n -> Envelope v n -> Trace v n -> SubMap b v n m -> Query v n m -> QDiagram b v n m #

Create a diagram from a single primitive, along with an envelope, trace, subdiagram map, and query function.

query :: Monoid m => QDiagram b v n m -> Query v n m #

Get the query function associated with a diagram.

localize :: (Metric v, OrderedField n, Semigroup m) => QDiagram b v n m -> QDiagram b v n m #

"Localize" a diagram by hiding all the names, so they are no longer visible to the outside.

withNames :: (IsName nm, Metric v, Semigroup m, OrderedField n) => [nm] -> ([Subdiagram b v n m] -> QDiagram b v n m -> QDiagram b v n m) -> QDiagram b v n m -> QDiagram b v n m #

Given a list of names and a diagram transformation indexed by a list of subdiagrams, perform the transformation using the list of most recent subdiagrams associated with (some qualification of) each name. Do nothing (the identity transformation) if any of the names do not exist.

withNameAll :: (IsName nm, Metric v, Semigroup m, OrderedField n) => nm -> ([Subdiagram b v n m] -> QDiagram b v n m -> QDiagram b v n m) -> QDiagram b v n m -> QDiagram b v n m #

Given a name and a diagram transformation indexed by a list of subdiagrams, perform the transformation using the collection of all such subdiagrams associated with (some qualification of) the given name.

withName :: (IsName nm, Metric v, Semigroup m, OrderedField n) => nm -> (Subdiagram b v n m -> QDiagram b v n m -> QDiagram b v n m) -> QDiagram b v n m -> QDiagram b v n m #

Given a name and a diagram transformation indexed by a subdiagram, perform the transformation using the most recent subdiagram associated with (some qualification of) the name, or perform the identity transformation if the name does not exist.

lookupName :: (IsName nm, Metric v, Semigroup m, OrderedField n) => nm -> QDiagram b v n m -> Maybe (Subdiagram b v n m) #

Lookup the most recent diagram associated with (some qualification of) the given name.

nameSub :: (IsName nm, Metric v, OrderedField n, Semigroup m) => (QDiagram b v n m -> Subdiagram b v n m) -> nm -> QDiagram b v n m -> QDiagram b v n m #

Attach an atomic name to a certain subdiagram, computed from the given diagram /with the mapping from name to subdiagram included/. The upshot of this knot-tying is that if d' = d # named x, then lookupName x d' == Just d' (instead of Just d).

names :: (Metric v, Semigroup m, OrderedField n) => QDiagram b v n m -> [(Name, [Point v n])] #

Get a list of names of subdiagrams and their locations.

subMap :: (Metric v, Semigroup m, OrderedField n) => Lens' (QDiagram b v n m) (SubMap b v n m) #

Lens onto the SubMap of a QDiagram (i.e. an association from names to subdiagrams).

setTrace :: (OrderedField n, Metric v, Semigroup m) => Trace v n -> QDiagram b v n m -> QDiagram b v n m #

Replace the trace of a diagram.

setEnvelope :: (OrderedField n, Metric v, Monoid' m) => Envelope v n -> QDiagram b v n m -> QDiagram b v n m #

Replace the envelope of a diagram.

envelope :: (OrderedField n, Metric v, Monoid' m) => Lens' (QDiagram b v n m) (Envelope v n) #

Lens onto the Envelope of a QDiagram.

pointDiagram :: (Metric v, Fractional n) => Point v n -> QDiagram b v n m #

Create a "point diagram", which has no content, no trace, an empty query, and a point envelope.

groupOpacity :: (Metric v, OrderedField n, Semigroup m) => Double -> QDiagram b v n m -> QDiagram b v n m #

Change the transparency of a Diagram as a group.

opacityGroup :: (Metric v, OrderedField n, Semigroup m) => Double -> QDiagram b v n m -> QDiagram b v n m #

Change the transparency of a Diagram as a group.

href :: (Metric v, OrderedField n, Semigroup m) => String -> QDiagram b v n m -> QDiagram b v n m #

Make a diagram into a hyperlink. Note that only some backends will honor hyperlink annotations.

type TypeableFloat n = (Typeable n, RealFloat n) #

Constraint for numeric types that are RealFloat and Typeable, which often occur together. This is used to shorten shorten type constraint contexts.

data QDiagram b (v :: Type -> Type) n m #

The fundamental diagram type. The type variables are as follows:

  • b represents the backend, such as SVG or Cairo. Note that each backend also exports a type synonym B for itself, so the type variable b may also typically be instantiated by B, meaning "use whatever backend is in scope".
  • v represents the vector space of the diagram. Typical instantiations include V2 (for a two-dimensional diagram) or V3 (for a three-dimensional diagram).
  • n represents the numerical field the diagram uses. Typically this will be a concrete numeric type like Double.
  • m is the monoidal type of "query annotations": each point in the diagram has a value of type m associated to it, and these values are combined according to the Monoid instance for m. Most often, m is simply instantiated to Any, associating a simple Bool value to each point indicating whether the point is inside the diagram; Diagram is a synonym for QDiagram with m thus instantiated to Any.

Diagrams can be combined via their Monoid instance, transformed via their Transformable instance, and assigned attributes via their HasStyle instance.

Note that the Q in QDiagram stands for "Queriable", as distinguished from Diagram, where m is fixed to Any. This is not really a very good name, but it's probably not worth changing it at this point.

Instances
Functor (QDiagram b v n) 
Instance details

Defined in Diagrams.Core.Types

Methods

fmap :: (a -> b0) -> QDiagram b v n a -> QDiagram b v n b0 #

(<$) :: a -> QDiagram b v n b0 -> QDiagram b v n a #

(Metric v, OrderedField n, Semigroup m) => Semigroup (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

(<>) :: QDiagram b v n m -> QDiagram b v n m -> QDiagram b v n m #

sconcat :: NonEmpty (QDiagram b v n m) -> QDiagram b v n m #

stimes :: Integral b0 => b0 -> QDiagram b v n m -> QDiagram b v n m #

(Metric v, OrderedField n, Semigroup m) => Monoid (QDiagram b v n m)

Diagrams form a monoid since each of their components do: the empty diagram has no primitives, an empty envelope, an empty trace, no named subdiagrams, and a constantly empty query function.

Diagrams compose by aligning their respective local origins. The new diagram has all the primitives and all the names from the two diagrams combined, and query functions are combined pointwise. The first diagram goes on top of the second. "On top of" probably only makes sense in vector spaces of dimension lower than 3, but in theory it could make sense for, say, 3-dimensional diagrams when viewed by 4-dimensional beings.

Instance details

Defined in Diagrams.Core.Types

Methods

mempty :: QDiagram b v n m #

mappend :: QDiagram b v n m -> QDiagram b v n m -> QDiagram b v n m #

mconcat :: [QDiagram b v n m] -> QDiagram b v n m #

(Metric v, OrderedField n, Monoid' m) => Juxtaposable (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

juxtapose :: Vn (QDiagram b v n m) -> QDiagram b v n m -> QDiagram b v n m -> QDiagram b v n m #

(Metric v, OrderedField n, Monoid' m) => Enveloped (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getEnvelope :: QDiagram b v n m -> Envelope (V (QDiagram b v n m)) (N (QDiagram b v n m)) #

(Metric v, OrderedField n, Semigroup m) => Traced (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getTrace :: QDiagram b v n m -> Trace (V (QDiagram b v n m)) (N (QDiagram b v n m)) #

(Metric v, OrderedField n, Semigroup m) => Qualifiable (QDiagram b v n m)

Diagrams can be qualified so that all their named points can now be referred to using the qualification prefix.

Instance details

Defined in Diagrams.Core.Types

Methods

(.>>) :: IsName a => a -> QDiagram b v n m -> QDiagram b v n m #

(Metric v, OrderedField n, Semigroup m) => HasStyle (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

applyStyle :: Style (V (QDiagram b v n m)) (N (QDiagram b v n m)) -> QDiagram b v n m -> QDiagram b v n m #

(OrderedField n, Metric v, Semigroup m) => Transformable (QDiagram b v n m)

Diagrams can be transformed by transforming each of their components appropriately.

Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (QDiagram b v n m)) (N (QDiagram b v n m)) -> QDiagram b v n m -> QDiagram b v n m #

(Metric v, OrderedField n, Semigroup m) => HasOrigin (QDiagram b v n m)

Every diagram has an intrinsic "local origin" which is the basis for all combining operations.

Instance details

Defined in Diagrams.Core.Types

Methods

moveOriginTo :: Point (V (QDiagram b v n m)) (N (QDiagram b v n m)) -> QDiagram b v n m -> QDiagram b v n m #

(Metric v, OrderedField n, Monoid' m) => Alignable (QDiagram b v n m) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v0 n0 (QDiagram b v n m), Fractional n0, HasOrigin (QDiagram b v n m)) => (v0 n0 -> QDiagram b v n m -> Point v0 n0) -> v0 n0 -> n0 -> QDiagram b v n m -> QDiagram b v n m #

defaultBoundary :: (V (QDiagram b v n m) ~ v0, N (QDiagram b v n m) ~ n0) => v0 n0 -> QDiagram b v n m -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (QDiagram b v n m), Fractional n0, HasOrigin (QDiagram b v n m)) => v0 n0 -> n0 -> QDiagram b v n m -> QDiagram b v n m #

Wrapped (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Associated Types

type Unwrapped (QDiagram b v n m) :: Type #

Methods

_Wrapped' :: Iso' (QDiagram b v n m) (Unwrapped (QDiagram b v n m)) #

Monoid m => HasQuery (QDiagram b v n m) m 
Instance details

Defined in Diagrams.Query

Methods

getQuery :: QDiagram b v n m -> Query (V (QDiagram b v n m)) (N (QDiagram b v n m)) m #

Rewrapped (QDiagram b v n m) (QDiagram b' v' n' m') 
Instance details

Defined in Diagrams.Core.Types

type V (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type V (QDiagram b v n m) = v
type N (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type N (QDiagram b v n m) = n
type Unwrapped (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type Unwrapped (QDiagram b v n m) = DUALTree (DownAnnots v n) (UpAnnots b v n m) Annotation (QDiaLeaf b v n m)

type Diagram b = QDiagram b (V b) (N b) Any #

Diagram b is a synonym for QDiagram b (V b) (N b) Any. That is, the default sort of diagram is one where querying at a point simply tells you whether the diagram contains that point or not. Transforming a default diagram into one with a more interesting query can be done via the Functor instance of QDiagram b v n or the value function.

data Subdiagram b (v :: Type -> Type) n m #

A Subdiagram represents a diagram embedded within the context of a larger diagram. Essentially, it consists of a diagram paired with any accumulated information from the larger context (transformations, attributes, etc.).

Constructors

Subdiagram (QDiagram b v n m) (DownAnnots v n) 
Instances
Functor (Subdiagram b v n) 
Instance details

Defined in Diagrams.Core.Types

Methods

fmap :: (a -> b0) -> Subdiagram b v n a -> Subdiagram b v n b0 #

(<$) :: a -> Subdiagram b v n b0 -> Subdiagram b v n a #

(OrderedField n, Metric v, Monoid' m) => Enveloped (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getEnvelope :: Subdiagram b v n m -> Envelope (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) #

(OrderedField n, Metric v, Semigroup m) => Traced (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getTrace :: Subdiagram b v n m -> Trace (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) #

Transformable (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) -> Subdiagram b v n m -> Subdiagram b v n m #

(Metric v, OrderedField n) => HasOrigin (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

moveOriginTo :: Point (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) -> Subdiagram b v n m -> Subdiagram b v n m #

type V (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type V (Subdiagram b v n m) = v
type N (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type N (Subdiagram b v n m) = n

newtype SubMap b (v :: Type -> Type) n m #

A SubMap is a map associating names to subdiagrams. There can be multiple associations for any given name.

Constructors

SubMap (Map Name [Subdiagram b v n m]) 
Instances
Action Name (SubMap b v n m)

A name acts on a name map by qualifying every name in it.

Instance details

Defined in Diagrams.Core.Types

Methods

act :: Name -> SubMap b v n m -> SubMap b v n m #

Functor (SubMap b v n) 
Instance details

Defined in Diagrams.Core.Types

Methods

fmap :: (a -> b0) -> SubMap b v n a -> SubMap b v n b0 #

(<$) :: a -> SubMap b v n b0 -> SubMap b v n a #

Semigroup (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

(<>) :: SubMap b v n m -> SubMap b v n m -> SubMap b v n m #

sconcat :: NonEmpty (SubMap b v n m) -> SubMap b v n m #

stimes :: Integral b0 => b0 -> SubMap b v n m -> SubMap b v n m #

Monoid (SubMap b v n m)

SubMaps form a monoid with the empty map as the identity, and map union as the binary operation. No information is ever lost: if two maps have the same name in their domain, the resulting map will associate that name to the concatenation of the information associated with that name.

Instance details

Defined in Diagrams.Core.Types

Methods

mempty :: SubMap b v n m #

mappend :: SubMap b v n m -> SubMap b v n m -> SubMap b v n m #

mconcat :: [SubMap b v n m] -> SubMap b v n m #

Qualifiable (SubMap b v n m)

SubMaps are qualifiable: if ns is a SubMap, then a |> ns is the same SubMap except with every name qualified by a.

Instance details

Defined in Diagrams.Core.Types

Methods

(.>>) :: IsName a => a -> SubMap b v n m -> SubMap b v n m #

Transformable (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (SubMap b v n m)) (N (SubMap b v n m)) -> SubMap b v n m -> SubMap b v n m #

(OrderedField n, Metric v) => HasOrigin (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

moveOriginTo :: Point (V (SubMap b v n m)) (N (SubMap b v n m)) -> SubMap b v n m -> SubMap b v n m #

Wrapped (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Associated Types

type Unwrapped (SubMap b v n m) :: Type #

Methods

_Wrapped' :: Iso' (SubMap b v n m) (Unwrapped (SubMap b v n m)) #

Rewrapped (SubMap b v n m) (SubMap b' v' n' m') 
Instance details

Defined in Diagrams.Core.Types

type V (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

type V (SubMap b v n m) = v
type N (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

type N (SubMap b v n m) = n
type Unwrapped (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

type Unwrapped (SubMap b v n m) = Map Name [Subdiagram b v n m]

data Prim b (v :: Type -> Type) n where #

A value of type Prim b v n is an opaque (existentially quantified) primitive which backend b knows how to render in vector space v.

Constructors

Prim :: forall b (v :: Type -> Type) n p. (Transformable p, Typeable p, Renderable p b) => p -> Prim b (V p) (N p) 
Instances
Transformable (Prim b v n)

The Transformable instance for Prim just pushes calls to transform down through the Prim constructor.

Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (Prim b v n)) (N (Prim b v n)) -> Prim b v n -> Prim b v n #

Renderable (Prim b v n) b

The Renderable instance for Prim just pushes calls to render down through the Prim constructor.

Instance details

Defined in Diagrams.Core.Types

Methods

render :: b -> Prim b v n -> Render b (V (Prim b v n)) (N (Prim b v n)) #

type V (Prim b v n) 
Instance details

Defined in Diagrams.Core.Types

type V (Prim b v n) = v
type N (Prim b v n) 
Instance details

Defined in Diagrams.Core.Types

type N (Prim b v n) = n

class Backend b (v :: Type -> Type) n where #

Abstract diagrams are rendered to particular formats by backends. Each backend/vector space combination must be an instance of the Backend class.

A minimal complete definition consists of Render, Result, Options, and renderRTree. However, most backends will want to implement adjustDia as well; the default definition does nothing. Some useful standard definitions are provided in the Diagrams.TwoD.Adjust module from the diagrams-lib package.

Minimal complete definition

renderRTree

Associated Types

data Render b (v :: Type -> Type) n :: Type #

An intermediate representation used for rendering primitives. (Typically, this will be some sort of monad, but it need not be.) The Renderable class guarantees that a backend will be able to convert primitives into this type; how these rendered primitives are combined into an ultimate Result is completely up to the backend.

type Result b (v :: Type -> Type) n :: Type #

The result of running/interpreting a rendering operation.

data Options b (v :: Type -> Type) n :: Type #

Backend-specific rendering options.

Methods

adjustDia :: (Additive v, Monoid' m, Num n) => b -> Options b v n -> QDiagram b v n m -> (Options b v n, Transformation v n, QDiagram b v n m) #

adjustDia allows the backend to make adjustments to the final diagram (e.g. to adjust the size based on the options) before rendering it. It returns a modified options record, the transformation applied to the diagram (which can be used to convert attributes whose value is Measure, or transform e.g. screen coordinates back into local diagram coordinates), and the adjusted diagram itself.

See the diagrams-lib package (particularly the Diagrams.TwoD.Adjust module) for some useful implementations.

renderRTree :: b -> Options b v n -> RTree b v n Annotation -> Result b v n #

Given some options, take a representation of a diagram as a tree and render it. The RTree has already been simplified and has all measurements converted to Output units.

Instances
Backend NullBackend v n 
Instance details

Defined in Diagrams.Core.Types

Associated Types

data Render NullBackend v n :: Type #

type Result NullBackend v n :: Type #

data Options NullBackend v n :: Type #

SVGFloat n => Backend SVG V2 n 
Instance details

Defined in Diagrams.Backend.SVG

Associated Types

data Render SVG V2 n :: Type #

type Result SVG V2 n :: Type #

data Options SVG V2 n :: Type #

type D (v :: Type -> Type) n = QDiagram NullBackend v n Any #

The D type is provided for convenience in situations where you must give a diagram a concrete, monomorphic type, but don't care which one. Such situations arise when you pass a diagram to a function which is polymorphic in its input but monomorphic in its output, such as width, height, phantom, or names. Such functions compute some property of the diagram, or use it to accomplish some other purpose, but do not result in the diagram being rendered. If the diagram does not have a monomorphic type, GHC complains that it cannot determine the diagram's type.

For example, here is the error we get if we try to compute the width of an image (this example requires diagrams-lib):

  ghci> width (image (uncheckedImageRef "foo.png" 200 200))
  <interactive>:11:8:
      No instance for (Renderable (DImage n0 External) b0)
        arising from a use of image
      The type variables n0, b0 are ambiguous
      Possible fix: add a type signature that fixes these type variable(s)
      Note: there is a potential instance available:
        instance Fractional n => Renderable (DImage n a) NullBackend
          -- Defined in Image
      Possible fix:
        add an instance declaration for
        (Renderable (DImage n0 External) b0)
      In the first argument of width, namely
        `(image (uncheckedImageRef "foo.png" 200 200))'
      In the expression:
        width (image (uncheckedImageRef "foo.png" 200 200))
      In an equation for it:
          it = width (image (uncheckedImageRef "foo.png" 200 200))
  

GHC complains that there is no instance for Renderable (DImage n0 External) b0; what is really going on is that it does not have enough information to decide what backend to use (hence the uninstantiated n0 and b0). This is annoying because we know that the choice of backend cannot possibly affect the width of the image (it's 200! it's right there in the code!); but there is no way for GHC to know that.

The solution is to annotate the call to image with the type D V2 Double, like so:

  ghci> width (image (uncheckedImageRef "foo.png" 200 200) :: D V2 Double)
  200.00000000000006
  

(It turns out the width wasn't 200 after all...)

As another example, here is the error we get if we try to compute the width of a radius-1 circle:

  ghci> width (circle 1)
  <interactive>:12:1:
      Couldn't match expected type V2 with actual type `V a0'
      The type variable a0 is ambiguous
      Possible fix: add a type signature that fixes these type variable(s)
      In the expression: width (circle 1)
      In an equation for it: it = width (circle 1)
  

There's even more ambiguity here. Whereas image always returns a Diagram, the circle function can produce any TrailLike type, and the width function can consume any Enveloped type, so GHC has no idea what type to pick to go in the middle. However, the solution is the same:

  ghci> width (circle 1 :: D V2 Double)
  1.9999999999999998
  

data NullBackend #

A null backend which does no actual rendering. It is provided mainly for convenience in situations where you must give a diagram a concrete, monomorphic type, but don't actually care which one. See D for more explanation and examples.

It is courteous, when defining a new primitive P, to make an instance

instance Renderable P NullBackend where
  render _ _ = mempty

This ensures that the trick with D annotations can be used for diagrams containing your primitive.

Instances
Backend NullBackend v n 
Instance details

Defined in Diagrams.Core.Types

Associated Types

data Render NullBackend v n :: Type #

type Result NullBackend v n :: Type #

data Options NullBackend v n :: Type #

Floating n => Renderable (Text n) NullBackend 
Instance details

Defined in Diagrams.TwoD.Text

Methods

render :: NullBackend -> Text n -> Render NullBackend (V (Text n)) (N (Text n)) #

Fractional n => Renderable (Ellipsoid n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Fractional n => Renderable (Box n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

render :: NullBackend -> Box n -> Render NullBackend (V (Box n)) (N (Box n)) #

Fractional n => Renderable (Frustum n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

render :: NullBackend -> Frustum n -> Render NullBackend (V (Frustum n)) (N (Frustum n)) #

Fractional n => Renderable (DImage n a) NullBackend 
Instance details

Defined in Diagrams.TwoD.Image

Methods

render :: NullBackend -> DImage n a -> Render NullBackend (V (DImage n a)) (N (DImage n a)) #

(HasLinearMap v, Metric v, OrderedField n) => Renderable (Path v n) NullBackend 
Instance details

Defined in Diagrams.Path

Methods

render :: NullBackend -> Path v n -> Render NullBackend (V (Path v n)) (N (Path v n)) #

Num n => Renderable (Camera l n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Camera

Methods

render :: NullBackend -> Camera l n -> Render NullBackend (V (Camera l n)) (N (Camera l n)) #

Semigroup (Render NullBackend v n) 
Instance details

Defined in Diagrams.Core.Types

Monoid (Render NullBackend v n) 
Instance details

Defined in Diagrams.Core.Types

(HasLinearMap v, Metric v, OrderedField n) => Renderable (Trail' o v n) NullBackend 
Instance details

Defined in Diagrams.Trail

Methods

render :: NullBackend -> Trail' o v n -> Render NullBackend (V (Trail' o v n)) (N (Trail' o v n)) #

Renderable (Segment c v n) NullBackend 
Instance details

Defined in Diagrams.Segment

Methods

render :: NullBackend -> Segment c v n -> Render NullBackend (V (Segment c v n)) (N (Segment c v n)) #

data Options NullBackend v n 
Instance details

Defined in Diagrams.Core.Types

data Render NullBackend v n 
Instance details

Defined in Diagrams.Core.Types

type Result NullBackend v n 
Instance details

Defined in Diagrams.Core.Types

type Result NullBackend v n = ()

class Transformable t => Renderable t b where #

The Renderable type class connects backends to primitives which they know how to render.

Methods

render :: b -> t -> Render b (V t) (N t) #

Given a token representing the backend and a transformable object, render it in the appropriate rendering context.

Instances
Floating n => Renderable (Text n) NullBackend 
Instance details

Defined in Diagrams.TwoD.Text

Methods

render :: NullBackend -> Text n -> Render NullBackend (V (Text n)) (N (Text n)) #

SVGFloat n => Renderable (Text n) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> Text n -> Render SVG (V (Text n)) (N (Text n)) #

Fractional n => Renderable (Ellipsoid n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Fractional n => Renderable (Box n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

render :: NullBackend -> Box n -> Render NullBackend (V (Box n)) (N (Box n)) #

Fractional n => Renderable (Frustum n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

render :: NullBackend -> Frustum n -> Render NullBackend (V (Frustum n)) (N (Frustum n)) #

Fractional n => Renderable (DImage n a) NullBackend 
Instance details

Defined in Diagrams.TwoD.Image

Methods

render :: NullBackend -> DImage n a -> Render NullBackend (V (DImage n a)) (N (DImage n a)) #

SVGFloat n => Renderable (DImage n (Native Img)) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> DImage n (Native Img) -> Render SVG (V (DImage n (Native Img))) (N (DImage n (Native Img))) #

SVGFloat n => Renderable (DImage n Embedded) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> DImage n Embedded -> Render SVG (V (DImage n Embedded)) (N (DImage n Embedded)) #

(HasLinearMap v, Metric v, OrderedField n) => Renderable (Path v n) NullBackend 
Instance details

Defined in Diagrams.Path

Methods

render :: NullBackend -> Path v n -> Render NullBackend (V (Path v n)) (N (Path v n)) #

SVGFloat n => Renderable (Path V2 n) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> Path V2 n -> Render SVG (V (Path V2 n)) (N (Path V2 n)) #

Num n => Renderable (Camera l n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Camera

Methods

render :: NullBackend -> Camera l n -> Render NullBackend (V (Camera l n)) (N (Camera l n)) #

Renderable (Prim b v n) b

The Renderable instance for Prim just pushes calls to render down through the Prim constructor.

Instance details

Defined in Diagrams.Core.Types

Methods

render :: b -> Prim b v n -> Render b (V (Prim b v n)) (N (Prim b v n)) #

(HasLinearMap v, Metric v, OrderedField n) => Renderable (Trail' o v n) NullBackend 
Instance details

Defined in Diagrams.Trail

Methods

render :: NullBackend -> Trail' o v n -> Render NullBackend (V (Trail' o v n)) (N (Trail' o v n)) #

Renderable (Segment c v n) NullBackend 
Instance details

Defined in Diagrams.Segment

Methods

render :: NullBackend -> Segment c v n -> Render NullBackend (V (Segment c v n)) (N (Segment c v n)) #

juxtaposeDefault :: (Enveloped a, HasOrigin a) => Vn a -> a -> a -> a #

Default implementation of juxtapose for things which are instances of Enveloped and HasOrigin. If either envelope is empty, the second object is returned unchanged.

class Juxtaposable a where #

Class of things which can be placed "next to" other things, for some appropriate notion of "next to".

Methods

juxtapose :: Vn a -> a -> a -> a #

juxtapose v a1 a2 positions a2 next to a1 in the direction of v. In particular, place a2 so that v points from the local origin of a1 towards the old local origin of a2; a1's local origin becomes a2's new local origin. The result is just a translated version of a2. (In particular, this operation does not combine a1 and a2 in any way.)

Instances
(Enveloped b, HasOrigin b) => Juxtaposable [b] 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn [b] -> [b] -> [b] -> [b] #

(Enveloped b, HasOrigin b, Ord b) => Juxtaposable (Set b) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (Set b) -> Set b -> Set b -> Set b #

Enveloped a => Juxtaposable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

juxtapose :: Vn (Located a) -> Located a -> Located a -> Located a #

Juxtaposable a => Juxtaposable (b -> a) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (b -> a) -> (b -> a) -> (b -> a) -> b -> a #

(Enveloped a, HasOrigin a, Enveloped b, HasOrigin b, V a ~ V b, N a ~ N b) => Juxtaposable (a, b) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (a, b) -> (a, b) -> (a, b) -> (a, b) #

(Enveloped b, HasOrigin b) => Juxtaposable (Map k b) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (Map k b) -> Map k b -> Map k b -> Map k b #

(Metric v, OrderedField n) => Juxtaposable (Envelope v n) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (Envelope v n) -> Envelope v n -> Envelope v n -> Envelope v n #

Juxtaposable a => Juxtaposable (Measured n a) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (Measured n a) -> Measured n a -> Measured n a -> Measured n a #

(Metric v, OrderedField n) => Juxtaposable (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

juxtapose :: Vn (Path v n) -> Path v n -> Path v n -> Path v n #

(Metric v, OrderedField n, Monoid' m) => Juxtaposable (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

juxtapose :: Vn (QDiagram b v n m) -> QDiagram b v n m -> QDiagram b v n m -> QDiagram b v n m #

size :: (V a ~ v, N a ~ n, Enveloped a, HasBasis v) => a -> v n #

The smallest positive axis-parallel vector that bounds the envelope of an object.

radius :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> n #

Compute the "radius" (1/2 the diameter) of an enveloped object along a particular vector.

diameter :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> n #

Compute the diameter of a enveloped object along a particular vector. Returns zero for the empty envelope.

envelopeP :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> Point v n #

Compute the point on a separating hyperplane in the given direction. Returns the origin for the empty envelope.

envelopePMay :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> Maybe (Point v n) #

Compute the point on a separating hyperplane in the given direction, or Nothing for the empty envelope.

envelopeV :: Enveloped a => Vn a -> a -> Vn a #

Compute the vector from the local origin to a separating hyperplane in the given direction. Returns the zero vector for the empty envelope.

envelopeVMay :: Enveloped a => Vn a -> a -> Maybe (Vn a) #

Compute the vector from the local origin to a separating hyperplane in the given direction, or Nothing for the empty envelope.

mkEnvelope :: (v n -> n) -> Envelope v n #

Create an envelope from a v n -> n function.

onEnvelope :: ((v n -> n) -> v n -> n) -> Envelope v n -> Envelope v n #

A convenient way to transform an envelope, by specifying a transformation on the underlying v n -> n function. The empty envelope is unaffected.

appEnvelope :: Envelope v n -> Maybe (v n -> n) #

"Apply" an envelope by turning it into a function. Nothing is returned iff the envelope is empty.

newtype Envelope (v :: Type -> Type) n #

Every diagram comes equipped with an envelope. What is an envelope?

Consider first the idea of a bounding box. A bounding box expresses the distance to a bounding plane in every direction parallel to an axis. That is, a bounding box can be thought of as the intersection of a collection of half-planes, two perpendicular to each axis.

More generally, the intersection of half-planes in every direction would give a tight "bounding region", or convex hull. However, representing such a thing intensionally would be impossible; hence bounding boxes are often used as an approximation.

An envelope is an extensional representation of such a "bounding region". Instead of storing some sort of direct representation, we store a function which takes a direction as input and gives a distance to a bounding half-plane as output. The important point is that envelopes can be composed, and transformed by any affine transformation.

Formally, given a vector v, the envelope computes a scalar s such that

  • for every point u inside the diagram, if the projection of (u - origin) onto v is s' *^ v, then s' <= s.
  • s is the smallest such scalar.

There is also a special "empty envelope".

The idea for envelopes came from Sebastian Setzer; see http://byorgey.wordpress.com/2009/10/28/collecting-attributes/#comment-2030. See also Brent Yorgey, Monoids: Theme and Variations, published in the 2012 Haskell Symposium: http://ozark.hendrix.edu/~yorgey/pub/monoid-pearl.pdf; video: http://www.youtube.com/watch?v=X-8NCkD2vOw.

Constructors

Envelope (Option (v n -> Max n)) 
Instances
Show (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

showsPrec :: Int -> Envelope v n -> ShowS #

show :: Envelope v n -> String #

showList :: [Envelope v n] -> ShowS #

Ord n => Semigroup (Envelope v n)

Envelopes form a semigroup with pointwise maximum as composition. Hence, if e1 is the envelope for diagram d1, and e2 is the envelope for d2, then e1 `mappend` e2 is the envelope for d1 `atop` d2.

Instance details

Defined in Diagrams.Core.Envelope

Methods

(<>) :: Envelope v n -> Envelope v n -> Envelope v n #

sconcat :: NonEmpty (Envelope v n) -> Envelope v n #

stimes :: Integral b => b -> Envelope v n -> Envelope v n #

Ord n => Monoid (Envelope v n)

The special empty envelope is the identity for the Monoid instance.

Instance details

Defined in Diagrams.Core.Envelope

Methods

mempty :: Envelope v n #

mappend :: Envelope v n -> Envelope v n -> Envelope v n #

mconcat :: [Envelope v n] -> Envelope v n #

(Metric v, OrderedField n) => Juxtaposable (Envelope v n) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (Envelope v n) -> Envelope v n -> Envelope v n -> Envelope v n #

(Metric v, OrderedField n) => Enveloped (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: Envelope v n -> Envelope (V (Envelope v n)) (N (Envelope v n)) #

(Metric v, Floating n) => Transformable (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

transform :: Transformation (V (Envelope v n)) (N (Envelope v n)) -> Envelope v n -> Envelope v n #

(Metric v, Fractional n) => HasOrigin (Envelope v n)

The local origin of an envelope is the point with respect to which bounding queries are made, i.e. the point from which the input vectors are taken to originate.

Instance details

Defined in Diagrams.Core.Envelope

Methods

moveOriginTo :: Point (V (Envelope v n)) (N (Envelope v n)) -> Envelope v n -> Envelope v n #

(Metric v, OrderedField n) => Alignable (Envelope v n) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v0 n0 (Envelope v n), Fractional n0, HasOrigin (Envelope v n)) => (v0 n0 -> Envelope v n -> Point v0 n0) -> v0 n0 -> n0 -> Envelope v n -> Envelope v n #

defaultBoundary :: (V (Envelope v n) ~ v0, N (Envelope v n) ~ n0) => v0 n0 -> Envelope v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (Envelope v n), Fractional n0, HasOrigin (Envelope v n)) => v0 n0 -> n0 -> Envelope v n -> Envelope v n #

Wrapped (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

Associated Types

type Unwrapped (Envelope v n) :: Type #

Methods

_Wrapped' :: Iso' (Envelope v n) (Unwrapped (Envelope v n)) #

Rewrapped (Envelope v n) (Envelope v' n') 
Instance details

Defined in Diagrams.Core.Envelope

type V (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

type V (Envelope v n) = v
type N (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

type N (Envelope v n) = n
type Unwrapped (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

type Unwrapped (Envelope v n) = Option (v n -> Max n)

type OrderedField s = (Floating s, Ord s) #

When dealing with envelopes we often want scalars to be an ordered field (i.e. support all four arithmetic operations and be totally ordered) so we introduce this constraint as a convenient shorthand.

class (Metric (V a), OrderedField (N a)) => Enveloped a where #

Enveloped abstracts over things which have an envelope.

Methods

getEnvelope :: a -> Envelope (V a) (N a) #

Compute the envelope of an object. For types with an intrinsic notion of "local origin", the envelope will be based there. Other types (e.g. Trail) may have some other default reference point at which the envelope will be based; their instances should document what it is.

Instances
Enveloped b => Enveloped [b] 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: [b] -> Envelope (V [b]) (N [b]) #

Enveloped b => Enveloped (Set b) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: Set b -> Envelope (V (Set b)) (N (Set b)) #

Enveloped t => Enveloped (TransInv t) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: TransInv t -> Envelope (V (TransInv t)) (N (TransInv t)) #

Enveloped a => Enveloped (Located a)

The envelope of a Located a is the envelope of the a, translated to the location.

Instance details

Defined in Diagrams.Located

Methods

getEnvelope :: Located a -> Envelope (V (Located a)) (N (Located a)) #

OrderedField n => Enveloped (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: Ellipsoid n -> Envelope (V (Ellipsoid n)) (N (Ellipsoid n)) #

OrderedField n => Enveloped (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: Box n -> Envelope (V (Box n)) (N (Box n)) #

(OrderedField n, RealFloat n) => Enveloped (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: Frustum n -> Envelope (V (Frustum n)) (N (Frustum n)) #

RealFloat n => Enveloped (CSG n)

The Envelope for an Intersection or Difference is simply the Envelope of the Union. This is wrong but easy to implement.

Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: CSG n -> Envelope (V (CSG n)) (N (CSG n)) #

(Enveloped a, Enveloped b, V a ~ V b, N a ~ N b) => Enveloped (a, b) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: (a, b) -> Envelope (V (a, b)) (N (a, b)) #

Enveloped b => Enveloped (Map k b) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: Map k b -> Envelope (V (Map k b)) (N (Map k b)) #

(Metric v, OrderedField n) => Enveloped (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: Envelope v n -> Envelope (V (Envelope v n)) (N (Envelope v n)) #

(OrderedField n, Metric v) => Enveloped (Point v n) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: Point v n -> Envelope (V (Point v n)) (N (Point v n)) #

(Metric v, Traversable v, OrderedField n) => Enveloped (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getEnvelope :: BoundingBox v n -> Envelope (V (BoundingBox v n)) (N (BoundingBox v n)) #

(Metric v, OrderedField n) => Enveloped (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

getEnvelope :: Path v n -> Envelope (V (Path v n)) (N (Path v n)) #

(Metric v, OrderedField n) => Enveloped (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

getEnvelope :: Trail v n -> Envelope (V (Trail v n)) (N (Trail v n)) #

(Metric v, OrderedField n) => Enveloped (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Methods

getEnvelope :: FixedSegment v n -> Envelope (V (FixedSegment v n)) (N (FixedSegment v n)) #

(Metric v, OrderedField n) => Enveloped (Trail' l v n)

The envelope for a trail is based at the trail's start.

Instance details

Defined in Diagrams.Trail

Methods

getEnvelope :: Trail' l v n -> Envelope (V (Trail' l v n)) (N (Trail' l v n)) #

(Metric v, OrderedField n) => Enveloped (Segment Closed v n)

The envelope for a segment is based at the segment's start.

Instance details

Defined in Diagrams.Segment

Methods

getEnvelope :: Segment Closed v n -> Envelope (V (Segment Closed v n)) (N (Segment Closed v n)) #

(Metric v, OrderedField n, Monoid' m) => Enveloped (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getEnvelope :: QDiagram b v n m -> Envelope (V (QDiagram b v n m)) (N (QDiagram b v n m)) #

(OrderedField n, Metric v, Monoid' m) => Enveloped (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getEnvelope :: Subdiagram b v n m -> Envelope (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) #

newtype Query (v :: Type -> Type) n m #

A query is a function that maps points in a vector space to values in some monoid. Queries naturally form a monoid, with two queries being combined pointwise.

The idea for annotating diagrams with monoidal queries came from the graphics-drawingcombinators package, http://hackage.haskell.org/package/graphics-drawingcombinators.

Constructors

Query 

Fields

Instances
Functor v => Profunctor (Query v) 
Instance details

Defined in Diagrams.Core.Query

Methods

dimap :: (a -> b) -> (c -> d) -> Query v b c -> Query v a d #

lmap :: (a -> b) -> Query v b c -> Query v a c #

rmap :: (b -> c) -> Query v a b -> Query v a c #

(#.) :: Coercible c b => q b c -> Query v a b -> Query v a c #

(.#) :: Coercible b a => Query v b c -> q a b -> Query v a c #

Functor v => Corepresentable (Query v) 
Instance details

Defined in Diagrams.Core.Query

Associated Types

type Corep (Query v) :: Type -> Type #

Methods

cotabulate :: (Corep (Query v) d -> c) -> Query v d c #

Functor v => Closed (Query v) 
Instance details

Defined in Diagrams.Core.Query

Methods

closed :: Query v a b -> Query v (x -> a) (x -> b) #

Functor v => Costrong (Query v) 
Instance details

Defined in Diagrams.Core.Query

Methods

unfirst :: Query v (a, d) (b, d) -> Query v a b #

unsecond :: Query v (d, a) (d, b) -> Query v a b #

Functor v => Cosieve (Query v) (Point v) 
Instance details

Defined in Diagrams.Core.Query

Methods

cosieve :: Query v a b -> Point v a -> b #

Monad (Query v n) 
Instance details

Defined in Diagrams.Core.Query

Methods

(>>=) :: Query v n a -> (a -> Query v n b) -> Query v n b #

(>>) :: Query v n a -> Query v n b -> Query v n b #

return :: a -> Query v n a #

fail :: String -> Query v n a #

Functor (Query v n) 
Instance details

Defined in Diagrams.Core.Query

Methods

fmap :: (a -> b) -> Query v n a -> Query v n b #

(<$) :: a -> Query v n b -> Query v n a #

Applicative (Query v n) 
Instance details

Defined in Diagrams.Core.Query

Methods

pure :: a -> Query v n a #

(<*>) :: Query v n (a -> b) -> Query v n a -> Query v n b #

liftA2 :: (a -> b -> c) -> Query v n a -> Query v n b -> Query v n c #

(*>) :: Query v n a -> Query v n b -> Query v n b #

(<*) :: Query v n a -> Query v n b -> Query v n a #

Distributive (Query v n) 
Instance details

Defined in Diagrams.Core.Query

Methods

distribute :: Functor f => f (Query v n a) -> Query v n (f a) #

collect :: Functor f => (a -> Query v n b) -> f a -> Query v n (f b) #

distributeM :: Monad m => m (Query v n a) -> Query v n (m a) #

collectM :: Monad m => (a -> Query v n b) -> m a -> Query v n (m b) #

Representable (Query v n) 
Instance details

Defined in Diagrams.Core.Query

Associated Types

type Rep (Query v n) :: Type #

Methods

tabulate :: (Rep (Query v n) -> a) -> Query v n a #

index :: Query v n a -> Rep (Query v n) -> a #

Semigroup m => Semigroup (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Methods

(<>) :: Query v n m -> Query v n m -> Query v n m #

sconcat :: NonEmpty (Query v n m) -> Query v n m #

stimes :: Integral b => b -> Query v n m -> Query v n m #

Monoid m => Monoid (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Methods

mempty :: Query v n m #

mappend :: Query v n m -> Query v n m -> Query v n m #

mconcat :: [Query v n m] -> Query v n m #

(Additive v, Num n) => Transformable (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Methods

transform :: Transformation (V (Query v n m)) (N (Query v n m)) -> Query v n m -> Query v n m #

(Additive v, Num n) => HasOrigin (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Methods

moveOriginTo :: Point (V (Query v n m)) (N (Query v n m)) -> Query v n m -> Query v n m #

Wrapped (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Associated Types

type Unwrapped (Query v n m) :: Type #

Methods

_Wrapped' :: Iso' (Query v n m) (Unwrapped (Query v n m)) #

HasQuery (Query v n m) m 
Instance details

Defined in Diagrams.Query

Methods

getQuery :: Query v n m -> Query (V (Query v n m)) (N (Query v n m)) m #

Rewrapped (Query v a m) (Query v' a' m') 
Instance details

Defined in Diagrams.Core.Query

type Corep (Query v) 
Instance details

Defined in Diagrams.Core.Query

type Corep (Query v) = Point v
type Rep (Query v n) 
Instance details

Defined in Diagrams.Core.Query

type Rep (Query v n) = Point v n
type V (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

type V (Query v n m) = v
type N (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

type N (Query v n m) = n
type Unwrapped (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

type Unwrapped (Query v n m) = Point v n -> m

maxRayTraceP :: (n ~ N a, Traced a, Num n) => Point (V a) n -> V a n -> a -> Maybe (Point (V a) n) #

Like rayTraceP, but computes the "largest" boundary point instead of the smallest. Considers only positive boundary points.

maxRayTraceV :: (n ~ N a, Traced a, Num n) => Point (V a) n -> V a n -> a -> Maybe (V a n) #

Like rayTraceV, but computes a vector to the "largest" boundary point instead of the smallest. Considers only positive boundary points.

rayTraceP :: (n ~ N a, Traced a, Num n) => Point (V a) n -> V a n -> a -> Maybe (Point (V a) n) #

Compute the boundary point on an object which is closest to the given base point in the given direction, or Nothing if there is no such boundary point. Note that unlike traceP, only positive boundary points are considered, i.e. boundary points corresponding to a positive scalar multiple of the direction vector. This is intuitively the "usual" behavior of a raytracer, which only considers intersection points "in front of" the camera.

rayTraceV :: (n ~ N a, Traced a, Num n) => Point (V a) n -> V a n -> a -> Maybe (V a n) #

Compute the vector from the given point to the closest boundary point of the given object in the given direction, or Nothing if there is no such boundary point (as in the third example below). Note that unlike traceV, only positive boundary points are considered, i.e. boundary points corresponding to a positive scalar multiple of the direction vector. This is intuitively the "usual" behavior of a raytracer, which only considers intersections "in front of" the camera. Compare the second example diagram below with the second example shown for traceV.

maxTraceP :: (n ~ N a, Num n, Traced a) => Point (V a) n -> V a n -> a -> Maybe (Point (V a) n) #

Like traceP, but computes the "largest" boundary point instead of the smallest. (Note, however, the "largest" boundary point may still be in the opposite direction from the given vector, if all the boundary points are.)

maxTraceV :: (n ~ N a, Num n, Traced a) => Point (V a) n -> V a n -> a -> Maybe (V a n) #

Like traceV, but computes a vector to the "largest" boundary point instead of the smallest. (Note, however, the "largest" boundary point may still be in the opposite direction from the given vector, if all the boundary points are, as in the third example shown below.)

traceP :: (n ~ N a, Traced a, Num n) => Point (V a) n -> V a n -> a -> Maybe (Point (V a) n) #

Compute the "smallest" boundary point along the line determined by the given point p and vector v. The "smallest" boundary point is defined as the one given by p .+^ (s *^ v) for the smallest (most negative) value of s. Return Nothing if there is no such boundary point. See also traceV.

See also rayTraceP which uses the smallest positive intersection, which is often more intuitive behavior.

traceV :: (n ~ N a, Num n, Traced a) => Point (V a) n -> V a n -> a -> Maybe (V a n) #

Compute the vector from the given point p to the "smallest" boundary intersection along the given vector v. The "smallest" boundary intersection is defined as the one given by p .+^ (s *^ v) for the smallest (most negative) value of s. Return Nothing if there is no intersection. See also traceP.

See also rayTraceV which uses the smallest positive intersection, which is often more intuitive behavior.

mkTrace :: (Point v n -> v n -> SortedList n) -> Trace v n #

getSortedList :: SortedList a -> [a] #

Project the (guaranteed sorted) list out of a SortedList wrapper.

mkSortedList :: Ord a => [a] -> SortedList a #

A smart constructor for the SortedList type, which sorts the input to ensure the SortedList invariant.

data SortedList a #

A newtype wrapper around a list which maintains the invariant that the list is sorted. The constructor is not exported; use the smart constructor mkSortedList (which sorts the given list) instead.

Instances
Ord a => Semigroup (SortedList a)

SortedList forms a semigroup with merge as composition.

Instance details

Defined in Diagrams.Core.Trace

Ord a => Monoid (SortedList a)

SortedList forms a monoid with merge and the empty list.

Instance details

Defined in Diagrams.Core.Trace

newtype Trace (v :: Type -> Type) n #

Every diagram comes equipped with a trace. Intuitively, the trace for a diagram is like a raytracer: given a line (represented as a base point and a direction vector), the trace computes a sorted list of signed distances from the base point to all intersections of the line with the boundary of the diagram.

Note that the outputs are not absolute distances, but multipliers relative to the input vector. That is, if the base point is p and direction vector is v, and one of the output scalars is s, then there is an intersection at the point p .+^ (s *^ v).

Constructors

Trace 

Fields

Instances
Show (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

showsPrec :: Int -> Trace v n -> ShowS #

show :: Trace v n -> String #

showList :: [Trace v n] -> ShowS #

Ord n => Semigroup (Trace v n)

Traces form a semigroup with pointwise minimum as composition. Hence, if t1 is the trace for diagram d1, and e2 is the trace for d2, then e1 `mappend` e2 is the trace for d1 `atop` d2.

Instance details

Defined in Diagrams.Core.Trace

Methods

(<>) :: Trace v n -> Trace v n -> Trace v n #

sconcat :: NonEmpty (Trace v n) -> Trace v n #

stimes :: Integral b => b -> Trace v n -> Trace v n #

Ord n => Monoid (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

mempty :: Trace v n #

mappend :: Trace v n -> Trace v n -> Trace v n #

mconcat :: [Trace v n] -> Trace v n #

(Additive v, Ord n) => Traced (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: Trace v n -> Trace (V (Trace v n)) (N (Trace v n)) #

(Additive v, Num n) => Transformable (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

transform :: Transformation (V (Trace v n)) (N (Trace v n)) -> Trace v n -> Trace v n #

(Additive v, Num n) => HasOrigin (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

moveOriginTo :: Point (V (Trace v n)) (N (Trace v n)) -> Trace v n -> Trace v n #

(Metric v, OrderedField n) => Alignable (Trace v n) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v0 n0 (Trace v n), Fractional n0, HasOrigin (Trace v n)) => (v0 n0 -> Trace v n -> Point v0 n0) -> v0 n0 -> n0 -> Trace v n -> Trace v n #

defaultBoundary :: (V (Trace v n) ~ v0, N (Trace v n) ~ n0) => v0 n0 -> Trace v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (Trace v n), Fractional n0, HasOrigin (Trace v n)) => v0 n0 -> n0 -> Trace v n -> Trace v n #

Wrapped (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Associated Types

type Unwrapped (Trace v n) :: Type #

Methods

_Wrapped' :: Iso' (Trace v n) (Unwrapped (Trace v n)) #

Rewrapped (Trace v n) (Trace v' n') 
Instance details

Defined in Diagrams.Core.Trace

type V (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

type V (Trace v n) = v
type N (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

type N (Trace v n) = n
type Unwrapped (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

type Unwrapped (Trace v n) = Point v n -> v n -> SortedList n

class (Additive (V a), Ord (N a)) => Traced a where #

Traced abstracts over things which have a trace.

Methods

getTrace :: a -> Trace (V a) (N a) #

Compute the trace of an object.

Instances
Traced b => Traced [b] 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: [b] -> Trace (V [b]) (N [b]) #

Traced b => Traced (Set b) 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: Set b -> Trace (V (Set b)) (N (Set b)) #

Traced t => Traced (TransInv t) 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: TransInv t -> Trace (V (TransInv t)) (N (TransInv t)) #

(Traced a, Num (N a)) => Traced (Located a)

The trace of a Located a is the trace of the a, translated to the location.

Instance details

Defined in Diagrams.Located

Methods

getTrace :: Located a -> Trace (V (Located a)) (N (Located a)) #

OrderedField n => Traced (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: Ellipsoid n -> Trace (V (Ellipsoid n)) (N (Ellipsoid n)) #

(Fractional n, Ord n) => Traced (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: Box n -> Trace (V (Box n)) (N (Box n)) #

(RealFloat n, Ord n) => Traced (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: Frustum n -> Trace (V (Frustum n)) (N (Frustum n)) #

(RealFloat n, Ord n) => Traced (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: CSG n -> Trace (V (CSG n)) (N (CSG n)) #

(Traced a, Traced b, SameSpace a b) => Traced (a, b) 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: (a, b) -> Trace (V (a, b)) (N (a, b)) #

Traced b => Traced (Map k b) 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: Map k b -> Trace (V (Map k b)) (N (Map k b)) #

(Additive v, Ord n) => Traced (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: Trace v n -> Trace (V (Trace v n)) (N (Trace v n)) #

(Additive v, Ord n) => Traced (Point v n)

The trace of a single point is the empty trace, i.e. the one which returns no intersection points for every query. Arguably it should return a single finite distance for vectors aimed directly at the given point, but due to floating-point inaccuracy this is problematic. Note that the envelope for a single point is not the empty envelope (see Diagrams.Core.Envelope).

Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: Point v n -> Trace (V (Point v n)) (N (Point v n)) #

RealFloat n => Traced (BoundingBox V2 n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getTrace :: BoundingBox V2 n -> Trace (V (BoundingBox V2 n)) (N (BoundingBox V2 n)) #

TypeableFloat n => Traced (BoundingBox V3 n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getTrace :: BoundingBox V3 n -> Trace (V (BoundingBox V3 n)) (N (BoundingBox V3 n)) #

(Metric v, OrderedField n, Semigroup m) => Traced (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getTrace :: QDiagram b v n m -> Trace (V (QDiagram b v n m)) (N (QDiagram b v n m)) #

(OrderedField n, Metric v, Semigroup m) => Traced (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

getTrace :: Subdiagram b v n m -> Trace (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) #

(.>) :: (IsName a1, IsName a2) => a1 -> a2 -> Name infixr 5 #

Convenient operator for writing qualified names with atomic components of different types. Instead of writing toName a1 <> toName a2 <> toName a3 you can just write a1 .> a2 .> a3.

eachName :: (Typeable a, Ord a, Show a) => Traversal' Name a #

Traversal over each name in a Name that matches the target type.

>>> toListOf eachName (a .> False .> b) :: String
"ab"
>>> a .> True .> b & eachName %~ not
a .> False .> b

Note that the type of the name is very important.

>>> sumOf eachName ((1::Int) .> (2 :: Integer) .> (3 :: Int)) :: Int
4
>>> sumOf eachName ((1::Int) .> (2 :: Integer) .> (3 :: Int)) :: Integer
2

class (Typeable a, Ord a, Show a) => IsName a where #

Class for those types which can be used as names. They must support Typeable (to facilitate extracting them from existential wrappers), Ord (for comparison and efficient storage) and Show.

To make an instance of IsName, you need not define any methods, just declare it.

WARNING: it is not recommended to use GeneralizedNewtypeDeriving in conjunction with IsName, since in that case the underlying type and the newtype will be considered equivalent when comparing names. For example:

    newtype WordN = WordN Int deriving (Show, Ord, Eq, Typeable, IsName)
  

is unlikely to work as intended, since (1 :: Int) and (WordN 1) will be considered equal as names. Instead, use

    newtype WordN = WordN Int deriving (Show, Ord, Eq, Typeable, IsName)
    instance IsName WordN
  

Minimal complete definition

Nothing

Methods

toName :: a -> Name #

Instances
IsName Bool 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Bool -> Name #

IsName Char 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Char -> Name #

IsName Double 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Double -> Name #

IsName Float 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Float -> Name #

IsName Int 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Int -> Name #

IsName Integer 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Integer -> Name #

IsName () 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: () -> Name #

IsName AName 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: AName -> Name #

IsName Name 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Name -> Name #

IsName a => IsName [a] 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: [a] -> Name #

IsName a => IsName (Maybe a) 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Maybe a -> Name #

(IsName a, IsName b) => IsName (a, b) 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: (a, b) -> Name #

(IsName a, IsName b, IsName c) => IsName (a, b, c) 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: (a, b, c) -> Name #

data AName #

Atomic names. AName is just an existential wrapper around things which are Typeable, Ord and Show.

Instances
Eq AName 
Instance details

Defined in Diagrams.Core.Names

Methods

(==) :: AName -> AName -> Bool #

(/=) :: AName -> AName -> Bool #

Ord AName 
Instance details

Defined in Diagrams.Core.Names

Methods

compare :: AName -> AName -> Ordering #

(<) :: AName -> AName -> Bool #

(<=) :: AName -> AName -> Bool #

(>) :: AName -> AName -> Bool #

(>=) :: AName -> AName -> Bool #

max :: AName -> AName -> AName #

min :: AName -> AName -> AName #

Show AName 
Instance details

Defined in Diagrams.Core.Names

Methods

showsPrec :: Int -> AName -> ShowS #

show :: AName -> String #

showList :: [AName] -> ShowS #

IsName AName 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: AName -> Name #

Each Name Name AName AName 
Instance details

Defined in Diagrams.Core.Names

data Name #

A (qualified) name is a (possibly empty) sequence of atomic names.

Instances
Eq Name 
Instance details

Defined in Diagrams.Core.Names

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Ord Name 
Instance details

Defined in Diagrams.Core.Names

Methods

compare :: Name -> Name -> Ordering #

(<) :: Name -> Name -> Bool #

(<=) :: Name -> Name -> Bool #

(>) :: Name -> Name -> Bool #

(>=) :: Name -> Name -> Bool #

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

Show Name 
Instance details

Defined in Diagrams.Core.Names

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

Semigroup Name 
Instance details

Defined in Diagrams.Core.Names

Methods

(<>) :: Name -> Name -> Name #

sconcat :: NonEmpty Name -> Name #

stimes :: Integral b => b -> Name -> Name #

Monoid Name 
Instance details

Defined in Diagrams.Core.Names

Methods

mempty :: Name #

mappend :: Name -> Name -> Name #

mconcat :: [Name] -> Name #

IsName Name 
Instance details

Defined in Diagrams.Core.Names

Methods

toName :: Name -> Name #

Qualifiable Name

Of course, names can be qualified using (.>).

Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a => a -> Name -> Name #

Wrapped Name 
Instance details

Defined in Diagrams.Core.Names

Associated Types

type Unwrapped Name :: Type #

Rewrapped Name Name 
Instance details

Defined in Diagrams.Core.Names

Each Name Name AName AName 
Instance details

Defined in Diagrams.Core.Names

Action Name (SubMap b v n m)

A name acts on a name map by qualifying every name in it.

Instance details

Defined in Diagrams.Core.Types

Methods

act :: Name -> SubMap b v n m -> SubMap b v n m #

type Unwrapped Name 
Instance details

Defined in Diagrams.Core.Names

class Qualifiable q where #

Instances of Qualifiable are things which can be qualified by prefixing them with a name.

Methods

(.>>) :: IsName a => a -> q -> q infixr 5 #

Qualify with the given name.

Instances
Qualifiable Name

Of course, names can be qualified using (.>).

Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a => a -> Name -> Name #

Qualifiable a => Qualifiable [a] 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> [a] -> [a] #

(Ord a, Qualifiable a) => Qualifiable (Set a) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> Set a -> Set a #

Qualifiable a => Qualifiable (TransInv a) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> TransInv a -> TransInv a #

Qualifiable a => Qualifiable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

(.>>) :: IsName a0 => a0 -> Located a -> Located a #

Qualifiable a => Qualifiable (b -> a) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> (b -> a) -> b -> a #

(Qualifiable a, Qualifiable b) => Qualifiable (a, b) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> (a, b) -> (a, b) #

Qualifiable a => Qualifiable (Map k a) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> Map k a -> Map k a #

Qualifiable a => Qualifiable (Measured n a) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> Measured n a -> Measured n a #

(Qualifiable a, Qualifiable b, Qualifiable c) => Qualifiable (a, b, c) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> (a, b, c) -> (a, b, c) #

(Metric v, OrderedField n, Semigroup m) => Qualifiable (QDiagram b v n m)

Diagrams can be qualified so that all their named points can now be referred to using the qualification prefix.

Instance details

Defined in Diagrams.Core.Types

Methods

(.>>) :: IsName a => a -> QDiagram b v n m -> QDiagram b v n m #

Qualifiable (SubMap b v n m)

SubMaps are qualifiable: if ns is a SubMap, then a |> ns is the same SubMap except with every name qualified by a.

Instance details

Defined in Diagrams.Core.Types

Methods

(.>>) :: IsName a => a -> SubMap b v n m -> SubMap b v n m #

applyTAttr :: (AttributeClass a, Transformable a, V a ~ V d, N a ~ N d, HasStyle d) => a -> d -> d #

Apply a transformable attribute to an instance of HasStyle (such as a diagram or a style). If the object already has an attribute of the same type, the new attribute is combined on the left with the existing attribute, according to their semigroup structure.

applyMAttr :: (AttributeClass a, N d ~ n, HasStyle d) => Measured n a -> d -> d #

Apply a measured attribute to an instance of HasStyle (such as a diagram or a style). If the object already has an attribute of the same type, the new attribute is combined on the left with the existing attribute, according to their semigroup structure.

applyAttr :: (AttributeClass a, HasStyle d) => a -> d -> d #

Apply an attribute to an instance of HasStyle (such as a diagram or a style). If the object already has an attribute of the same type, the new attribute is combined on the left with the existing attribute, according to their semigroup structure.

atTAttr :: (V a ~ v, N a ~ n, AttributeClass a, Transformable a) => Lens' (Style v n) (Maybe a) #

Lens onto a transformable attribute of a style.

atMAttr :: (AttributeClass a, Typeable n) => Lens' (Style v n) (Maybe (Measured n a)) #

Lens onto a measured attribute of a style.

atAttr :: AttributeClass a => Lens' (Style v n) (Maybe a) #

Lens onto a plain attribute of a style.

getAttr :: AttributeClass a => Style v n -> Maybe a #

Extract an attribute from a style of a particular type. If the style contains an attribute of the requested type, it will be returned wrapped in Just; otherwise, Nothing is returned.

Trying to extract a measured attibute will fail. It either has to be unmeasured with unmeasureAttrs or use the atMAttr lens.

class (Typeable a, Semigroup a) => AttributeClass a #

Every attribute must be an instance of AttributeClass, which simply guarantees Typeable and Semigroup constraints. The Semigroup instance for an attribute determines how it will combine with other attributes of the same type.

Instances
AttributeClass Font 
Instance details

Defined in Diagrams.TwoD.Text

AttributeClass FontSlant 
Instance details

Defined in Diagrams.TwoD.Text

AttributeClass FontWeight 
Instance details

Defined in Diagrams.TwoD.Text

AttributeClass FillRule 
Instance details

Defined in Diagrams.TwoD.Path

AttributeClass Highlight 
Instance details

Defined in Diagrams.ThreeD.Attributes

AttributeClass SurfaceColor 
Instance details

Defined in Diagrams.ThreeD.Attributes

AttributeClass Diffuse 
Instance details

Defined in Diagrams.ThreeD.Attributes

AttributeClass Ambient 
Instance details

Defined in Diagrams.ThreeD.Attributes

AttributeClass Opacity 
Instance details

Defined in Diagrams.Attributes

AttributeClass FillOpacity 
Instance details

Defined in Diagrams.Attributes

AttributeClass StrokeOpacity 
Instance details

Defined in Diagrams.Attributes

AttributeClass LineCap 
Instance details

Defined in Diagrams.Attributes

AttributeClass LineJoin 
Instance details

Defined in Diagrams.Attributes

AttributeClass LineMiterLimit 
Instance details

Defined in Diagrams.Attributes

Typeable n => AttributeClass (FontSize n) 
Instance details

Defined in Diagrams.TwoD.Text

Typeable n => AttributeClass (LineTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Typeable n => AttributeClass (FillTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Typeable n => AttributeClass (Clip n) 
Instance details

Defined in Diagrams.TwoD.Path

Typeable n => AttributeClass (LineWidth n) 
Instance details

Defined in Diagrams.Attributes

Typeable n => AttributeClass (Dashing n) 
Instance details

Defined in Diagrams.Attributes

data Attribute (v :: Type -> Type) n where #

An existential wrapper type to hold attributes. Some attributes are simply inert/static; some are affected by transformations; and some are affected by transformations and can be modified generically.

Constructors

Attribute :: forall (v :: Type -> Type) n a. AttributeClass a => a -> Attribute v n 
MAttribute :: forall (v :: Type -> Type) n a. AttributeClass a => Measured n a -> Attribute v n 
TAttribute :: forall (v :: Type -> Type) n a. (AttributeClass a, Transformable a, V a ~ v, N a ~ n) => a -> Attribute v n 
Instances
Show (Attribute v n)

Shows the kind of attribute and the type contained in the attribute.

Instance details

Defined in Diagrams.Core.Style

Methods

showsPrec :: Int -> Attribute v n -> ShowS #

show :: Attribute v n -> String #

showList :: [Attribute v n] -> ShowS #

Typeable n => Semigroup (Attribute v n)

Attributes form a semigroup, where the semigroup operation simply returns the right-hand attribute when the types do not match, and otherwise uses the semigroup operation specific to the (matching) types.

Instance details

Defined in Diagrams.Core.Style

Methods

(<>) :: Attribute v n -> Attribute v n -> Attribute v n #

sconcat :: NonEmpty (Attribute v n) -> Attribute v n #

stimes :: Integral b => b -> Attribute v n -> Attribute v n #

(Additive v, Traversable v, Floating n) => Transformable (Attribute v n)

TAttributes are transformed directly, MAttributes have their local scale multiplied by the average scale of the transform. Plain Attributes are unaffected.

Instance details

Defined in Diagrams.Core.Style

Methods

transform :: Transformation (V (Attribute v n)) (N (Attribute v n)) -> Attribute v n -> Attribute v n #

Each (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') 
Instance details

Defined in Diagrams.Core.Style

Methods

each :: Traversal (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') #

type V (Attribute v n) 
Instance details

Defined in Diagrams.Core.Style

type V (Attribute v n) = v
type N (Attribute v n) 
Instance details

Defined in Diagrams.Core.Style

type N (Attribute v n) = n

data Style (v :: Type -> Type) n #

A Style is a heterogeneous collection of attributes, containing at most one attribute of any given type.

Instances
Show (Style v n)

Show the attributes in the style.

Instance details

Defined in Diagrams.Core.Style

Methods

showsPrec :: Int -> Style v n -> ShowS #

show :: Style v n -> String #

showList :: [Style v n] -> ShowS #

Typeable n => Semigroup (Style v n)

Combine a style by combining the attributes; if the two styles have attributes of the same type they are combined according to their semigroup structure.

Instance details

Defined in Diagrams.Core.Style

Methods

(<>) :: Style v n -> Style v n -> Style v n #

sconcat :: NonEmpty (Style v n) -> Style v n #

stimes :: Integral b => b -> Style v n -> Style v n #

Typeable n => Monoid (Style v n)

The empty style contains no attributes.

Instance details

Defined in Diagrams.Core.Style

Methods

mempty :: Style v n #

mappend :: Style v n -> Style v n -> Style v n #

mconcat :: [Style v n] -> Style v n #

Typeable n => HasStyle (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (Style v n)) (N (Style v n)) -> Style v n -> Style v n #

(Additive v, Traversable v, Floating n) => Transformable (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

transform :: Transformation (V (Style v n)) (N (Style v n)) -> Style v n -> Style v n #

Wrapped (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Associated Types

type Unwrapped (Style v n) :: Type #

Methods

_Wrapped' :: Iso' (Style v n) (Unwrapped (Style v n)) #

At (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

at :: Index (Style v n) -> Lens' (Style v n) (Maybe (IxValue (Style v n))) #

Ixed (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

ix :: Index (Style v n) -> Traversal' (Style v n) (IxValue (Style v n)) #

Action (Style v n) m

Styles have no action on other monoids.

Instance details

Defined in Diagrams.Core.Style

Methods

act :: Style v n -> m -> m #

Rewrapped (Style v n) (Style v' n') 
Instance details

Defined in Diagrams.Core.Style

Each (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') 
Instance details

Defined in Diagrams.Core.Style

Methods

each :: Traversal (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') #

type V (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type V (Style v n) = v
type N (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type N (Style v n) = n
type Unwrapped (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type IxValue (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type IxValue (Style v n) = Attribute v n
type Index (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type Index (Style v n) = TypeRep

class HasStyle a where #

Type class for things which have a style.

Methods

applyStyle :: Style (V a) (N a) -> a -> a #

Apply a style by combining it (on the left) with the existing style.

Instances
HasStyle a => HasStyle [a] 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V [a]) (N [a]) -> [a] -> [a] #

(HasStyle a, Ord a) => HasStyle (Set a) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (Set a)) (N (Set a)) -> Set a -> Set a #

HasStyle b => HasStyle (a -> b) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (a -> b)) (N (a -> b)) -> (a -> b) -> a -> b #

(HasStyle a, HasStyle b, V a ~ V b, N a ~ N b) => HasStyle (a, b) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (a, b)) (N (a, b)) -> (a, b) -> (a, b) #

HasStyle a => HasStyle (Map k a) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (Map k a)) (N (Map k a)) -> Map k a -> Map k a #

Typeable n => HasStyle (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (Style v n)) (N (Style v n)) -> Style v n -> Style v n #

HasStyle b => HasStyle (Measured n b) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (Measured n b)) (N (Measured n b)) -> Measured n b -> Measured n b #

(Metric v, OrderedField n, Semigroup m) => HasStyle (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

applyStyle :: Style (V (QDiagram b v n m)) (N (QDiagram b v n m)) -> QDiagram b v n m -> QDiagram b v n m #

scale :: (InSpace v n a, Eq n, Fractional n, Transformable a) => n -> a -> a #

Scale uniformly in every dimension by the given scalar.

scaling :: (Additive v, Fractional n) => n -> Transformation v n #

Create a uniform scaling transformation.

translate :: Transformable t => Vn t -> t -> t #

Translate by a vector.

translation :: v n -> Transformation v n #

Create a translation.

avgScale :: (Additive v, Traversable v, Floating n) => Transformation v n -> n #

Compute the "average" amount of scaling performed by a transformation. Satisfies the properties

  avgScale (scaling k) == k
  avgScale (t1 <> t2)  == avgScale t1 * avgScale t2
  

isReflection :: (Additive v, Traversable v, Num n, Ord n) => Transformation v n -> Bool #

Determine whether a Transformation includes a reflection component, that is, whether it reverses orientation.

determinant :: (Additive v, Traversable v, Num n) => Transformation v n -> n #

The determinant of (the linear part of) a Transformation.

dimension :: (Additive (V a), Traversable (V a)) => a -> Int #

Get the dimension of an object whose vector space is an instance of HasLinearMap, e.g. transformations, paths, diagrams, etc.

fromLinear :: (Additive v, Num n) => (v n :-: v n) -> (v n :-: v n) -> Transformation v n #

Create a general affine transformation from an invertible linear transformation and its transpose. The translational component is assumed to be zero.

papply :: (Additive v, Num n) => Transformation v n -> Point v n -> Point v n #

Apply a transformation to a point.

apply :: Transformation v n -> v n -> v n #

Apply a transformation to a vector. Note that any translational component of the transformation will not affect the vector, since vectors are invariant under translation.

dropTransl :: (Additive v, Num n) => Transformation v n -> Transformation v n #

Drop the translational component of a transformation, leaving only the linear part.

transl :: Transformation v n -> v n #

Get the translational component of a transformation.

transp :: Transformation v n -> v n :-: v n #

Get the transpose of a transformation (ignoring the translation component).

inv :: (Functor v, Num n) => Transformation v n -> Transformation v n #

Invert a transformation.

eye :: (HasBasis v, Num n) => v (v n) #

Identity matrix.

lapp :: (u :-: v) -> u -> v #

Apply a linear map to a vector.

linv :: (u :-: v) -> v :-: u #

Invert a linear map.

(<->) :: (u -> v) -> (v -> u) -> u :-: v #

Create an invertible linear map from two functions which are assumed to be linear inverses.

data u :-: v infixr 7 #

(v1 :-: v2) is a linear map paired with its inverse.

Instances
Semigroup (a :-: a) 
Instance details

Defined in Diagrams.Core.Transform

Methods

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

sconcat :: NonEmpty (a :-: a) -> a :-: a #

stimes :: Integral b => b -> (a :-: a) -> a :-: a #

Monoid (v :-: v)

Invertible linear maps from a vector space to itself form a monoid under composition.

Instance details

Defined in Diagrams.Core.Transform

Methods

mempty :: v :-: v #

mappend :: (v :-: v) -> (v :-: v) -> v :-: v #

mconcat :: [v :-: v] -> v :-: v #

data Transformation (v :: Type -> Type) n #

General (affine) transformations, represented by an invertible linear map, its transpose, and a vector representing a translation component.

By the transpose of a linear map we mean simply the linear map corresponding to the transpose of the map's matrix representation. For example, any scale is its own transpose, since scales are represented by matrices with zeros everywhere except the diagonal. The transpose of a rotation is the same as its inverse.

The reason we need to keep track of transposes is because it turns out that when transforming a shape according to some linear map L, the shape's normal vectors transform according to L's inverse transpose. (For a more detailed explanation and proof, see https://wiki.haskell.org/Diagrams/Dev/Transformations.) This is exactly what we need when transforming bounding functions, which are defined in terms of perpendicular (i.e. normal) hyperplanes.

For more general, non-invertible transformations, see Diagrams.Deform (in diagrams-lib).

Instances
(Additive v, Num n) => Semigroup (Transformation v n)

Transformations are closed under composition; t1 <> t2 is the transformation which performs first t2, then t1.

Instance details

Defined in Diagrams.Core.Transform

(Additive v, Num n) => Monoid (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

(Additive v, Num n) => Transformable (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

(Additive v, Num n) => HasOrigin (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

(Transformable a, V a ~ v, N a ~ n) => Action (Transformation v n) a

Transformations can act on transformable things.

Instance details

Defined in Diagrams.Core.Transform

Methods

act :: Transformation v n -> a -> a #

type V (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

type V (Transformation v n) = v
type N (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

type N (Transformation v n) = n

type HasLinearMap (v :: Type -> Type) = (HasBasis v, Traversable v) #

HasLinearMap is a constraint synonym, just to help shorten some of the ridiculously long constraint sets.

type HasBasis (v :: Type -> Type) = (Additive v, Representable v, Rep v ~ E v) #

An Additive vector space whose representation is made up of basis elements.

class Transformable t where #

Type class for things t which can be transformed.

Methods

transform :: Transformation (V t) (N t) -> t -> t #

Apply a transformation to an object.

Instances
Transformable t => Transformable [t] 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V [t]) (N [t]) -> [t] -> [t] #

(Transformable t, Ord t) => Transformable (Set t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (Set t)) (N (Set t)) -> Set t -> Set t #

(Num (N t), Additive (V t), Transformable t) => Transformable (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (TransInv t)) (N (TransInv t)) -> TransInv t -> TransInv t #

Floating n => Transformable (Text n) 
Instance details

Defined in Diagrams.TwoD.Text

Methods

transform :: Transformation (V (Text n)) (N (Text n)) -> Text n -> Text n #

Floating n => Transformable (LineTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Floating n => Transformable (FillTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Floating n => Transformable (Texture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Methods

transform :: Transformation (V (Texture n)) (N (Texture n)) -> Texture n -> Texture n #

Fractional n => Transformable (RGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Fractional n => Transformable (LGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

OrderedField n => Transformable (Clip n) 
Instance details

Defined in Diagrams.TwoD.Path

Methods

transform :: Transformation (V (Clip n)) (N (Clip n)) -> Clip n -> Clip n #

(Additive (V a), Num (N a), Transformable a) => Transformable (Located a)

Applying a transformation t to a Located a results in the transformation being applied to the location, and the linear portion of t being applied to the value of type a (i.e. it is not translated).

Instance details

Defined in Diagrams.Located

Methods

transform :: Transformation (V (Located a)) (N (Located a)) -> Located a -> Located a #

Fractional n => Transformable (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Fractional n => Transformable (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

transform :: Transformation (V (Box n)) (N (Box n)) -> Box n -> Box n #

Fractional n => Transformable (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

transform :: Transformation (V (Frustum n)) (N (Frustum n)) -> Frustum n -> Frustum n #

Fractional n => Transformable (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

transform :: Transformation (V (CSG n)) (N (CSG n)) -> CSG n -> CSG n #

Fractional n => Transformable (PointLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

Transformable (ParallelLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

Transformable m => Transformable (Deletable m) 
Instance details

Defined in Diagrams.Core.Transform

(V t ~ v, N t ~ n, V t ~ V s, N t ~ N s, Functor v, Num n, Transformable t, Transformable s) => Transformable (s -> t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (s -> t)) (N (s -> t)) -> (s -> t) -> s -> t #

(Transformable t, Transformable s, V t ~ V s, N t ~ N s) => Transformable (t, s) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (t, s)) (N (t, s)) -> (t, s) -> (t, s) #

Transformable t => Transformable (Map k t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (Map k t)) (N (Map k t)) -> Map k t -> Map k t #

(Metric v, Floating n) => Transformable (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

transform :: Transformation (V (Envelope v n)) (N (Envelope v n)) -> Envelope v n -> Envelope v n #

(Additive v, Num n) => Transformable (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

transform :: Transformation (V (Trace v n)) (N (Trace v n)) -> Trace v n -> Trace v n #

(Additive v, Traversable v, Floating n) => Transformable (Attribute v n)

TAttributes are transformed directly, MAttributes have their local scale multiplied by the average scale of the transform. Plain Attributes are unaffected.

Instance details

Defined in Diagrams.Core.Style

Methods

transform :: Transformation (V (Attribute v n)) (N (Attribute v n)) -> Attribute v n -> Attribute v n #

(Additive v, Traversable v, Floating n) => Transformable (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

transform :: Transformation (V (Style v n)) (N (Style v n)) -> Style v n -> Style v n #

(Additive v, Num n) => Transformable (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

(InSpace v n t, Transformable t, HasLinearMap v, Floating n) => Transformable (Measured n t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t #

(Additive v, Num n) => Transformable (Point v n) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (Point v n)) (N (Point v n)) -> Point v n -> Point v n #

Fractional n => Transformable (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

Methods

transform :: Transformation (V (DImage n a)) (N (DImage n a)) -> DImage n a -> DImage n a #

(HasLinearMap v, Metric v, OrderedField n) => Transformable (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

transform :: Transformation (V (Path v n)) (N (Path v n)) -> Path v n -> Path v n #

(Floating n, Ord n, Metric v) => Transformable (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

transform :: Transformation (V (SegTree v n)) (N (SegTree v n)) -> SegTree v n -> SegTree v n #

(HasLinearMap v, Metric v, OrderedField n) => Transformable (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

transform :: Transformation (V (Trail v n)) (N (Trail v n)) -> Trail v n -> Trail v n #

(Additive v, Num n) => Transformable (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Num n => Transformable (Camera l n) 
Instance details

Defined in Diagrams.ThreeD.Camera

Methods

transform :: Transformation (V (Camera l n)) (N (Camera l n)) -> Camera l n -> Camera l n #

(V (v n) ~ v, N (v n) ~ n, Transformable (v n)) => Transformable (Direction v n) 
Instance details

Defined in Diagrams.Direction

Methods

transform :: Transformation (V (Direction v n)) (N (Direction v n)) -> Direction v n -> Direction v n #

(Transformable t, Transformable s, Transformable u, V s ~ V t, N s ~ N t, V s ~ V u, N s ~ N u) => Transformable (t, s, u) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (t, s, u)) (N (t, s, u)) -> (t, s, u) -> (t, s, u) #

Transformable (Prim b v n)

The Transformable instance for Prim just pushes calls to transform down through the Prim constructor.

Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (Prim b v n)) (N (Prim b v n)) -> Prim b v n -> Prim b v n #

(Additive v, Num n) => Transformable (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Methods

transform :: Transformation (V (Query v n m)) (N (Query v n m)) -> Query v n m -> Query v n m #

(HasLinearMap v, Metric v, OrderedField n) => Transformable (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

transform :: Transformation (V (Trail' l v n)) (N (Trail' l v n)) -> Trail' l v n -> Trail' l v n #

Transformable (Offset c v n) 
Instance details

Defined in Diagrams.Segment

Methods

transform :: Transformation (V (Offset c v n)) (N (Offset c v n)) -> Offset c v n -> Offset c v n #

Transformable (Segment c v n) 
Instance details

Defined in Diagrams.Segment

Methods

transform :: Transformation (V (Segment c v n)) (N (Segment c v n)) -> Segment c v n -> Segment c v n #

(OrderedField n, Metric v, Semigroup m) => Transformable (QDiagram b v n m)

Diagrams can be transformed by transforming each of their components appropriately.

Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (QDiagram b v n m)) (N (QDiagram b v n m)) -> QDiagram b v n m -> QDiagram b v n m #

Transformable (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) -> Subdiagram b v n m -> Subdiagram b v n m #

Transformable (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

transform :: Transformation (V (SubMap b v n m)) (N (SubMap b v n m)) -> SubMap b v n m -> SubMap b v n m #

newtype TransInv t #

TransInv is a wrapper which makes a transformable type translationally invariant; the translational component of transformations will no longer affect things wrapped in TransInv.

Constructors

TransInv t 
Instances
Eq t => Eq (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

(==) :: TransInv t -> TransInv t -> Bool #

(/=) :: TransInv t -> TransInv t -> Bool #

Ord t => Ord (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

compare :: TransInv t -> TransInv t -> Ordering #

(<) :: TransInv t -> TransInv t -> Bool #

(<=) :: TransInv t -> TransInv t -> Bool #

(>) :: TransInv t -> TransInv t -> Bool #

(>=) :: TransInv t -> TransInv t -> Bool #

max :: TransInv t -> TransInv t -> TransInv t #

min :: TransInv t -> TransInv t -> TransInv t #

Show t => Show (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

showsPrec :: Int -> TransInv t -> ShowS #

show :: TransInv t -> String #

showList :: [TransInv t] -> ShowS #

Semigroup t => Semigroup (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

(<>) :: TransInv t -> TransInv t -> TransInv t #

sconcat :: NonEmpty (TransInv t) -> TransInv t #

stimes :: Integral b => b -> TransInv t -> TransInv t #

Monoid t => Monoid (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

mempty :: TransInv t #

mappend :: TransInv t -> TransInv t -> TransInv t #

mconcat :: [TransInv t] -> TransInv t #

Enveloped t => Enveloped (TransInv t) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: TransInv t -> Envelope (V (TransInv t)) (N (TransInv t)) #

Traced t => Traced (TransInv t) 
Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: TransInv t -> Trace (V (TransInv t)) (N (TransInv t)) #

Qualifiable a => Qualifiable (TransInv a) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> TransInv a -> TransInv a #

(Num (N t), Additive (V t), Transformable t) => Transformable (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (TransInv t)) (N (TransInv t)) -> TransInv t -> TransInv t #

HasOrigin (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

moveOriginTo :: Point (V (TransInv t)) (N (TransInv t)) -> TransInv t -> TransInv t #

TrailLike t => TrailLike (TransInv t)

Translationally invariant things are trail-like as long as the underlying type is.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (TransInv t)) (N (TransInv t))) -> TransInv t #

Wrapped (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Associated Types

type Unwrapped (TransInv t) :: Type #

Rewrapped (TransInv t) (TransInv t') 
Instance details

Defined in Diagrams.Core.Transform

type V (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

type V (TransInv t) = V t
type N (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

type N (TransInv t) = N t
type Unwrapped (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

type Unwrapped (TransInv t) = t

place :: (InSpace v n t, HasOrigin t) => t -> Point v n -> t #

A flipped variant of moveTo, provided for convenience. Useful when writing a function which takes a point as an argument, such as when using withName and friends.

moveTo :: (InSpace v n t, HasOrigin t) => Point v n -> t -> t #

Translate the object by the translation that sends the origin to the given point. Note that this is dual to moveOriginTo, i.e. we should have

  moveTo (origin .^+ v) === moveOriginTo (origin .^- v)
  

For types which are also Transformable, this is essentially the same as translate, i.e.

  moveTo (origin .^+ v) === translate v
  

moveOriginBy :: (V t ~ v, N t ~ n, HasOrigin t) => v n -> t -> t #

Move the local origin by a relative vector.

class HasOrigin t where #

Class of types which have an intrinsic notion of a "local origin", i.e. things which are not invariant under translation, and which allow the origin to be moved.

One might wonder why not just use Transformable instead of having a separate class for HasOrigin; indeed, for types which are instances of both we should have the identity

  moveOriginTo (origin .^+ v) === translate (negated v)
  

The reason is that some things (e.g. vectors, Trails) are transformable but are translationally invariant, i.e. have no origin.

Methods

moveOriginTo :: Point (V t) (N t) -> t -> t #

Move the local origin to another point.

Note that this function is in some sense dual to translate (for types which are also Transformable); moving the origin itself while leaving the object "fixed" is dual to fixing the origin and translating the diagram.

Instances
HasOrigin t => HasOrigin [t] 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V [t]) (N [t]) -> [t] -> [t] #

(HasOrigin t, Ord t) => HasOrigin (Set t) 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V (Set t)) (N (Set t)) -> Set t -> Set t #

HasOrigin (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

moveOriginTo :: Point (V (TransInv t)) (N (TransInv t)) -> TransInv t -> TransInv t #

Floating n => HasOrigin (Text n) 
Instance details

Defined in Diagrams.TwoD.Text

Methods

moveOriginTo :: Point (V (Text n)) (N (Text n)) -> Text n -> Text n #

(Num (N a), Additive (V a)) => HasOrigin (Located a)

Located a is an instance of HasOrigin whether a is or not. In particular, translating a Located a simply translates the associated point (and does not affect the value of type a).

Instance details

Defined in Diagrams.Located

Methods

moveOriginTo :: Point (V (Located a)) (N (Located a)) -> Located a -> Located a #

(HasOrigin t, HasOrigin s, SameSpace s t) => HasOrigin (s, t) 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V (s, t)) (N (s, t)) -> (s, t) -> (s, t) #

HasOrigin t => HasOrigin (Map k t) 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V (Map k t)) (N (Map k t)) -> Map k t -> Map k t #

(Metric v, Fractional n) => HasOrigin (Envelope v n)

The local origin of an envelope is the point with respect to which bounding queries are made, i.e. the point from which the input vectors are taken to originate.

Instance details

Defined in Diagrams.Core.Envelope

Methods

moveOriginTo :: Point (V (Envelope v n)) (N (Envelope v n)) -> Envelope v n -> Envelope v n #

(Additive v, Num n) => HasOrigin (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Methods

moveOriginTo :: Point (V (Trace v n)) (N (Trace v n)) -> Trace v n -> Trace v n #

(Additive v, Num n) => HasOrigin (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

HasOrigin t => HasOrigin (Measured n t) 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t #

(Additive v, Num n) => HasOrigin (Point v n) 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V (Point v n)) (N (Point v n)) -> Point v n -> Point v n #

(Additive v, Num n) => HasOrigin (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

moveOriginTo :: Point (V (BoundingBox v n)) (N (BoundingBox v n)) -> BoundingBox v n -> BoundingBox v n #

Fractional n => HasOrigin (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

Methods

moveOriginTo :: Point (V (DImage n a)) (N (DImage n a)) -> DImage n a -> DImage n a #

(Additive v, Num n) => HasOrigin (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

moveOriginTo :: Point (V (Path v n)) (N (Path v n)) -> Path v n -> Path v n #

(Additive v, Num n) => HasOrigin (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Methods

moveOriginTo :: Point (V (FixedSegment v n)) (N (FixedSegment v n)) -> FixedSegment v n -> FixedSegment v n #

(Additive v, Num n) => HasOrigin (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Methods

moveOriginTo :: Point (V (Query v n m)) (N (Query v n m)) -> Query v n m -> Query v n m #

(Metric v, OrderedField n, Semigroup m) => HasOrigin (QDiagram b v n m)

Every diagram has an intrinsic "local origin" which is the basis for all combining operations.

Instance details

Defined in Diagrams.Core.Types

Methods

moveOriginTo :: Point (V (QDiagram b v n m)) (N (QDiagram b v n m)) -> QDiagram b v n m -> QDiagram b v n m #

(Metric v, OrderedField n) => HasOrigin (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

moveOriginTo :: Point (V (Subdiagram b v n m)) (N (Subdiagram b v n m)) -> Subdiagram b v n m -> Subdiagram b v n m #

(OrderedField n, Metric v) => HasOrigin (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Methods

moveOriginTo :: Point (V (SubMap b v n m)) (N (SubMap b v n m)) -> SubMap b v n m -> SubMap b v n m #

atMost :: Ord n => Measure n -> Measure n -> Measure n #

Calculate the larger of two measures.

atLeast :: Ord n => Measure n -> Measure n -> Measure n #

Calculate the smaller of two measures.

scaleLocal :: Num n => n -> Measured n a -> Measured n a #

Scale the local units of a Measured thing.

normalized :: Num n => n -> Measure n #

Normalized units get scaled so that one normalized unit is the size of the final diagram.

global :: Num n => n -> Measure n #

Global units are scaled so that they are interpreted relative to the size of the final rendered diagram.

local :: Num n => n -> Measure n #

Local units are scaled by the average scale of a transform.

output :: n -> Measure n #

Output units don't change.

fromMeasured :: Num n => n -> n -> Measured n a -> a #

fromMeasured globalScale normalizedScale measure -> a

data Measured n a #

'Measured n a' is an object that depends on local, normalized and global scales. The normalized and global scales are calculated when rendering a diagram.

For attributes, the local scale gets multiplied by the average scale of the transform.

Instances
Profunctor Measured 
Instance details

Defined in Diagrams.Core.Measure

Methods

dimap :: (a -> b) -> (c -> d) -> Measured b c -> Measured a d #

lmap :: (a -> b) -> Measured b c -> Measured a c #

rmap :: (b -> c) -> Measured a b -> Measured a c #

(#.) :: Coercible c b => q b c -> Measured a b -> Measured a c #

(.#) :: Coercible b a => Measured b c -> q a b -> Measured a c #

Monad (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

(>>=) :: Measured n a -> (a -> Measured n b) -> Measured n b #

(>>) :: Measured n a -> Measured n b -> Measured n b #

return :: a -> Measured n a #

fail :: String -> Measured n a #

Functor (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

fmap :: (a -> b) -> Measured n a -> Measured n b #

(<$) :: a -> Measured n b -> Measured n a #

Applicative (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

pure :: a -> Measured n a #

(<*>) :: Measured n (a -> b) -> Measured n a -> Measured n b #

liftA2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c #

(*>) :: Measured n a -> Measured n b -> Measured n b #

(<*) :: Measured n a -> Measured n b -> Measured n a #

Distributive (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

distribute :: Functor f => f (Measured n a) -> Measured n (f a) #

collect :: Functor f => (a -> Measured n b) -> f a -> Measured n (f b) #

distributeM :: Monad m => m (Measured n a) -> Measured n (m a) #

collectM :: Monad m => (a -> Measured n b) -> m a -> Measured n (m b) #

Representable (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Associated Types

type Rep (Measured n) :: Type #

Methods

tabulate :: (Rep (Measured n) -> a) -> Measured n a #

index :: Measured n a -> Rep (Measured n) -> a #

Num n => Default (FontSizeM n) 
Instance details

Defined in Diagrams.TwoD.Text

Methods

def :: FontSizeM n #

OrderedField n => Default (LineWidthM n) 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineWidthM n #

Additive (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

zero :: Num a => Measured n a #

(^+^) :: Num a => Measured n a -> Measured n a -> Measured n a #

(^-^) :: Num a => Measured n a -> Measured n a -> Measured n a #

lerp :: Num a => a -> Measured n a -> Measured n a -> Measured n a #

liftU2 :: (a -> a -> a) -> Measured n a -> Measured n a -> Measured n a #

liftI2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c #

Floating a => Floating (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

Methods

pi :: Measured n a #

exp :: Measured n a -> Measured n a #

log :: Measured n a -> Measured n a #

sqrt :: Measured n a -> Measured n a #

(**) :: Measured n a -> Measured n a -> Measured n a #

logBase :: Measured n a -> Measured n a -> Measured n a #

sin :: Measured n a -> Measured n a #

cos :: Measured n a -> Measured n a #

tan :: Measured n a -> Measured n a #

asin :: Measured n a -> Measured n a #

acos :: Measured n a -> Measured n a #

atan :: Measured n a -> Measured n a #

sinh :: Measured n a -> Measured n a #

cosh :: Measured n a -> Measured n a #

tanh :: Measured n a -> Measured n a #

asinh :: Measured n a -> Measured n a #

acosh :: Measured n a -> Measured n a #

atanh :: Measured n a -> Measured n a #

log1p :: Measured n a -> Measured n a #

expm1 :: Measured n a -> Measured n a #

log1pexp :: Measured n a -> Measured n a #

log1mexp :: Measured n a -> Measured n a #

Fractional a => Fractional (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

Methods

(/) :: Measured n a -> Measured n a -> Measured n a #

recip :: Measured n a -> Measured n a #

fromRational :: Rational -> Measured n a #

Num a => Num (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

Methods

(+) :: Measured n a -> Measured n a -> Measured n a #

(-) :: Measured n a -> Measured n a -> Measured n a #

(*) :: Measured n a -> Measured n a -> Measured n a #

negate :: Measured n a -> Measured n a #

abs :: Measured n a -> Measured n a #

signum :: Measured n a -> Measured n a #

fromInteger :: Integer -> Measured n a #

Semigroup a => Semigroup (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

Methods

(<>) :: Measured n a -> Measured n a -> Measured n a #

sconcat :: NonEmpty (Measured n a) -> Measured n a #

stimes :: Integral b => b -> Measured n a -> Measured n a #

Monoid a => Monoid (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

Methods

mempty :: Measured n a #

mappend :: Measured n a -> Measured n a -> Measured n a #

mconcat :: [Measured n a] -> Measured n a #

Juxtaposable a => Juxtaposable (Measured n a) 
Instance details

Defined in Diagrams.Core.Juxtapose

Methods

juxtapose :: Vn (Measured n a) -> Measured n a -> Measured n a -> Measured n a #

Qualifiable a => Qualifiable (Measured n a) 
Instance details

Defined in Diagrams.Core.Names

Methods

(.>>) :: IsName a0 => a0 -> Measured n a -> Measured n a #

HasStyle b => HasStyle (Measured n b) 
Instance details

Defined in Diagrams.Core.Style

Methods

applyStyle :: Style (V (Measured n b)) (N (Measured n b)) -> Measured n b -> Measured n b #

(InSpace v n t, Transformable t, HasLinearMap v, Floating n) => Transformable (Measured n t) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t #

HasOrigin t => HasOrigin (Measured n t) 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t #

MonadReader (n, n, n) (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

Methods

ask :: Measured n (n, n, n) #

local :: ((n, n, n) -> (n, n, n)) -> Measured n a -> Measured n a #

reader :: ((n, n, n) -> a) -> Measured n a #

type Rep (Measured n) 
Instance details

Defined in Diagrams.Core.Measure

type Rep (Measured n) = (n, n, n)
type V (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

type V (Measured n a) = V a
type N (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

type N (Measured n a) = N a

type Measure n = Measured n n #

A measure is a Measured number.

(*.) :: (Functor v, Num n) => n -> Point v n -> Point v n #

Scale a point by a scalar. Specialized version of '(*^)'.

type family V a :: Type -> Type #

Many sorts of objects have an associated vector space in which they "live". The type function V maps from object types to the associated vector space. The resulting vector space has kind * -> * which means it takes another value (a number) and returns a concrete vector. For example V2 has kind * -> * and V2 Double is a vector.

Instances
type V SVG 
Instance details

Defined in Diagrams.Backend.SVG

type V SVG = V2
type V [a] 
Instance details

Defined in Diagrams.Core.V

type V [a] = V a
type V (Set a) 
Instance details

Defined in Diagrams.Core.V

type V (Set a) = V a
type V (Active a) 
Instance details

Defined in Diagrams.Animation.Active

type V (Active a) = V a
type V (Option a) 
Instance details

Defined in Diagrams.Core.V

type V (Option a) = V a
type V (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

type V (TransInv t) = V t
type V (Text n) 
Instance details

Defined in Diagrams.TwoD.Text

type V (Text n) = V2
type V (LineTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (LineTexture n) = V2
type V (FillTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (FillTexture n) = V2
type V (Texture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (Texture n) = V2
type V (RGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (RGradient n) = V2
type V (LGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (LGradient n) = V2
type V (Clip n) 
Instance details

Defined in Diagrams.TwoD.Path

type V (Clip n) = V2
type V (GetSegment t) 
Instance details

Defined in Diagrams.Trail

type V (GetSegment t) = V t
type V (Tangent t) 
Instance details

Defined in Diagrams.Tangent

type V (Tangent t) = V t
type V (Located a) 
Instance details

Defined in Diagrams.Located

type V (Located a) = V a
type V (OrthoLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type V (OrthoLens n) = V3
type V (PerspectiveLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type V (PerspectiveLens n) = V3
type V (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (Ellipsoid n) = V3
type V (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (Box n) = V3
type V (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (Frustum n) = V3
type V (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (CSG n) = V3
type V (PointLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type V (PointLight n) = V3
type V (ParallelLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type V (ParallelLight n) = V3
type V (BernsteinPoly n) 
Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

type V (BernsteinPoly n) = V1
type V (V2 n) 
Instance details

Defined in Diagrams.TwoD.Types

type V (V2 n) = V2
type V (V3 n) 
Instance details

Defined in Diagrams.ThreeD.Types

type V (V3 n) = V3
type V (Split m) 
Instance details

Defined in Diagrams.Core.V

type V (Split m) = V m
type V (Deletable m) 
Instance details

Defined in Diagrams.Core.V

type V (Deletable m) = V m
type V (a -> b) 
Instance details

Defined in Diagrams.Core.V

type V (a -> b) = V b
type V (a, b) 
Instance details

Defined in Diagrams.Core.V

type V (a, b) = V a
type V (Map k a) 
Instance details

Defined in Diagrams.Core.V

type V (Map k a) = V a
type V (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

type V (Envelope v n) = v
type V (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

type V (Trace v n) = v
type V (Attribute v n) 
Instance details

Defined in Diagrams.Core.Style

type V (Attribute v n) = v
type V (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type V (Style v n) = v
type V (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

type V (Transformation v n) = v
type V (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

type V (Measured n a) = V a
type V (Point v n) 
Instance details

Defined in Diagrams.Core.Points

type V (Point v n) = v
type V (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

type V (SizeSpec v n) = v
type V (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

type V (BoundingBox v n) = v
type V (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

type V (DImage n a) = V2
type V (Path v n) 
Instance details

Defined in Diagrams.Path

type V (Path v n) = v
type V (SegTree v n) 
Instance details

Defined in Diagrams.Trail

type V (SegTree v n) = v
type V (Trail v n) 
Instance details

Defined in Diagrams.Trail

type V (Trail v n) = v
type V (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

type V (FixedSegment v n) = v
type V (Camera l n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type V (Camera l n) = V3
type V (Direction v n) 
Instance details

Defined in Diagrams.Direction

type V (Direction v n) = v
type V (FingerTree m a) 
Instance details

Defined in Diagrams.Trail

type V (FingerTree m a) = V a
type V (m :+: n) 
Instance details

Defined in Diagrams.Core.V

type V (m :+: n) = V m
type V (NonEmptyBoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

type V (NonEmptyBoundingBox v n) = v
type V (a, b, c) 
Instance details

Defined in Diagrams.Core.V

type V (a, b, c) = V a
type V (Prim b v n) 
Instance details

Defined in Diagrams.Core.Types

type V (Prim b v n) = v
type V (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

type V (Query v n m) = v
type V (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

type V (Trail' l v n) = v
type V (Offset c v n) 
Instance details

Defined in Diagrams.Segment

type V (Offset c v n) = v
type V (Segment c v n) 
Instance details

Defined in Diagrams.Segment

type V (Segment c v n) = v
type V (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type V (QDiagram b v n m) = v
type V (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type V (Subdiagram b v n m) = v
type V (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

type V (SubMap b v n m) = v

type family N a :: Type #

The numerical field for the object, the number type used for calculations.

Instances
type N SVG 
Instance details

Defined in Diagrams.Backend.SVG

type N SVG = Double
type N [a] 
Instance details

Defined in Diagrams.Core.V

type N [a] = N a
type N (Set a) 
Instance details

Defined in Diagrams.Core.V

type N (Set a) = N a
type N (Active a) 
Instance details

Defined in Diagrams.Animation.Active

type N (Active a) = N a
type N (Option a) 
Instance details

Defined in Diagrams.Core.V

type N (Option a) = N a
type N (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

type N (TransInv t) = N t
type N (Text n) 
Instance details

Defined in Diagrams.TwoD.Text

type N (Text n) = n
type N (LineTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (LineTexture n) = n
type N (FillTexture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (FillTexture n) = n
type N (Texture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (Texture n) = n
type N (RGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (RGradient n) = n
type N (LGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (LGradient n) = n
type N (Clip n) 
Instance details

Defined in Diagrams.TwoD.Path

type N (Clip n) = n
type N (GetSegment t) 
Instance details

Defined in Diagrams.Trail

type N (GetSegment t) = N t
type N (Tangent t) 
Instance details

Defined in Diagrams.Tangent

type N (Tangent t) = N t
type N (Located a) 
Instance details

Defined in Diagrams.Located

type N (Located a) = N a
type N (OrthoLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type N (OrthoLens n) = n
type N (PerspectiveLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type N (PerspectiveLens n) = n
type N (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (Ellipsoid n) = n
type N (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (Box n) = n
type N (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (Frustum n) = n
type N (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (CSG n) = n
type N (PointLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type N (PointLight n) = n
type N (ParallelLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type N (ParallelLight n) = n
type N (BernsteinPoly n) 
Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

type N (BernsteinPoly n) = n
type N (Angle n) 
Instance details

Defined in Diagrams.Angle

type N (Angle n) = n
type N (V2 n) 
Instance details

Defined in Diagrams.TwoD.Types

type N (V2 n) = n
type N (V3 n) 
Instance details

Defined in Diagrams.ThreeD.Types

type N (V3 n) = n
type N (Split m) 
Instance details

Defined in Diagrams.Core.V

type N (Split m) = N m
type N (Deletable m) 
Instance details

Defined in Diagrams.Core.V

type N (Deletable m) = N m
type N (a -> b) 
Instance details

Defined in Diagrams.Core.V

type N (a -> b) = N b
type N (a, b) 
Instance details

Defined in Diagrams.Core.V

type N (a, b) = N a
type N (Map k a) 
Instance details

Defined in Diagrams.Core.V

type N (Map k a) = N a
type N (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

type N (Envelope v n) = n
type N (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

type N (Trace v n) = n
type N (Attribute v n) 
Instance details

Defined in Diagrams.Core.Style

type N (Attribute v n) = n
type N (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type N (Style v n) = n
type N (Transformation v n) 
Instance details

Defined in Diagrams.Core.Transform

type N (Transformation v n) = n
type N (Measured n a) 
Instance details

Defined in Diagrams.Core.Measure

type N (Measured n a) = N a
type N (Point v n) 
Instance details

Defined in Diagrams.Core.Points

type N (Point v n) = n
type N (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

type N (SizeSpec v n) = n
type N (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

type N (BoundingBox v n) = n
type N (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

type N (DImage n a) = n
type N (Path v n) 
Instance details

Defined in Diagrams.Path

type N (Path v n) = n
type N (SegTree v n) 
Instance details

Defined in Diagrams.Trail

type N (SegTree v n) = n
type N (Trail v n) 
Instance details

Defined in Diagrams.Trail

type N (Trail v n) = n
type N (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

type N (FixedSegment v n) = n
type N (Camera l n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type N (Camera l n) = n
type N (Direction v n) 
Instance details

Defined in Diagrams.Direction

type N (Direction v n) = n
type N (FingerTree m a) 
Instance details

Defined in Diagrams.Trail

type N (FingerTree m a) = N a
type N (m :+: n) 
Instance details

Defined in Diagrams.Core.V

type N (m :+: n) = N m
type N (NonEmptyBoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

type N (NonEmptyBoundingBox v n) = n
type N (a, b, c) 
Instance details

Defined in Diagrams.Core.V

type N (a, b, c) = N a
type N (Prim b v n) 
Instance details

Defined in Diagrams.Core.Types

type N (Prim b v n) = n
type N (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

type N (Query v n m) = n
type N (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

type N (Trail' l v n) = n
type N (Offset c v n) 
Instance details

Defined in Diagrams.Segment

type N (Offset c v n) = n
type N (Segment c v n) 
Instance details

Defined in Diagrams.Segment

type N (Segment c v n) = n
type N (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type N (QDiagram b v n m) = n
type N (Subdiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

type N (Subdiagram b v n m) = n
type N (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

type N (SubMap b v n m) = n

type Vn a = V a (N a) #

Conveient type alias to retrieve the vector type associated with an object's vector space. This is usually used as Vn a ~ v n where v is the vector space and n is the numerical field.

type InSpace (v :: Type -> Type) n a = (V a ~ v, N a ~ n, Additive v, Num n) #

InSpace v n a means the type a belongs to the vector space v n, where v is Additive and n is a Num.

type SameSpace a b = (V a ~ V b, N a ~ N b) #

SameSpace a b means the types a and b belong to the same vector space v n.

type Monoid' = Monoid #

For base < 4.11, the Monoid' constraint is a synonym for things which are instances of both Semigroup and Monoid. For base version 4.11 and onwards, Monoid has Semigroup as a superclass already, so for backwards compatibility Monoid' is provided as a synonym for Monoid.

basis :: (Additive t, Traversable t, Num a) => [t a] #

Produce a default basis for a vector space. If the dimensionality of the vector space is not statically known, see basisFor.

newtype Point (f :: Type -> Type) a #

A handy wrapper to help distinguish points from vectors at the type level

Constructors

P (f a) 
Instances
Unbox (f a) => Vector Vector (Point f a) 
Instance details

Defined in Linear.Affine

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> m (Vector (Point f a)) #

basicUnsafeThaw :: PrimMonad m => Vector (Point f a) -> m (Mutable Vector (PrimState m) (Point f a)) #

basicLength :: Vector (Point f a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (Point f a) -> Vector (Point f a) #

basicUnsafeIndexM :: Monad m => Vector (Point f a) -> Int -> m (Point f a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> Vector (Point f a) -> m () #

elemseq :: Vector (Point f a) -> Point f a -> b -> b #

Unbox (f a) => MVector MVector (Point f a) 
Instance details

Defined in Linear.Affine

Methods

basicLength :: MVector s (Point f a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (Point f a) -> MVector s (Point f a) #

basicOverlaps :: MVector s (Point f a) -> MVector s (Point f a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Point f a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> Point f a -> m (MVector (PrimState m) (Point f a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (Point f a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> Point f a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (Point f a) -> Point f a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (MVector (PrimState m) (Point f a)) #

Monad f => Monad (Point f) 
Instance details

Defined in Linear.Affine

Methods

(>>=) :: Point f a -> (a -> Point f b) -> Point f b #

(>>) :: Point f a -> Point f b -> Point f b #

return :: a -> Point f a #

fail :: String -> Point f a #

Functor f => Functor (Point f) 
Instance details

Defined in Linear.Affine

Methods

fmap :: (a -> b) -> Point f a -> Point f b #

(<$) :: a -> Point f b -> Point f a #

Applicative f => Applicative (Point f) 
Instance details

Defined in Linear.Affine

Methods

pure :: a -> Point f a #

(<*>) :: Point f (a -> b) -> Point f a -> Point f b #

liftA2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c #

(*>) :: Point f a -> Point f b -> Point f b #

(<*) :: Point f a -> Point f b -> Point f a #

Foldable f => Foldable (Point f) 
Instance details

Defined in Linear.Affine

Methods

fold :: Monoid m => Point f m -> m #

foldMap :: Monoid m => (a -> m) -> Point f a -> m #

foldr :: (a -> b -> b) -> b -> Point f a -> b #

foldr' :: (a -> b -> b) -> b -> Point f a -> b #

foldl :: (b -> a -> b) -> b -> Point f a -> b #

foldl' :: (b -> a -> b) -> b -> Point f a -> b #

foldr1 :: (a -> a -> a) -> Point f a -> a #

foldl1 :: (a -> a -> a) -> Point f a -> a #

toList :: Point f a -> [a] #

null :: Point f a -> Bool #

length :: Point f a -> Int #

elem :: Eq a => a -> Point f a -> Bool #

maximum :: Ord a => Point f a -> a #

minimum :: Ord a => Point f a -> a #

sum :: Num a => Point f a -> a #

product :: Num a => Point f a -> a #

Traversable f => Traversable (Point f) 
Instance details

Defined in Linear.Affine

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Point f a -> f0 (Point f b) #

sequenceA :: Applicative f0 => Point f (f0 a) -> f0 (Point f a) #

mapM :: Monad m => (a -> m b) -> Point f a -> m (Point f b) #

sequence :: Monad m => Point f (m a) -> m (Point f a) #

Apply f => Apply (Point f) 
Instance details

Defined in Linear.Affine

Methods

(<.>) :: Point f (a -> b) -> Point f a -> Point f b #

(.>) :: Point f a -> Point f b -> Point f b #

(<.) :: Point f a -> Point f b -> Point f a #

liftF2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c #

Distributive f => Distributive (Point f) 
Instance details

Defined in Linear.Affine

Methods

distribute :: Functor f0 => f0 (Point f a) -> Point f (f0 a) #

collect :: Functor f0 => (a -> Point f b) -> f0 a -> Point f (f0 b) #

distributeM :: Monad m => m (Point f a) -> Point f (m a) #

collectM :: Monad m => (a -> Point f b) -> m a -> Point f (m b) #

Representable f => Representable (Point f) 
Instance details

Defined in Linear.Affine

Associated Types

type Rep (Point f) :: Type #

Methods

tabulate :: (Rep (Point f) -> a) -> Point f a #

index :: Point f a -> Rep (Point f) -> a #

Eq1 f => Eq1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

liftEq :: (a -> b -> Bool) -> Point f a -> Point f b -> Bool #

Ord1 f => Ord1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

liftCompare :: (a -> b -> Ordering) -> Point f a -> Point f b -> Ordering #

Read1 f => Read1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Point f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Point f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Point f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Point f a] #

Show1 f => Show1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Point f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Point f a] -> ShowS #

Serial1 f => Serial1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

serializeWith :: MonadPut m => (a -> m ()) -> Point f a -> m () #

deserializeWith :: MonadGet m => m a -> m (Point f a) #

Additive f => Additive (Point f) 
Instance details

Defined in Linear.Affine

Methods

zero :: Num a => Point f a #

(^+^) :: Num a => Point f a -> Point f a -> Point f a #

(^-^) :: Num a => Point f a -> Point f a -> Point f a #

lerp :: Num a => a -> Point f a -> Point f a -> Point f a #

liftU2 :: (a -> a -> a) -> Point f a -> Point f a -> Point f a #

liftI2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c #

Metric f => Metric (Point f) 
Instance details

Defined in Linear.Affine

Methods

dot :: Num a => Point f a -> Point f a -> a #

quadrance :: Num a => Point f a -> a #

qd :: Num a => Point f a -> Point f a -> a #

distance :: Floating a => Point f a -> Point f a -> a #

norm :: Floating a => Point f a -> a #

signorm :: Floating a => Point f a -> Point f a #

Additive f => Affine (Point f) 
Instance details

Defined in Linear.Affine

Associated Types

type Diff (Point f) :: Type -> Type #

Methods

(.-.) :: Num a => Point f a -> Point f a -> Diff (Point f) a #

(.+^) :: Num a => Point f a -> Diff (Point f) a -> Point f a #

(.-^) :: Num a => Point f a -> Diff (Point f) a -> Point f a #

(Metric v, OrderedField n) => TrailLike [Point v n]

A list of points is trail-like; this instance simply computes the vertices of the trail, using trailPoints.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V [Point v n]) (N [Point v n])) -> [Point v n] #

HasR v => HasR (Point v) 
Instance details

Defined in Diagrams.TwoD.Types

Methods

_r :: RealFloat n => Lens' (Point v n) n #

HasTheta v => HasTheta (Point v) 
Instance details

Defined in Diagrams.Angle

Methods

_theta :: RealFloat n => Lens' (Point v n) (Angle n) #

HasPhi v => HasPhi (Point v) 
Instance details

Defined in Diagrams.Angle

Methods

_phi :: RealFloat n => Lens' (Point v n) (Angle n) #

R1 f => R1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

_x :: Lens' (Point f a) a #

R2 f => R2 (Point f) 
Instance details

Defined in Linear.Affine

Methods

_y :: Lens' (Point f a) a #

_xy :: Lens' (Point f a) (V2 a) #

R3 f => R3 (Point f) 
Instance details

Defined in Linear.Affine

Methods

_z :: Lens' (Point f a) a #

_xyz :: Lens' (Point f a) (V3 a) #

Hashable1 f => Hashable1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Point f a -> Int #

R4 f => R4 (Point f) 
Instance details

Defined in Linear.Affine

Methods

_w :: Lens' (Point f a) a #

_xyzw :: Lens' (Point f a) (V4 a) #

Finite f => Finite (Point f) 
Instance details

Defined in Linear.Affine

Associated Types

type Size (Point f) :: Nat #

Methods

toV :: Point f a -> V (Size (Point f)) a #

fromV :: V (Size (Point f)) a -> Point f a #

Bind f => Bind (Point f) 
Instance details

Defined in Linear.Affine

Methods

(>>-) :: Point f a -> (a -> Point f b) -> Point f b #

join :: Point f (Point f a) -> Point f a #

Generic1 (Point f :: Type -> Type) 
Instance details

Defined in Linear.Affine

Associated Types

type Rep1 (Point f) :: k -> Type #

Methods

from1 :: Point f a -> Rep1 (Point f) a #

to1 :: Rep1 (Point f) a -> Point f a #

Functor v => Cosieve (Query v) (Point v) 
Instance details

Defined in Diagrams.Core.Query

Methods

cosieve :: Query v a b -> Point v a -> b #

Eq (f a) => Eq (Point f a) 
Instance details

Defined in Linear.Affine

Methods

(==) :: Point f a -> Point f a -> Bool #

(/=) :: Point f a -> Point f a -> Bool #

Fractional (f a) => Fractional (Point f a) 
Instance details

Defined in Linear.Affine

Methods

(/) :: Point f a -> Point f a -> Point f a #

recip :: Point f a -> Point f a #

fromRational :: Rational -> Point f a #

(Typeable f, Typeable a, Data (f a)) => Data (Point f a) 
Instance details

Defined in Linear.Affine

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Point f a -> c (Point f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Point f a) #

toConstr :: Point f a -> Constr #

dataTypeOf :: Point f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Point f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Point f a)) #

gmapT :: (forall b. Data b => b -> b) -> Point f a -> Point f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Point f a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Point f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Point f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Point f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) #

Num (f a) => Num (Point f a) 
Instance details

Defined in Linear.Affine

Methods

(+) :: Point f a -> Point f a -> Point f a #

(-) :: Point f a -> Point f a -> Point f a #

(*) :: Point f a -> Point f a -> Point f a #

negate :: Point f a -> Point f a #

abs :: Point f a -> Point f a #

signum :: Point f a -> Point f a #

fromInteger :: Integer -> Point f a #

Ord (f a) => Ord (Point f a) 
Instance details

Defined in Linear.Affine

Methods

compare :: Point f a -> Point f a -> Ordering #

(<) :: Point f a -> Point f a -> Bool #

(<=) :: Point f a -> Point f a -> Bool #

(>) :: Point f a -> Point f a -> Bool #

(>=) :: Point f a -> Point f a -> Bool #

max :: Point f a -> Point f a -> Point f a #

min :: Point f a -> Point f a -> Point f a #

Read (f a) => Read (Point f a) 
Instance details

Defined in Linear.Affine

Show (f a) => Show (Point f a) 
Instance details

Defined in Linear.Affine

Methods

showsPrec :: Int -> Point f a -> ShowS #

show :: Point f a -> String #

showList :: [Point f a] -> ShowS #

Ix (f a) => Ix (Point f a) 
Instance details

Defined in Linear.Affine

Methods

range :: (Point f a, Point f a) -> [Point f a] #

index :: (Point f a, Point f a) -> Point f a -> Int #

unsafeIndex :: (Point f a, Point f a) -> Point f a -> Int

inRange :: (Point f a, Point f a) -> Point f a -> Bool #

rangeSize :: (Point f a, Point f a) -> Int #

unsafeRangeSize :: (Point f a, Point f a) -> Int

Generic (Point f a) 
Instance details

Defined in Linear.Affine

Associated Types

type Rep (Point f a) :: Type -> Type #

Methods

from :: Point f a -> Rep (Point f a) x #

to :: Rep (Point f a) x -> Point f a #

Hashable (f a) => Hashable (Point f a) 
Instance details

Defined in Linear.Affine

Methods

hashWithSalt :: Int -> Point f a -> Int #

hash :: Point f a -> Int #

Storable (f a) => Storable (Point f a) 
Instance details

Defined in Linear.Affine

Methods

sizeOf :: Point f a -> Int #

alignment :: Point f a -> Int #

peekElemOff :: Ptr (Point f a) -> Int -> IO (Point f a) #

pokeElemOff :: Ptr (Point f a) -> Int -> Point f a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Point f a) #

pokeByteOff :: Ptr b -> Int -> Point f a -> IO () #

peek :: Ptr (Point f a) -> IO (Point f a) #

poke :: Ptr (Point f a) -> Point f a -> IO () #

Binary (f a) => Binary (Point f a) 
Instance details

Defined in Linear.Affine

Methods

put :: Point f a -> Put #

get :: Get (Point f a) #

putList :: [Point f a] -> Put #

Serial (f a) => Serial (Point f a) 
Instance details

Defined in Linear.Affine

Methods

serialize :: MonadPut m => Point f a -> m () #

deserialize :: MonadGet m => m (Point f a) #

Serialize (f a) => Serialize (Point f a) 
Instance details

Defined in Linear.Affine

Methods

put :: Putter (Point f a) #

get :: Get (Point f a) #

NFData (f a) => NFData (Point f a) 
Instance details

Defined in Linear.Affine

Methods

rnf :: Point f a -> () #

(OrderedField n, Metric v) => Enveloped (Point v n) 
Instance details

Defined in Diagrams.Core.Envelope

Methods

getEnvelope :: Point v n -> Envelope (V (Point v n)) (N (Point v n)) #

(Additive v, Ord n) => Traced (Point v n)

The trace of a single point is the empty trace, i.e. the one which returns no intersection points for every query. Arguably it should return a single finite distance for vectors aimed directly at the given point, but due to floating-point inaccuracy this is problematic. Note that the envelope for a single point is not the empty envelope (see Diagrams.Core.Envelope).

Instance details

Defined in Diagrams.Core.Trace

Methods

getTrace :: Point v n -> Trace (V (Point v n)) (N (Point v n)) #

(Additive v, Num n) => Transformable (Point v n) 
Instance details

Defined in Diagrams.Core.Transform

Methods

transform :: Transformation (V (Point v n)) (N (Point v n)) -> Point v n -> Point v n #

(Additive v, Num n) => HasOrigin (Point v n) 
Instance details

Defined in Diagrams.Core.HasOrigin

Methods

moveOriginTo :: Point (V (Point v n)) (N (Point v n)) -> Point v n -> Point v n #

Coordinates (v n) => Coordinates (Point v n) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (Point v n) :: Type #

type PrevDim (Point v n) :: Type #

type Decomposition (Point v n) :: Type #

Methods

(^&) :: PrevDim (Point v n) -> FinalCoord (Point v n) -> Point v n #

pr :: PrevDim (Point v n) -> FinalCoord (Point v n) -> Point v n #

coords :: Point v n -> Decomposition (Point v n) #

Wrapped (Point f a) 
Instance details

Defined in Linear.Affine

Associated Types

type Unwrapped (Point f a) :: Type #

Methods

_Wrapped' :: Iso' (Point f a) (Unwrapped (Point f a)) #

Ixed (f a) => Ixed (Point f a) 
Instance details

Defined in Linear.Affine

Methods

ix :: Index (Point f a) -> Traversal' (Point f a) (IxValue (Point f a)) #

Unbox (f a) => Unbox (Point f a) 
Instance details

Defined in Linear.Affine

Epsilon (f a) => Epsilon (Point f a) 
Instance details

Defined in Linear.Affine

Methods

nearZero :: Point f a -> Bool #

r ~ Point u n => Deformable (Point v n) r 
Instance details

Defined in Diagrams.Deform

Methods

deform' :: N (Point v n) -> Deformation (V (Point v n)) (V r) (N (Point v n)) -> Point v n -> r #

deform :: Deformation (V (Point v n)) (V r) (N (Point v n)) -> Point v n -> r #

t ~ Point g b => Rewrapped (Point f a) t 
Instance details

Defined in Linear.Affine

Traversable f => Each (Point f a) (Point f b) a b 
Instance details

Defined in Linear.Affine

Methods

each :: Traversal (Point f a) (Point f b) a b #

(Additive v', Foldable v', Ord n') => Each (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n')

Only valid if the second point is not smaller than the first.

Instance details

Defined in Diagrams.BoundingBox

Methods

each :: Traversal (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n') #

Each (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') 
Instance details

Defined in Diagrams.Segment

Methods

each :: Traversal (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') #

newtype MVector s (Point f a) 
Instance details

Defined in Linear.Affine

newtype MVector s (Point f a) = MV_P (MVector s (f a))
type Rep (Point f) 
Instance details

Defined in Linear.Affine

type Rep (Point f) = Rep f
type Diff (Point f) 
Instance details

Defined in Linear.Affine

type Diff (Point f) = f
type Size (Point f) 
Instance details

Defined in Linear.Affine

type Size (Point f) = Size f
type Rep1 (Point f :: Type -> Type) 
Instance details

Defined in Linear.Affine

type Rep1 (Point f :: Type -> Type) = D1 (MetaData "Point" "Linear.Affine" "linear-1.20.9-27UQiD0kWRO59L1Ww4Df0c" True) (C1 (MetaCons "P" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 f)))
type Rep (Point f a) 
Instance details

Defined in Linear.Affine

type Rep (Point f a) = D1 (MetaData "Point" "Linear.Affine" "linear-1.20.9-27UQiD0kWRO59L1Ww4Df0c" True) (C1 (MetaCons "P" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a))))
type V (Point v n) 
Instance details

Defined in Diagrams.Core.Points

type V (Point v n) = v
type N (Point v n) 
Instance details

Defined in Diagrams.Core.Points

type N (Point v n) = n
newtype Vector (Point f a) 
Instance details

Defined in Linear.Affine

newtype Vector (Point f a) = V_P (Vector (f a))
type Decomposition (Point v n) 
Instance details

Defined in Diagrams.Coordinates

type Decomposition (Point v n) = Decomposition (v n)
type PrevDim (Point v n) 
Instance details

Defined in Diagrams.Coordinates

type PrevDim (Point v n) = PrevDim (v n)
type FinalCoord (Point v n) 
Instance details

Defined in Diagrams.Coordinates

type FinalCoord (Point v n) = FinalCoord (v n)
type Unwrapped (Point f a) 
Instance details

Defined in Linear.Affine

type Unwrapped (Point f a) = f a
type IxValue (Point f a) 
Instance details

Defined in Linear.Affine

type IxValue (Point f a) = IxValue (f a)
type Index (Point f a) 
Instance details

Defined in Linear.Affine

type Index (Point f a) = Index (f a)

_Point :: Iso' (Point f a) (f a) #

origin :: (Additive f, Num a) => Point f a #

Vector spaces have origins.

relative :: (Additive f, Num a) => Point f a -> Iso' (Point f a) (f a) #

An isomorphism between points and vectors, given a reference point.

newtype E (t :: Type -> Type) #

Basis element

Constructors

E 

Fields

Instances
TraversableWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

itraverse :: Applicative f => (E V2 -> a -> f b) -> V2 a -> f (V2 b) #

itraversed :: IndexedTraversal (E V2) (V2 a) (V2 b) a b #

TraversableWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

itraverse :: Applicative f => (E V3 -> a -> f b) -> V3 a -> f (V3 b) #

itraversed :: IndexedTraversal (E V3) (V3 a) (V3 b) a b #

TraversableWithIndex (E Plucker) Plucker 
Instance details

Defined in Linear.Plucker

Methods

itraverse :: Applicative f => (E Plucker -> a -> f b) -> Plucker a -> f (Plucker b) #

itraversed :: IndexedTraversal (E Plucker) (Plucker a) (Plucker b) a b #

TraversableWithIndex (E Quaternion) Quaternion 
Instance details

Defined in Linear.Quaternion

TraversableWithIndex (E V0) V0 
Instance details

Defined in Linear.V0

Methods

itraverse :: Applicative f => (E V0 -> a -> f b) -> V0 a -> f (V0 b) #

itraversed :: IndexedTraversal (E V0) (V0 a) (V0 b) a b #

TraversableWithIndex (E V4) V4 
Instance details

Defined in Linear.V4

Methods

itraverse :: Applicative f => (E V4 -> a -> f b) -> V4 a -> f (V4 b) #

itraversed :: IndexedTraversal (E V4) (V4 a) (V4 b) a b #

TraversableWithIndex (E V1) V1 
Instance details

Defined in Linear.V1

Methods

itraverse :: Applicative f => (E V1 -> a -> f b) -> V1 a -> f (V1 b) #

itraversed :: IndexedTraversal (E V1) (V1 a) (V1 b) a b #

FoldableWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

ifoldMap :: Monoid m => (E V2 -> a -> m) -> V2 a -> m #

ifolded :: IndexedFold (E V2) (V2 a) a #

ifoldr :: (E V2 -> a -> b -> b) -> b -> V2 a -> b #

ifoldl :: (E V2 -> b -> a -> b) -> b -> V2 a -> b #

ifoldr' :: (E V2 -> a -> b -> b) -> b -> V2 a -> b #

ifoldl' :: (E V2 -> b -> a -> b) -> b -> V2 a -> b #

FoldableWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

ifoldMap :: Monoid m => (E V3 -> a -> m) -> V3 a -> m #

ifolded :: IndexedFold (E V3) (V3 a) a #

ifoldr :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #

ifoldl :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #

ifoldr' :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #

ifoldl' :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #

FoldableWithIndex (E Plucker) Plucker 
Instance details

Defined in Linear.Plucker

Methods

ifoldMap :: Monoid m => (E Plucker -> a -> m) -> Plucker a -> m #

ifolded :: IndexedFold (E Plucker) (Plucker a) a #

ifoldr :: (E Plucker -> a -> b -> b) -> b -> Plucker a -> b #

ifoldl :: (E Plucker -> b -> a -> b) -> b -> Plucker a -> b #

ifoldr' :: (E Plucker -> a -> b -> b) -> b -> Plucker a -> b #

ifoldl' :: (E Plucker -> b -> a -> b) -> b -> Plucker a -> b #

FoldableWithIndex (E Quaternion) Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

ifoldMap :: Monoid m => (E Quaternion -> a -> m) -> Quaternion a -> m #

ifolded :: IndexedFold (E Quaternion) (Quaternion a) a #

ifoldr :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b #

ifoldl :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b #

ifoldr' :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b #

ifoldl' :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b #

FoldableWithIndex (E V0) V0 
Instance details

Defined in Linear.V0

Methods

ifoldMap :: Monoid m => (E V0 -> a -> m) -> V0 a -> m #

ifolded :: IndexedFold (E V0) (V0 a) a #

ifoldr :: (E V0 -> a -> b -> b) -> b -> V0 a -> b #

ifoldl :: (E V0 -> b -> a -> b) -> b -> V0 a -> b #

ifoldr' :: (E V0 -> a -> b -> b) -> b -> V0 a -> b #

ifoldl' :: (E V0 -> b -> a -> b) -> b -> V0 a -> b #

FoldableWithIndex (E V4) V4 
Instance details

Defined in Linear.V4

Methods

ifoldMap :: Monoid m => (E V4 -> a -> m) -> V4 a -> m #

ifolded :: IndexedFold (E V4) (V4 a) a #

ifoldr :: (E V4 -> a -> b -> b) -> b -> V4 a -> b #

ifoldl :: (E V4 -> b -> a -> b) -> b -> V4 a -> b #

ifoldr' :: (E V4 -> a -> b -> b) -> b -> V4 a -> b #

ifoldl' :: (E V4 -> b -> a -> b) -> b -> V4 a -> b #

FoldableWithIndex (E V1) V1 
Instance details

Defined in Linear.V1

Methods

ifoldMap :: Monoid m => (E V1 -> a -> m) -> V1 a -> m #

ifolded :: IndexedFold (E V1) (V1 a) a #

ifoldr :: (E V1 -> a -> b -> b) -> b -> V1 a -> b #

ifoldl :: (E V1 -> b -> a -> b) -> b -> V1 a -> b #

ifoldr' :: (E V1 -> a -> b -> b) -> b -> V1 a -> b #

ifoldl' :: (E V1 -> b -> a -> b) -> b -> V1 a -> b #

FunctorWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

imap :: (E V2 -> a -> b) -> V2 a -> V2 b #

imapped :: IndexedSetter (E V2) (V2 a) (V2 b) a b #

FunctorWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

imap :: (E V3 -> a -> b) -> V3 a -> V3 b #

imapped :: IndexedSetter (E V3) (V3 a) (V3 b) a b #

FunctorWithIndex (E Plucker) Plucker 
Instance details

Defined in Linear.Plucker

Methods

imap :: (E Plucker -> a -> b) -> Plucker a -> Plucker b #

imapped :: IndexedSetter (E Plucker) (Plucker a) (Plucker b) a b #

FunctorWithIndex (E Quaternion) Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

imap :: (E Quaternion -> a -> b) -> Quaternion a -> Quaternion b #

imapped :: IndexedSetter (E Quaternion) (Quaternion a) (Quaternion b) a b #

FunctorWithIndex (E V0) V0 
Instance details

Defined in Linear.V0

Methods

imap :: (E V0 -> a -> b) -> V0 a -> V0 b #

imapped :: IndexedSetter (E V0) (V0 a) (V0 b) a b #

FunctorWithIndex (E V4) V4 
Instance details

Defined in Linear.V4

Methods

imap :: (E V4 -> a -> b) -> V4 a -> V4 b #

imapped :: IndexedSetter (E V4) (V4 a) (V4 b) a b #

FunctorWithIndex (E V1) V1 
Instance details

Defined in Linear.V1

Methods

imap :: (E V1 -> a -> b) -> V1 a -> V1 b #

imapped :: IndexedSetter (E V1) (V1 a) (V1 b) a b #

negated :: (Functor f, Num a) => f a -> f a #

Compute the negation of a vector

>>> negated (V2 2 4)
V2 (-2) (-4)

sumV :: (Foldable f, Additive v, Num a) => f (v a) -> v a #

Sum over multiple vectors

>>> sumV [V2 1 1, V2 3 4]
V2 4 5

(*^) :: (Functor f, Num a) => a -> f a -> f a infixl 7 #

Compute the left scalar product

>>> 2 *^ V2 3 4
V2 6 8

(^*) :: (Functor f, Num a) => f a -> a -> f a infixl 7 #

Compute the right scalar product

>>> V2 3 4 ^* 2
V2 6 8

(^/) :: (Functor f, Fractional a) => f a -> a -> f a infixl 7 #

Compute division by a scalar on the right.

basisFor :: (Traversable t, Num a) => t b -> [t a] #

Produce a default basis for a vector space from which the argument is drawn.

scaled :: (Traversable t, Num a) => t a -> t (t a) #

Produce a diagonal (scale) matrix from a vector.

>>> scaled (V2 2 3)
V2 (V2 2 0) (V2 0 3)

unit :: (Additive t, Num a) => ASetter' (t a) a -> t a #

Create a unit vector.

>>> unit _x :: V2 Int
V2 1 0

outer :: (Functor f, Functor g, Num a) => f a -> g a -> f (g a) #

Outer (tensor) product of two vectors

class Additive f => Metric (f :: Type -> Type) where #

Free and sparse inner product/metric spaces.

Minimal complete definition

Nothing

Methods

dot :: Num a => f a -> f a -> a #

Compute the inner product of two vectors or (equivalently) convert a vector f a into a covector f a -> a.

>>> V2 1 2 `dot` V2 3 4
11

quadrance :: Num a => f a -> a #

Compute the squared norm. The name quadrance arises from Norman J. Wildberger's rational trigonometry.

qd :: Num a => f a -> f a -> a #

Compute the quadrance of the difference

distance :: Floating a => f a -> f a -> a #

Compute the distance between two vectors in a metric space

norm :: Floating a => f a -> a #

Compute the norm of a vector in a metric space

signorm :: Floating a => f a -> f a #

Convert a non-zero vector to unit vector.

Instances
Metric [] 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => [a] -> [a] -> a #

quadrance :: Num a => [a] -> a #

qd :: Num a => [a] -> [a] -> a #

distance :: Floating a => [a] -> [a] -> a #

norm :: Floating a => [a] -> a #

signorm :: Floating a => [a] -> [a] #

Metric Maybe 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => Maybe a -> Maybe a -> a #

quadrance :: Num a => Maybe a -> a #

qd :: Num a => Maybe a -> Maybe a -> a #

distance :: Floating a => Maybe a -> Maybe a -> a #

norm :: Floating a => Maybe a -> a #

signorm :: Floating a => Maybe a -> Maybe a #

Metric Identity 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => Identity a -> Identity a -> a #

quadrance :: Num a => Identity a -> a #

qd :: Num a => Identity a -> Identity a -> a #

distance :: Floating a => Identity a -> Identity a -> a #

norm :: Floating a => Identity a -> a #

signorm :: Floating a => Identity a -> Identity a #

Metric ZipList 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => ZipList a -> ZipList a -> a #

quadrance :: Num a => ZipList a -> a #

qd :: Num a => ZipList a -> ZipList a -> a #

distance :: Floating a => ZipList a -> ZipList a -> a #

norm :: Floating a => ZipList a -> a #

signorm :: Floating a => ZipList a -> ZipList a #

Metric Vector 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => Vector a -> Vector a -> a #

quadrance :: Num a => Vector a -> a #

qd :: Num a => Vector a -> Vector a -> a #

distance :: Floating a => Vector a -> Vector a -> a #

norm :: Floating a => Vector a -> a #

signorm :: Floating a => Vector a -> Vector a #

Metric IntMap 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => IntMap a -> IntMap a -> a #

quadrance :: Num a => IntMap a -> a #

qd :: Num a => IntMap a -> IntMap a -> a #

distance :: Floating a => IntMap a -> IntMap a -> a #

norm :: Floating a => IntMap a -> a #

signorm :: Floating a => IntMap a -> IntMap a #

Metric V2 
Instance details

Defined in Linear.V2

Methods

dot :: Num a => V2 a -> V2 a -> a #

quadrance :: Num a => V2 a -> a #

qd :: Num a => V2 a -> V2 a -> a #

distance :: Floating a => V2 a -> V2 a -> a #

norm :: Floating a => V2 a -> a #

signorm :: Floating a => V2 a -> V2 a #

Metric V3 
Instance details

Defined in Linear.V3

Methods

dot :: Num a => V3 a -> V3 a -> a #

quadrance :: Num a => V3 a -> a #

qd :: Num a => V3 a -> V3 a -> a #

distance :: Floating a => V3 a -> V3 a -> a #

norm :: Floating a => V3 a -> a #

signorm :: Floating a => V3 a -> V3 a #

Metric Plucker 
Instance details

Defined in Linear.Plucker

Methods

dot :: Num a => Plucker a -> Plucker a -> a #

quadrance :: Num a => Plucker a -> a #

qd :: Num a => Plucker a -> Plucker a -> a #

distance :: Floating a => Plucker a -> Plucker a -> a #

norm :: Floating a => Plucker a -> a #

signorm :: Floating a => Plucker a -> Plucker a #

Metric Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

dot :: Num a => Quaternion a -> Quaternion a -> a #

quadrance :: Num a => Quaternion a -> a #

qd :: Num a => Quaternion a -> Quaternion a -> a #

distance :: Floating a => Quaternion a -> Quaternion a -> a #

norm :: Floating a => Quaternion a -> a #

signorm :: Floating a => Quaternion a -> Quaternion a #

Metric V0 
Instance details

Defined in Linear.V0

Methods

dot :: Num a => V0 a -> V0 a -> a #

quadrance :: Num a => V0 a -> a #

qd :: Num a => V0 a -> V0 a -> a #

distance :: Floating a => V0 a -> V0 a -> a #

norm :: Floating a => V0 a -> a #

signorm :: Floating a => V0 a -> V0 a #

Metric V4 
Instance details

Defined in Linear.V4

Methods

dot :: Num a => V4 a -> V4 a -> a #

quadrance :: Num a => V4 a -> a #

qd :: Num a => V4 a -> V4 a -> a #

distance :: Floating a => V4 a -> V4 a -> a #

norm :: Floating a => V4 a -> a #

signorm :: Floating a => V4 a -> V4 a #

Metric V1 
Instance details

Defined in Linear.V1

Methods

dot :: Num a => V1 a -> V1 a -> a #

quadrance :: Num a => V1 a -> a #

qd :: Num a => V1 a -> V1 a -> a #

distance :: Floating a => V1 a -> V1 a -> a #

norm :: Floating a => V1 a -> a #

signorm :: Floating a => V1 a -> V1 a #

Ord k => Metric (Map k) 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => Map k a -> Map k a -> a #

quadrance :: Num a => Map k a -> a #

qd :: Num a => Map k a -> Map k a -> a #

distance :: Floating a => Map k a -> Map k a -> a #

norm :: Floating a => Map k a -> a #

signorm :: Floating a => Map k a -> Map k a #

(Hashable k, Eq k) => Metric (HashMap k) 
Instance details

Defined in Linear.Metric

Methods

dot :: Num a => HashMap k a -> HashMap k a -> a #

quadrance :: Num a => HashMap k a -> a #

qd :: Num a => HashMap k a -> HashMap k a -> a #

distance :: Floating a => HashMap k a -> HashMap k a -> a #

norm :: Floating a => HashMap k a -> a #

signorm :: Floating a => HashMap k a -> HashMap k a #

Metric f => Metric (Point f) 
Instance details

Defined in Linear.Affine

Methods

dot :: Num a => Point f a -> Point f a -> a #

quadrance :: Num a => Point f a -> a #

qd :: Num a => Point f a -> Point f a -> a #

distance :: Floating a => Point f a -> Point f a -> a #

norm :: Floating a => Point f a -> a #

signorm :: Floating a => Point f a -> Point f a #

Dim n => Metric (V n) 
Instance details

Defined in Linear.V

Methods

dot :: Num a => V n a -> V n a -> a #

quadrance :: Num a => V n a -> a #

qd :: Num a => V n a -> V n a -> a #

distance :: Floating a => V n a -> V n a -> a #

norm :: Floating a => V n a -> a #

signorm :: Floating a => V n a -> V n a #

normalize :: (Floating a, Metric f, Epsilon a) => f a -> f a #

Normalize a Metric functor to have unit norm. This function does not change the functor if its norm is 0 or 1.

class Additive (Diff p) => Affine (p :: Type -> Type) where #

An affine space is roughly a vector space in which we have forgotten or at least pretend to have forgotten the origin.

a .+^ (b .-. a)  =  b@
(a .+^ u) .+^ v  =  a .+^ (u ^+^ v)@
(a .-. b) ^+^ v  =  (a .+^ v) .-. q@

Minimal complete definition

(.-.), (.+^)

Associated Types

type Diff (p :: Type -> Type) :: Type -> Type #

Methods

(.-.) :: Num a => p a -> p a -> Diff p a infixl 6 #

Get the difference between two points as a vector offset.

(.+^) :: Num a => p a -> Diff p a -> p a infixl 6 #

Add a vector offset to a point.

(.-^) :: Num a => p a -> Diff p a -> p a infixl 6 #

Subtract a vector offset from a point.

Instances
Affine [] 
Instance details

Defined in Linear.Affine

Associated Types

type Diff [] :: Type -> Type #

Methods

(.-.) :: Num a => [a] -> [a] -> Diff [] a #

(.+^) :: Num a => [a] -> Diff [] a -> [a] #

(.-^) :: Num a => [a] -> Diff [] a -> [a] #

Affine Maybe 
Instance details

Defined in Linear.Affine

Associated Types

type Diff Maybe :: Type -> Type #

Methods

(.-.) :: Num a => Maybe a -> Maybe a -> Diff Maybe a #

(.+^) :: Num a => Maybe a -> Diff Maybe a -> Maybe a #

(.-^) :: Num a => Maybe a -> Diff Maybe a -> Maybe a #

Affine Identity 
Instance details

Defined in Linear.Affine

Associated Types

type Diff Identity :: Type -> Type #

Methods

(.-.) :: Num a => Identity a -> Identity a -> Diff Identity a #

(.+^) :: Num a => Identity a -> Diff Identity a -> Identity a #

(.-^) :: Num a => Identity a -> Diff Identity a -> Identity a #

Affine ZipList 
Instance details

Defined in Linear.Affine

Associated Types

type Diff ZipList :: Type -> Type #

Methods

(.-.) :: Num a => ZipList a -> ZipList a -> Diff ZipList a #

(.+^) :: Num a => ZipList a -> Diff ZipList a -> ZipList a #

(.-^) :: Num a => ZipList a -> Diff ZipList a -> ZipList a #

Affine Time 
Instance details

Defined in Data.Active

Associated Types

type Diff Time :: Type -> Type #

Methods

(.-.) :: Num a => Time a -> Time a -> Diff Time a #

(.+^) :: Num a => Time a -> Diff Time a -> Time a #

(.-^) :: Num a => Time a -> Diff Time a -> Time a #

Affine Complex 
Instance details

Defined in Linear.Affine

Associated Types

type Diff Complex :: Type -> Type #

Methods

(.-.) :: Num a => Complex a -> Complex a -> Diff Complex a #

(.+^) :: Num a => Complex a -> Diff Complex a -> Complex a #

(.-^) :: Num a => Complex a -> Diff Complex a -> Complex a #

Affine Vector 
Instance details

Defined in Linear.Affine

Associated Types

type Diff Vector :: Type -> Type #

Methods

(.-.) :: Num a => Vector a -> Vector a -> Diff Vector a #

(.+^) :: Num a => Vector a -> Diff Vector a -> Vector a #

(.-^) :: Num a => Vector a -> Diff Vector a -> Vector a #

Affine IntMap 
Instance details

Defined in Linear.Affine

Associated Types

type Diff IntMap :: Type -> Type #

Methods

(.-.) :: Num a => IntMap a -> IntMap a -> Diff IntMap a #

(.+^) :: Num a => IntMap a -> Diff IntMap a -> IntMap a #

(.-^) :: Num a => IntMap a -> Diff IntMap a -> IntMap a #

Affine V2 
Instance details

Defined in Linear.Affine

Associated Types

type Diff V2 :: Type -> Type #

Methods

(.-.) :: Num a => V2 a -> V2 a -> Diff V2 a #

(.+^) :: Num a => V2 a -> Diff V2 a -> V2 a #

(.-^) :: Num a => V2 a -> Diff V2 a -> V2 a #

Affine V3 
Instance details

Defined in Linear.Affine

Associated Types

type Diff V3 :: Type -> Type #

Methods

(.-.) :: Num a => V3 a -> V3 a -> Diff V3 a #

(.+^) :: Num a => V3 a -> Diff V3 a -> V3 a #

(.-^) :: Num a => V3 a -> Diff V3 a -> V3 a #

Affine Plucker 
Instance details

Defined in Linear.Affine

Associated Types

type Diff Plucker :: Type -> Type #

Methods

(.-.) :: Num a => Plucker a -> Plucker a -> Diff Plucker a #

(.+^) :: Num a => Plucker a -> Diff Plucker a -> Plucker a #

(.-^) :: Num a => Plucker a -> Diff Plucker a -> Plucker a #

Affine Quaternion 
Instance details

Defined in Linear.Affine

Associated Types

type Diff Quaternion :: Type -> Type #

Affine V0 
Instance details

Defined in Linear.Affine

Associated Types

type Diff V0 :: Type -> Type #

Methods

(.-.) :: Num a => V0 a -> V0 a -> Diff V0 a #

(.+^) :: Num a => V0 a -> Diff V0 a -> V0 a #

(.-^) :: Num a => V0 a -> Diff V0 a -> V0 a #

Affine V4 
Instance details

Defined in Linear.Affine

Associated Types

type Diff V4 :: Type -> Type #

Methods

(.-.) :: Num a => V4 a -> V4 a -> Diff V4 a #

(.+^) :: Num a => V4 a -> Diff V4 a -> V4 a #

(.-^) :: Num a => V4 a -> Diff V4 a -> V4 a #

Affine V1 
Instance details

Defined in Linear.Affine

Associated Types

type Diff V1 :: Type -> Type #

Methods

(.-.) :: Num a => V1 a -> V1 a -> Diff V1 a #

(.+^) :: Num a => V1 a -> Diff V1 a -> V1 a #

(.-^) :: Num a => V1 a -> Diff V1 a -> V1 a #

Ord k => Affine (Map k) 
Instance details

Defined in Linear.Affine

Associated Types

type Diff (Map k) :: Type -> Type #

Methods

(.-.) :: Num a => Map k a -> Map k a -> Diff (Map k) a #

(.+^) :: Num a => Map k a -> Diff (Map k) a -> Map k a #

(.-^) :: Num a => Map k a -> Diff (Map k) a -> Map k a #

(Eq k, Hashable k) => Affine (HashMap k) 
Instance details

Defined in Linear.Affine

Associated Types

type Diff (HashMap k) :: Type -> Type #

Methods

(.-.) :: Num a => HashMap k a -> HashMap k a -> Diff (HashMap k) a #

(.+^) :: Num a => HashMap k a -> Diff (HashMap k) a -> HashMap k a #

(.-^) :: Num a => HashMap k a -> Diff (HashMap k) a -> HashMap k a #

Additive f => Affine (Point f) 
Instance details

Defined in Linear.Affine

Associated Types

type Diff (Point f) :: Type -> Type #

Methods

(.-.) :: Num a => Point f a -> Point f a -> Diff (Point f) a #

(.+^) :: Num a => Point f a -> Diff (Point f) a -> Point f a #

(.-^) :: Num a => Point f a -> Diff (Point f) a -> Point f a #

Dim n => Affine (V n) 
Instance details

Defined in Linear.Affine

Associated Types

type Diff (V n) :: Type -> Type #

Methods

(.-.) :: Num a => V n a -> V n a -> Diff (V n) a #

(.+^) :: Num a => V n a -> Diff (V n) a -> V n a #

(.-^) :: Num a => V n a -> Diff (V n) a -> V n a #

Affine ((->) b :: Type -> Type) 
Instance details

Defined in Linear.Affine

Associated Types

type Diff ((->) b) :: Type -> Type #

Methods

(.-.) :: Num a => (b -> a) -> (b -> a) -> Diff ((->) b) a #

(.+^) :: Num a => (b -> a) -> Diff ((->) b) a -> b -> a #

(.-^) :: Num a => (b -> a) -> Diff ((->) b) a -> b -> a #

qdA :: (Affine p, Foldable (Diff p), Num a) => p a -> p a -> a #

Compute the quadrance of the difference (the square of the distance)

distanceA :: (Floating a, Foldable (Diff p), Affine p) => p a -> p a -> a #

Distance between two points in an affine space

(.#) :: Coercible b a => (b -> c) -> (a -> b) -> a -> c #

(#.) :: Coercible c b => (b -> c) -> (a -> b) -> a -> c #

unP :: Point f a -> f a #

data family MVector s a :: Type #

Instances
MVector MVector Bool 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Char 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Double 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Float 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Int 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Int8 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Int16 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Word 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Word8 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Word16 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Word32 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Word64 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector () 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s () -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s () -> MVector s () #

basicOverlaps :: MVector s () -> MVector s () -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) ()) #

basicInitialize :: PrimMonad m => MVector (PrimState m) () -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> () -> m (MVector (PrimState m) ()) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) () -> Int -> m () #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) () -> Int -> () -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) () -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) () -> () -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) () -> MVector (PrimState m) () -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) () -> MVector (PrimState m) () -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) () -> Int -> m (MVector (PrimState m) ()) #

Unbox a => MVector MVector (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => MVector MVector (V2 a) 
Instance details

Defined in Linear.V2

Methods

basicLength :: MVector s (V2 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V2 a) -> MVector s (V2 a) #

basicOverlaps :: MVector s (V2 a) -> MVector s (V2 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V2 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V2 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V2 a -> m (MVector (PrimState m) (V2 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> m (V2 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> V2 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V2 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V2 a) -> V2 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V2 a) -> MVector (PrimState m) (V2 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V2 a) -> MVector (PrimState m) (V2 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> m (MVector (PrimState m) (V2 a)) #

Unbox a => MVector MVector (V3 a) 
Instance details

Defined in Linear.V3

Methods

basicLength :: MVector s (V3 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V3 a) -> MVector s (V3 a) #

basicOverlaps :: MVector s (V3 a) -> MVector s (V3 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V3 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V3 a -> m (MVector (PrimState m) (V3 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (V3 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> V3 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V3 a) -> V3 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (MVector (PrimState m) (V3 a)) #

Unbox a => MVector MVector (Plucker a) 
Instance details

Defined in Linear.Plucker

Unbox a => MVector MVector (Quaternion a) 
Instance details

Defined in Linear.Quaternion

MVector MVector (V0 a) 
Instance details

Defined in Linear.V0

Methods

basicLength :: MVector s (V0 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V0 a) -> MVector s (V0 a) #

basicOverlaps :: MVector s (V0 a) -> MVector s (V0 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V0 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V0 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V0 a -> m (MVector (PrimState m) (V0 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V0 a) -> Int -> m (V0 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V0 a) -> Int -> V0 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V0 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V0 a) -> V0 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V0 a) -> MVector (PrimState m) (V0 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V0 a) -> MVector (PrimState m) (V0 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V0 a) -> Int -> m (MVector (PrimState m) (V0 a)) #

Unbox a => MVector MVector (V4 a) 
Instance details

Defined in Linear.V4

Methods

basicLength :: MVector s (V4 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V4 a) -> MVector s (V4 a) #

basicOverlaps :: MVector s (V4 a) -> MVector s (V4 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V4 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V4 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V4 a -> m (MVector (PrimState m) (V4 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V4 a) -> Int -> m (V4 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V4 a) -> Int -> V4 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V4 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V4 a) -> V4 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V4 a) -> MVector (PrimState m) (V4 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V4 a) -> MVector (PrimState m) (V4 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V4 a) -> Int -> m (MVector (PrimState m) (V4 a)) #

Unbox a => MVector MVector (V1 a) 
Instance details

Defined in Linear.V1

Methods

basicLength :: MVector s (V1 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V1 a) -> MVector s (V1 a) #

basicOverlaps :: MVector s (V1 a) -> MVector s (V1 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V1 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V1 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V1 a -> m (MVector (PrimState m) (V1 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V1 a) -> Int -> m (V1 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V1 a) -> Int -> V1 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V1 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V1 a) -> V1 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V1 a) -> MVector (PrimState m) (V1 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V1 a) -> MVector (PrimState m) (V1 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V1 a) -> Int -> m (MVector (PrimState m) (V1 a)) #

(Unbox a, Unbox b) => MVector MVector (a, b) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (a, b) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (a, b) -> MVector s (a, b) #

basicOverlaps :: MVector s (a, b) -> MVector s (a, b) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (a, b)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (a, b) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a, b) -> m (MVector (PrimState m) (a, b)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (a, b) -> Int -> m (a, b) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (a, b) -> Int -> (a, b) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (a, b) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (a, b) -> (a, b) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (a, b) -> MVector (PrimState m) (a, b) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (a, b) -> MVector (PrimState m) (a, b) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (a, b) -> Int -> m (MVector (PrimState m) (a, b)) #

Unbox (f a) => MVector MVector (Point f a) 
Instance details

Defined in Linear.Affine

Methods

basicLength :: MVector s (Point f a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (Point f a) -> MVector s (Point f a) #

basicOverlaps :: MVector s (Point f a) -> MVector s (Point f a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Point f a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> Point f a -> m (MVector (PrimState m) (Point f a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (Point f a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> Point f a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (Point f a) -> Point f a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (MVector (PrimState m) (Point f a)) #

(Unbox a, Unbox b, Unbox c) => MVector MVector (a, b, c) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (a, b, c) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (a, b, c) -> MVector s (a, b, c) #

basicOverlaps :: MVector s (a, b, c) -> MVector s (a, b, c) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (a, b, c)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (a, b, c) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a, b, c) -> m (MVector (PrimState m) (a, b, c)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (a, b, c) -> Int -> m (a, b, c) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (a, b, c) -> Int -> (a, b, c) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (a, b, c) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (a, b, c) -> (a, b, c) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (a, b, c) -> MVector (PrimState m) (a, b, c) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (a, b, c) -> MVector (PrimState m) (a, b, c) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (a, b, c) -> Int -> m (MVector (PrimState m) (a, b, c)) #

(Dim n, Unbox a) => MVector MVector (V n a) 
Instance details

Defined in Linear.V

Methods

basicLength :: MVector s (V n a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V n a) -> MVector s (V n a) #

basicOverlaps :: MVector s (V n a) -> MVector s (V n a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V n a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V n a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V n a -> m (MVector (PrimState m) (V n a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V n a) -> Int -> m (V n a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V n a) -> Int -> V n a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V n a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V n a) -> V n a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V n a) -> MVector (PrimState m) (V n a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V n a) -> MVector (PrimState m) (V n a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V n a) -> Int -> m (MVector (PrimState m) (V n a)) #

(Unbox a, Unbox b, Unbox c, Unbox d) => MVector MVector (a, b, c, d) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (a, b, c, d) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (a, b, c, d) -> MVector s (a, b, c, d) #

basicOverlaps :: MVector s (a, b, c, d) -> MVector s (a, b, c, d) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (a, b, c, d)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a, b, c, d) -> m (MVector (PrimState m) (a, b, c, d)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> Int -> m (a, b, c, d) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> Int -> (a, b, c, d) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> (a, b, c, d) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> MVector (PrimState m) (a, b, c, d) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> MVector (PrimState m) (a, b, c, d) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (a, b, c, d) -> Int -> m (MVector (PrimState m) (a, b, c, d)) #

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => MVector MVector (a, b, c, d, e) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (a, b, c, d, e) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (a, b, c, d, e) -> MVector s (a, b, c, d, e) #

basicOverlaps :: MVector s (a, b, c, d, e) -> MVector s (a, b, c, d, e) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (a, b, c, d, e)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a, b, c, d, e) -> m (MVector (PrimState m) (a, b, c, d, e)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> Int -> m (a, b, c, d, e) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> Int -> (a, b, c, d, e) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> (a, b, c, d, e) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> MVector (PrimState m) (a, b, c, d, e) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> MVector (PrimState m) (a, b, c, d, e) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e) -> Int -> m (MVector (PrimState m) (a, b, c, d, e)) #

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => MVector MVector (a, b, c, d, e, f) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (a, b, c, d, e, f) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (a, b, c, d, e, f) -> MVector s (a, b, c, d, e, f) #

basicOverlaps :: MVector s (a, b, c, d, e, f) -> MVector s (a, b, c, d, e, f) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (a, b, c, d, e, f)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> (a, b, c, d, e, f) -> m (MVector (PrimState m) (a, b, c, d, e, f)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> Int -> m (a, b, c, d, e, f) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> Int -> (a, b, c, d, e, f) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> MVector (PrimState m) (a, b, c, d, e, f) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> MVector (PrimState m) (a, b, c, d, e, f) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (a, b, c, d, e, f) -> Int -> m (MVector (PrimState m) (a, b, c, d, e, f)) #

NFData (MVector s a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

rnf :: MVector s a -> () #

newtype MVector s Bool 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Bool = MV_Bool (MVector s Word8)
newtype MVector s Char 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Char = MV_Char (MVector s Char)
newtype MVector s Double 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Float 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Word64 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Word32 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Word16 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Word8 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Word 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Word = MV_Word (MVector s Word)
newtype MVector s Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Int16 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Int8 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Int8 = MV_Int8 (MVector s Int8)
newtype MVector s Int 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Int = MV_Int (MVector s Int)
newtype MVector s () 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s () = MV_Unit Int
data MVector s (V4 a) 
Instance details

Defined in Linear.V4

data MVector s (V4 a) = MV_V4 !Int !(MVector s a)
data MVector s (V3 a) 
Instance details

Defined in Linear.V3

data MVector s (V3 a) = MV_V3 !Int !(MVector s a)
data MVector s (V2 a) 
Instance details

Defined in Linear.V2

data MVector s (V2 a) = MV_V2 !Int !(MVector s a)
newtype MVector s (V1 a) 
Instance details

Defined in Linear.V1

newtype MVector s (V1 a) = MV_V1 (MVector s a)
newtype MVector s (V0 a) 
Instance details

Defined in Linear.V0

newtype MVector s (V0 a) = MV_V0 Int
data MVector s (Quaternion a) 
Instance details

Defined in Linear.Quaternion

data MVector s (Plucker a) 
Instance details

Defined in Linear.Plucker

data MVector s (Plucker a) = MV_Plucker !Int (MVector s a)
newtype MVector s (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s (Complex a) = MV_Complex (MVector s (a, a))
newtype MVector s (Point f a) 
Instance details

Defined in Linear.Affine

newtype MVector s (Point f a) = MV_P (MVector s (f a))
data MVector s (a, b) 
Instance details

Defined in Data.Vector.Unboxed.Base

data MVector s (a, b) = MV_2 !Int !(MVector s a) !(MVector s b)
data MVector s (V n a) 
Instance details

Defined in Linear.V

data MVector s (V n a) = MV_VN !Int !(MVector s a)
data MVector s (a, b, c) 
Instance details

Defined in Data.Vector.Unboxed.Base

data MVector s (a, b, c) = MV_3 !Int !(MVector s a) !(MVector s b) !(MVector s c)
data MVector s (a, b, c, d) 
Instance details

Defined in Data.Vector.Unboxed.Base

data MVector s (a, b, c, d) = MV_4 !Int !(MVector s a) !(MVector s b) !(MVector s c) !(MVector s d)
data MVector s (a, b, c, d, e) 
Instance details

Defined in Data.Vector.Unboxed.Base

data MVector s (a, b, c, d, e) = MV_5 !Int !(MVector s a) !(MVector s b) !(MVector s c) !(MVector s d) !(MVector s e)
data MVector s (a, b, c, d, e, f) 
Instance details

Defined in Data.Vector.Unboxed.Base

data MVector s (a, b, c, d, e, f) = MV_6 !Int !(MVector s a) !(MVector s b) !(MVector s c) !(MVector s d) !(MVector s e) !(MVector s f)

data family Vector a :: Type #

Instances
Vector Vector Bool 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Char 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Double 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Float 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int8 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int16 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word8 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word16 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word32 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word64 
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector () 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) () -> m (Vector ()) #

basicUnsafeThaw :: PrimMonad m => Vector () -> m (Mutable Vector (PrimState m) ()) #

basicLength :: Vector () -> Int #

basicUnsafeSlice :: Int -> Int -> Vector () -> Vector () #

basicUnsafeIndexM :: Monad m => Vector () -> Int -> m () #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) () -> Vector () -> m () #

elemseq :: Vector () -> () -> b -> b #

Unbox a => Vector Vector (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector (V2 a) 
Instance details

Defined in Linear.V2

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V2 a) -> m (Vector (V2 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V2 a) -> m (Mutable Vector (PrimState m) (V2 a)) #

basicLength :: Vector (V2 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V2 a) -> Vector (V2 a) #

basicUnsafeIndexM :: Monad m => Vector (V2 a) -> Int -> m (V2 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V2 a) -> Vector (V2 a) -> m () #

elemseq :: Vector (V2 a) -> V2 a -> b -> b #

Unbox a => Vector Vector (V3 a) 
Instance details

Defined in Linear.V3

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> m (Vector (V3 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V3 a) -> m (Mutable Vector (PrimState m) (V3 a)) #

basicLength :: Vector (V3 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V3 a) -> Vector (V3 a) #

basicUnsafeIndexM :: Monad m => Vector (V3 a) -> Int -> m (V3 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> Vector (V3 a) -> m () #

elemseq :: Vector (V3 a) -> V3 a -> b -> b #

Unbox a => Vector Vector (Plucker a) 
Instance details

Defined in Linear.Plucker

Unbox a => Vector Vector (Quaternion a) 
Instance details

Defined in Linear.Quaternion

Vector Vector (V0 a) 
Instance details

Defined in Linear.V0

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V0 a) -> m (Vector (V0 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V0 a) -> m (Mutable Vector (PrimState m) (V0 a)) #

basicLength :: Vector (V0 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V0 a) -> Vector (V0 a) #

basicUnsafeIndexM :: Monad m => Vector (V0 a) -> Int -> m (V0 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V0 a) -> Vector (V0 a) -> m () #

elemseq :: Vector (V0 a) -> V0 a -> b -> b #

Unbox a => Vector Vector (V4 a) 
Instance details

Defined in Linear.V4

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V4 a) -> m (Vector (V4 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V4 a) -> m (Mutable Vector (PrimState m) (V4 a)) #

basicLength :: Vector (V4 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V4 a) -> Vector (V4 a) #

basicUnsafeIndexM :: Monad m => Vector (V4 a) -> Int -> m (V4 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V4 a) -> Vector (V4 a) -> m () #

elemseq :: Vector (V4 a) -> V4 a -> b -> b #

Unbox a => Vector Vector (V1 a) 
Instance details

Defined in Linear.V1

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V1 a) -> m (Vector (V1 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V1 a) -> m (Mutable Vector (PrimState m) (V1 a)) #

basicLength :: Vector (V1 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V1 a) -> Vector (V1 a) #

basicUnsafeIndexM :: Monad m => Vector (V1 a) -> Int -> m (V1 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V1 a) -> Vector (V1 a) -> m () #

elemseq :: Vector (V1 a) -> V1 a -> b -> b #

(Unbox a, Unbox b) => Vector Vector (a, b) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (a, b) -> m (Vector (a, b)) #

basicUnsafeThaw :: PrimMonad m => Vector (a, b) -> m (Mutable Vector (PrimState m) (a, b)) #

basicLength :: Vector (a, b) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (a, b) -> Vector (a, b) #

basicUnsafeIndexM :: Monad m => Vector (a, b) -> Int -> m (a, b) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (a, b) -> Vector (a, b) -> m () #

elemseq :: Vector (a, b) -> (a, b) -> b0 -> b0 #

Unbox (f a) => Vector Vector (Point f a) 
Instance details

Defined in Linear.Affine

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> m (Vector (Point f a)) #

basicUnsafeThaw :: PrimMonad m => Vector (Point f a) -> m (Mutable Vector (PrimState m) (Point f a)) #

basicLength :: Vector (Point f a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (Point f a) -> Vector (Point f a) #

basicUnsafeIndexM :: Monad m => Vector (Point f a) -> Int -> m (Point f a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> Vector (Point f a) -> m () #

elemseq :: Vector (Point f a) -> Point f a -> b -> b #

(Unbox a, Unbox b, Unbox c) => Vector Vector (a, b, c) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c) -> m (Vector (a, b, c)) #

basicUnsafeThaw :: PrimMonad m => Vector (a, b, c) -> m (Mutable Vector (PrimState m) (a, b, c)) #

basicLength :: Vector (a, b, c) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (a, b, c) -> Vector (a, b, c) #

basicUnsafeIndexM :: Monad m => Vector (a, b, c) -> Int -> m (a, b, c) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c) -> Vector (a, b, c) -> m () #

elemseq :: Vector (a, b, c) -> (a, b, c) -> b0 -> b0 #

(Dim n, Unbox a) => Vector Vector (V n a) 
Instance details

Defined in Linear.V

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V n a) -> m (Vector (V n a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V n a) -> m (Mutable Vector (PrimState m) (V n a)) #

basicLength :: Vector (V n a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V n a) -> Vector (V n a) #

basicUnsafeIndexM :: Monad m => Vector (V n a) -> Int -> m (V n a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V n a) -> Vector (V n a) -> m () #

elemseq :: Vector (V n a) -> V n a -> b -> b #

(Unbox a, Unbox b, Unbox c, Unbox d) => Vector Vector (a, b, c, d) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c, d) -> m (Vector (a, b, c, d)) #

basicUnsafeThaw :: PrimMonad m => Vector (a, b, c, d) -> m (Mutable Vector (PrimState m) (a, b, c, d)) #

basicLength :: Vector (a, b, c, d) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d) -> Vector (a, b, c, d) #

basicUnsafeIndexM :: Monad m => Vector (a, b, c, d) -> Int -> m (a, b, c, d) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c, d) -> Vector (a, b, c, d) -> m () #

elemseq :: Vector (a, b, c, d) -> (a, b, c, d) -> b0 -> b0 #

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Vector Vector (a, b, c, d, e) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c, d, e) -> m (Vector (a, b, c, d, e)) #

basicUnsafeThaw :: PrimMonad m => Vector (a, b, c, d, e) -> m (Mutable Vector (PrimState m) (a, b, c, d, e)) #

basicLength :: Vector (a, b, c, d, e) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d, e) -> Vector (a, b, c, d, e) #

basicUnsafeIndexM :: Monad m => Vector (a, b, c, d, e) -> Int -> m (a, b, c, d, e) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c, d, e) -> Vector (a, b, c, d, e) -> m () #

elemseq :: Vector (a, b, c, d, e) -> (a, b, c, d, e) -> b0 -> b0 #

(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Vector Vector (a, b, c, d, e, f) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c, d, e, f) -> m (Vector (a, b, c, d, e, f)) #

basicUnsafeThaw :: PrimMonad m => Vector (a, b, c, d, e, f) -> m (Mutable Vector (PrimState m) (a, b, c, d, e, f)) #

basicLength :: Vector (a, b, c, d, e, f) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d, e, f) -> Vector (a, b, c, d, e, f) #

basicUnsafeIndexM :: Monad m => Vector (a, b, c, d, e, f) -> Int -> m (a, b, c, d, e, f) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (a, b, c, d, e, f) -> Vector (a, b, c, d, e, f) -> m () #

elemseq :: Vector (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> b0 -> b0 #

(Data a, Unbox a) => Data (Vector a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vector a -> c (Vector a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector a) #

toConstr :: Vector a -> Constr #

dataTypeOf :: Vector a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vector a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector a)) #

gmapT :: (forall b. Data b => b -> b) -> Vector a -> Vector a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Vector a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) #

(Vector Vector a, ToJSON a) => ToJSON (Vector a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

NFData (Vector a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

rnf :: Vector a -> () #

Unbox a => Reversing (Vector a) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Vector a -> Vector a #

Unbox a => AsEmpty (Vector a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Vector a) () #

Unbox a => Wrapped (Vector a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Vector a) :: Type #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Unbox a => Ixed (Vector a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

(Unbox a, t ~ Vector a') => Rewrapped (Vector a) t 
Instance details

Defined in Control.Lens.Wrapped

(Unbox a, Unbox b) => Snoc (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

(Unbox a, Unbox b) => Cons (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

(Unbox a, Unbox b) => Each (Vector a) (Vector b) a b
each :: (Unbox a, Unbox b) => Traversal (Vector a) (Vector b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Vector a) (Vector b) a b #

newtype Vector Bool 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Char 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Double 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Float 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Int 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Int = V_Int (Vector Int)
newtype Vector Int8 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Int16 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Word 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Word8 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Word16 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Word32 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector Word64 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector () 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector () = V_Unit Int
type Mutable Vector 
Instance details

Defined in Data.Vector.Unboxed.Base

type Item (Vector e) 
Instance details

Defined in Data.Vector.Unboxed

type Item (Vector e) = e
newtype Vector (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector (Complex a) = V_Complex (Vector (a, a))
data Vector (V2 a) 
Instance details

Defined in Linear.V2

data Vector (V2 a) = V_V2 !Int !(Vector a)
data Vector (V3 a) 
Instance details

Defined in Linear.V3

data Vector (V3 a) = V_V3 !Int !(Vector a)
data Vector (Plucker a) 
Instance details

Defined in Linear.Plucker

data Vector (Quaternion a) 
Instance details

Defined in Linear.Quaternion

newtype Vector (V0 a) 
Instance details

Defined in Linear.V0

newtype Vector (V0 a) = V_V0 Int
data Vector (V4 a) 
Instance details

Defined in Linear.V4

data Vector (V4 a) = V_V4 !Int !(Vector a)
newtype Vector (V1 a) 
Instance details

Defined in Linear.V1

newtype Vector (V1 a) = V_V1 (Vector a)
type Unwrapped (Vector a) 
Instance details

Defined in Control.Lens.Wrapped

type Unwrapped (Vector a) = [a]
type IxValue (Vector a) 
Instance details

Defined in Control.Lens.At

type IxValue (Vector a) = a
type Index (Vector a) 
Instance details

Defined in Control.Lens.At

type Index (Vector a) = Int
data Vector (a, b) 
Instance details

Defined in Data.Vector.Unboxed.Base

data Vector (a, b) = V_2 !Int !(Vector a) !(Vector b)
newtype Vector (Point f a) 
Instance details

Defined in Linear.Affine

newtype Vector (Point f a) = V_P (Vector (f a))
data Vector (a, b, c) 
Instance details

Defined in Data.Vector.Unboxed.Base

data Vector (a, b, c) = V_3 !Int !(Vector a) !(Vector b) !(Vector c)
data Vector (V n a) 
Instance details

Defined in Linear.V

data Vector (V n a) = V_VN !Int !(Vector a)
data Vector (a, b, c, d) 
Instance details

Defined in Data.Vector.Unboxed.Base

data Vector (a, b, c, d) = V_4 !Int !(Vector a) !(Vector b) !(Vector c) !(Vector d)
data Vector (a, b, c, d, e) 
Instance details

Defined in Data.Vector.Unboxed.Base

data Vector (a, b, c, d, e) = V_5 !Int !(Vector a) !(Vector b) !(Vector c) !(Vector d) !(Vector e)
data Vector (a, b, c, d, e, f) 
Instance details

Defined in Data.Vector.Unboxed.Base

data Vector (a, b, c, d, e, f) = V_6 !Int !(Vector a) !(Vector b) !(Vector c) !(Vector d) !(Vector e) !(Vector f)

animRect' :: (InSpace V2 n t, Monoid' m, TrailLike t, Enveloped t, Transformable t, Monoid t) => Rational -> QAnimation b V2 n m -> t #

Like animRect, but with an adjustible sample rate. The first parameter is the number of samples per time unit to use. Lower rates will be faster but less accurate; higher rates are more accurate but slower.

animRect :: (InSpace V2 n t, Monoid' m, TrailLike t, Enveloped t, Transformable t, Monoid t) => QAnimation b V2 n m -> t #

animRect works similarly to animEnvelope for 2D diagrams, but instead of adjusting the envelope, simply returns the smallest bounding rectangle which encloses the entire animation. Useful for e.g. creating a background to go behind an animation.

Uses 30 samples per time unit by default; to adjust this number see animRect'.

animEnvelope' :: (OrderedField n, Metric v, Monoid' m) => Rational -> QAnimation b v n m -> QAnimation b v n m #

Like animEnvelope, but with an adjustible sample rate. The first parameter is the number of samples per time unit to use. Lower rates will be faster but less accurate; higher rates are more accurate but slower.

animEnvelope :: (OrderedField n, Metric v, Monoid' m) => QAnimation b v n m -> QAnimation b v n m #

Automatically assign fixed a envelope to the entirety of an animation by sampling the envelope at a number of points in time and taking the union of all the sampled envelopes to form the "hull". This hull is then used uniformly throughout the animation.

This is useful when you have an animation that grows and shrinks in size or shape over time, but you want it to take up a fixed amount of space, e.g. so that the final rendered movie does not zoom in and out, or so that it occupies a fixed location with respect to another animation, when combining animations with something like |||.

By default, 30 samples per time unit are used; to adjust this number see animEnvelope'.

See also animRect for help constructing a background to go behind an animation.

type QAnimation b (v :: Type -> Type) n m = Active (QDiagram b v n m) #

A value of type QAnimation b v m is an animation (a time-varying diagram with start and end times) that can be rendered by backend b, with vector space v and monoidal annotations of type m.

type Animation b (v :: Type -> Type) n = QAnimation b v n Any #

A value of type Animation b v is an animation (a time-varying diagram with start and end times) in vector space v that can be rendered by backspace b.

Note that Animation is actually a synonym for QAnimation where the type of the monoidal annotations has been fixed to Any (the default).

mkHeight :: Num n => n -> SizeSpec V2 n #

Make a SizeSpec with only height defined.

mkWidth :: Num n => n -> SizeSpec V2 n #

Make a SizeSpec with only width defined.

dims2D :: n -> n -> SizeSpec V2 n #

Make a SizeSpec from a width and height.

mkSizeSpec2D :: Num n => Maybe n -> Maybe n -> SizeSpec V2 n #

Make a SizeSpec from possibly-specified width and height.

extentY :: (InSpace v n a, R2 v, Enveloped a) => a -> Maybe (n, n) #

Compute the absolute y-coordinate range of an enveloped object in the form (lo,hi). Return Nothing for objects with an empty envelope.

extentX :: (InSpace v n a, R1 v, Enveloped a) => a -> Maybe (n, n) #

Compute the absolute x-coordinate range of an enveloped object in the form (lo,hi). Return Nothing for objects with an empty envelope.

Note this is just extent unitX.

height :: (InSpace V2 n a, Enveloped a) => a -> n #

Compute the height of an enveloped object.

width :: (InSpace V2 n a, Enveloped a) => a -> n #

Compute the width of an enveloped object.

Note this is just diameter unitX.

sizeAdjustment :: (Additive v, Foldable v, OrderedField n) => SizeSpec v n -> BoundingBox v n -> (v n, Transformation v n) #

Get the adjustment to fit a BoundingBox in the given SizeSpec. The vector is the new size and the transformation to position the lower corner at the origin and scale to the size spec.

sizedAs :: (InSpace v n a, SameSpace a b, HasLinearMap v, Transformable a, Enveloped a, Enveloped b) => b -> a -> a #

Uniformly scale an enveloped object so that it "has the same size as" (fits within the width and height of) some other object.

sized :: (InSpace v n a, HasLinearMap v, Transformable a, Enveloped a) => SizeSpec v n -> a -> a #

Uniformly scale any enveloped object so that it fits within the given size. For non-uniform scaling see boxFit.

requiredScaling :: (Additive v, Foldable v, Fractional n, Ord n) => SizeSpec v n -> v n -> Transformation v n #

Return the Transformation calcuated from requiredScale.

requiredScale :: (Additive v, Foldable v, Fractional n, Ord n) => SizeSpec v n -> v n -> n #

requiredScale spec sz returns the largest scaling factor to make something of size sz fit the requested size spec without changing the aspect ratio. sz should be non-zero (otherwise a scale of 1 is returned). For non-uniform scaling see boxFit.

specToSize :: (Foldable v, Functor v, Num n, Ord n) => n -> SizeSpec v n -> v n #

specToSize n spec extracts a size from a SizeSpec sz. Any values not specified in the spec are replaced by the smallest of the values that are specified. If there are no specified values (i.e. absolute) then n is used.

absolute :: (Additive v, Num n) => SizeSpec v n #

A size spec with no hints to the size.

dims :: v n -> SizeSpec v n #

Make a SizeSpec from a vector. Any negative values will be ignored.

mkSizeSpec :: (Functor v, Num n) => v (Maybe n) -> SizeSpec v n #

Make a SizeSpec from a vector of maybe values. Any negative values will be ignored. For 2D SizeSpecs see mkWidth and mkHeight from Diagrams.TwoD.Size.

getSpec :: (Functor v, Num n, Ord n) => SizeSpec v n -> v (Maybe n) #

Retrieve a size spec as a vector of maybe values. Only positive sizes are returned.

data SizeSpec (v :: Type -> Type) n #

A SizeSpec is a way of specifying a size without needed lengths for all the dimensions.

Instances
Functor v => Functor (SizeSpec v) 
Instance details

Defined in Diagrams.Size

Methods

fmap :: (a -> b) -> SizeSpec v a -> SizeSpec v b #

(<$) :: a -> SizeSpec v b -> SizeSpec v a #

Show (v n) => Show (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

Methods

showsPrec :: Int -> SizeSpec v n -> ShowS #

show :: SizeSpec v n -> String #

showList :: [SizeSpec v n] -> ShowS #

Generic (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

Associated Types

type Rep (SizeSpec v n) :: Type -> Type #

Methods

from :: SizeSpec v n -> Rep (SizeSpec v n) x #

to :: Rep (SizeSpec v n) x -> SizeSpec v n #

Hashable (v n) => Hashable (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

Methods

hashWithSalt :: Int -> SizeSpec v n -> Int #

hash :: SizeSpec v n -> Int #

type Rep (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

type Rep (SizeSpec v n) = D1 (MetaData "SizeSpec" "Diagrams.Size" "diagrams-lib-1.4.2.3-4IkVVBmK9qBElHMtgqeLQ1" True) (C1 (MetaCons "SizeSpec" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (v n))))
type V (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

type V (SizeSpec v n) = v
type N (SizeSpec v n) 
Instance details

Defined in Diagrams.Size

type N (SizeSpec v n) = n

bgFrame :: (TypeableFloat n, Renderable (Path V2 n) b) => n -> Colour Double -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Similar to bg but makes the colored background rectangle larger than the diagram. The first parameter is used to set how far the background extends beyond the diagram.

bg :: (TypeableFloat n, Renderable (Path V2 n) b) => Colour Double -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

"Set the background color" of a diagram. That is, place a diagram atop a bounding rectangle of the given color.

boundingRect :: (InSpace V2 n a, SameSpace a t, Enveloped t, Transformable t, TrailLike t, Monoid t, Enveloped a) => a -> t #

Construct a bounding rectangle for an enveloped object, that is, the smallest axis-aligned rectangle which encloses the object.

rectEnvelope :: (OrderedField n, Monoid' m) => Point V2 n -> V2 n -> QDiagram b V2 n m -> QDiagram b V2 n m #

rectEnvelope p v sets the envelope of a diagram to a rectangle whose lower-left corner is at p and whose upper-right corner is at p .+^ v. Useful for selecting the rectangular portion of a diagram which should actually be "viewed" in the final render, if you don't want to see the entire diagram.

extrudeTop :: (OrderedField n, Monoid' m) => n -> QDiagram b V2 n m -> QDiagram b V2 n m #

extrudeTop s "extrudes" a diagram in the positive y-direction, offsetting its envelope by the provided distance. When s < 0 , the envelope is inset instead.

See the documentation for extrudeEnvelope for more information.

extrudeBottom :: (OrderedField n, Monoid' m) => n -> QDiagram b V2 n m -> QDiagram b V2 n m #

extrudeBottom s "extrudes" a diagram in the negative y-direction, offsetting its envelope by the provided distance. When s < 0 , the envelope is inset instead.

See the documentation for extrudeEnvelope for more information.

extrudeRight :: (OrderedField n, Monoid' m) => n -> QDiagram b V2 n m -> QDiagram b V2 n m #

extrudeRight s "extrudes" a diagram in the positive x-direction, offsetting its envelope by the provided distance. When s < 0 , the envelope is inset instead.

See the documentation for extrudeEnvelope for more information.

extrudeLeft :: (OrderedField n, Monoid' m) => n -> QDiagram b V2 n m -> QDiagram b V2 n m #

extrudeLeft s "extrudes" a diagram in the negative x-direction, offsetting its envelope by the provided distance. When s < 0 , the envelope is inset instead.

See the documentation for extrudeEnvelope for more information.

padY :: (Metric v, R2 v, Monoid' m, OrderedField n) => n -> QDiagram b v n m -> QDiagram b v n m #

padY s "pads" a diagram in the y-direction, expanding its envelope vertically by a factor of s (factors between 0 and 1 can be used to shrink the envelope). Note that the envelope will expand with respect to the local origin, so if the origin is not centered vertically the padding may appear "uneven". If this is not desired, the origin can be centered (using centerY) before applying padY.

padX :: (Metric v, R2 v, OrderedField n, Monoid' m) => n -> QDiagram b v n m -> QDiagram b v n m #

padX s "pads" a diagram in the x-direction, expanding its envelope horizontally by a factor of s (factors between 0 and 1 can be used to shrink the envelope). Note that the envelope will expand with respect to the local origin, so if the origin is not centered horizontally the padding may appear "uneven". If this is not desired, the origin can be centered (using centerX) before applying padX.

strutY :: (Metric v, R2 v, OrderedField n) => n -> QDiagram b v n m #

strutY h is an empty diagram with height h, width 0, and a centered local origin. Note that strutY (-h) behaves the same as strutY h.

strutX :: (Metric v, R1 v, OrderedField n) => n -> QDiagram b v n m #

strutX w is an empty diagram with width w, height 0, and a centered local origin. Note that strutX (-w) behaves the same as strutX w.

vsep :: (InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a, Monoid' a) => n -> [a] -> a #

A convenient synonym for vertical concatenation with separation: vsep s === vcat' (with & sep .~ s).

vcat' :: (InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a, Monoid' a) => CatOpts n -> [a] -> a #

A variant of vcat taking an extra CatOpts record to control the spacing. See the cat' documentation for a description of the possibilities. For the common case of setting just a separation amount, see vsep.

vcat :: (InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a, Monoid' a) => [a] -> a #

Lay out a list of juxtaposable objects in a column from top to bottom, so that their local origins lie along a single vertical line, with successive envelopes tangent to one another.

  • For more control over the spacing, see vcat'.
  • To align the diagrams horizontally (or otherwise), use alignment combinators (such as alignL or alignR) from Diagrams.TwoD.Align before applying vcat.
  • For non-axis-aligned layout, see cat.

hsep :: (InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a, Monoid' a) => n -> [a] -> a #

A convenient synonym for horizontal concatenation with separation: hsep s === hcat' (with & sep .~ s).

hcat' :: (InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a, Monoid' a) => CatOpts n -> [a] -> a #

A variant of hcat taking an extra CatOpts record to control the spacing. See the cat' documentation for a description of the possibilities. For the common case of setting just a separation amount, see hsep.

hcat :: (InSpace V2 n a, Floating n, Juxtaposable a, HasOrigin a, Monoid' a) => [a] -> a #

Lay out a list of juxtaposable objects in a row from left to right, so that their local origins lie along a single horizontal line, with successive envelopes tangent to one another.

  • For more control over the spacing, see hcat'.
  • To align the diagrams vertically (or otherwise), use alignment combinators (such as alignT or alignB) from Diagrams.TwoD.Align before applying hcat.
  • For non-axis-aligned layout, see cat.

(|||) :: (InSpace V2 n a, Juxtaposable a, Semigroup a) => a -> a -> a infixl 6 #

Place two diagrams (or other juxtaposable objects) horizontally adjacent to one another, with the first diagram to the left of the second. The local origin of the resulting combined diagram is the same as the local origin of the first. (|||) is associative and has mempty as an identity. See the documentation of beside for more information.

(===) :: (InSpace V2 n a, Juxtaposable a, Semigroup a) => a -> a -> a infixl 6 #

Place two diagrams (or other objects) vertically adjacent to one another, with the first diagram above the second. Since Haskell ignores whitespace in expressions, one can thus write

      c
     ===
      d
  

to place c above d. The local origin of the resulting combined diagram is the same as the local origin of the first. (===) is associative and has mempty as an identity. See the documentation of beside for more information.

boxGrid :: (Traversable v, Additive v, Num n, Enum n) => n -> BoundingBox v n -> [Point v n] #

boxGrid f box returns a grid of regularly spaced points inside the box, such that there are (1/f) points along each dimension. For example, for a 3D box with corners at (0,0,0) and (2,2,2), boxGrid 0.1 would yield a grid of approximately 1000 points (it might actually be 11^3 instead of 10^3) spaced 0.2 units apart.

outside' :: (Additive v, Foldable v, Ord n) => BoundingBox v n -> BoundingBox v n -> Bool #

Test whether the first bounding box lies strictly outside the second (they do not intersect at all).

inside' :: (Additive v, Foldable v, Ord n) => BoundingBox v n -> BoundingBox v n -> Bool #

Test whether the first bounding box is strictly contained inside the second.

contains' :: (Additive v, Foldable v, Ord n) => BoundingBox v n -> Point v n -> Bool #

Check whether a point is strictly contained in a bounding box.

boxFit :: (InSpace v n a, HasBasis v, Enveloped a, Transformable a, Monoid a) => BoundingBox v n -> a -> a #

Transforms an enveloped thing to fit within a BoundingBox. If the bounding box is empty, then the result is also mempty.

boxTransform :: (Additive v, Fractional n) => BoundingBox v n -> BoundingBox v n -> Maybe (Transformation v n) #

Create a transformation mapping points from one bounding box to the other. Returns Nothing if either of the boxes are empty.

centerPoint :: (InSpace v n a, HasBasis v, Enveloped a) => a -> Point v n #

Get the center of a the bounding box of an enveloped object, return the origin for object with empty envelope.

mCenterPoint :: (InSpace v n a, HasBasis v, Enveloped a) => a -> Maybe (Point v n) #

Get the center of a the bounding box of an enveloped object, return Nothing for object with empty envelope.

boxCenter :: (Additive v, Fractional n) => BoundingBox v n -> Maybe (Point v n) #

Get the center point in a bounding box.

boxExtents :: (Additive v, Num n) => BoundingBox v n -> v n #

Get the size of the bounding box - the vector from the (component-wise) lesser point to the greater point.

getAllCorners :: (Additive v, Traversable v) => BoundingBox v n -> [Point v n] #

Computes all of the corners of the bounding box.

getCorners :: BoundingBox v n -> Maybe (Point v n, Point v n) #

Gets the lower and upper corners that define the bounding box.

isEmptyBox :: BoundingBox v n -> Bool #

Queries whether the BoundingBox is empty.

boundingBox :: (InSpace v n a, HasBasis v, Enveloped a) => a -> BoundingBox v n #

Create a bounding box for any enveloped object (such as a diagram or path).

fromPoints :: (Additive v, Ord n) => [Point v n] -> BoundingBox v n #

Create the smallest bounding box containing all the given points.

fromPoint :: Point v n -> BoundingBox v n #

Create a degenerate bounding "box" containing only a single point.

fromCorners :: (Additive v, Foldable v, Ord n) => Point v n -> Point v n -> BoundingBox v n #

Create a bounding box from a point that is component-wise (<=) than the other. If this is not the case, then mempty is returned.

emptyBox :: BoundingBox v n #

An empty bounding box. This is the same thing as mempty, but it doesn't require the same type constraints that the Monoid instance does.

data BoundingBox (v :: Type -> Type) n #

A bounding box is an axis-aligned region determined by two points indicating its "lower" and "upper" corners. It can also represent an empty bounding box - the points are wrapped in Maybe.

Instances
Functor v => Functor (BoundingBox v) 
Instance details

Defined in Diagrams.BoundingBox

Methods

fmap :: (a -> b) -> BoundingBox v a -> BoundingBox v b #

(<$) :: a -> BoundingBox v b -> BoundingBox v a #

Eq (v n) => Eq (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

(==) :: BoundingBox v n -> BoundingBox v n -> Bool #

(/=) :: BoundingBox v n -> BoundingBox v n -> Bool #

Read (v n) => Read (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Show (v n) => Show (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

showsPrec :: Int -> BoundingBox v n -> ShowS #

show :: BoundingBox v n -> String #

showList :: [BoundingBox v n] -> ShowS #

(Additive v, Ord n) => Semigroup (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

(<>) :: BoundingBox v n -> BoundingBox v n -> BoundingBox v n #

sconcat :: NonEmpty (BoundingBox v n) -> BoundingBox v n #

stimes :: Integral b => b -> BoundingBox v n -> BoundingBox v n #

(Additive v, Ord n) => Monoid (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

mempty :: BoundingBox v n #

mappend :: BoundingBox v n -> BoundingBox v n -> BoundingBox v n #

mconcat :: [BoundingBox v n] -> BoundingBox v n #

(Metric v, Traversable v, OrderedField n) => Enveloped (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getEnvelope :: BoundingBox v n -> Envelope (V (BoundingBox v n)) (N (BoundingBox v n)) #

RealFloat n => Traced (BoundingBox V2 n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getTrace :: BoundingBox V2 n -> Trace (V (BoundingBox V2 n)) (N (BoundingBox V2 n)) #

TypeableFloat n => Traced (BoundingBox V3 n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getTrace :: BoundingBox V3 n -> Trace (V (BoundingBox V3 n)) (N (BoundingBox V3 n)) #

(Additive v, Num n) => HasOrigin (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

moveOriginTo :: Point (V (BoundingBox v n)) (N (BoundingBox v n)) -> BoundingBox v n -> BoundingBox v n #

(Metric v, Traversable v, OrderedField n) => Alignable (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

alignBy' :: (InSpace v0 n0 (BoundingBox v n), Fractional n0, HasOrigin (BoundingBox v n)) => (v0 n0 -> BoundingBox v n -> Point v0 n0) -> v0 n0 -> n0 -> BoundingBox v n -> BoundingBox v n #

defaultBoundary :: (V (BoundingBox v n) ~ v0, N (BoundingBox v n) ~ n0) => v0 n0 -> BoundingBox v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (BoundingBox v n), Fractional n0, HasOrigin (BoundingBox v n)) => v0 n0 -> n0 -> BoundingBox v n -> BoundingBox v n #

AsEmpty (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

_Empty :: Prism' (BoundingBox v n) () #

(Additive v, Foldable v, Ord n) => HasQuery (BoundingBox v n) Any 
Instance details

Defined in Diagrams.BoundingBox

Methods

getQuery :: BoundingBox v n -> Query (V (BoundingBox v n)) (N (BoundingBox v n)) Any #

(Additive v', Foldable v', Ord n') => Each (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n')

Only valid if the second point is not smaller than the first.

Instance details

Defined in Diagrams.BoundingBox

Methods

each :: Traversal (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n') #

type V (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

type V (BoundingBox v n) = v
type N (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

type N (BoundingBox v n) = n

showTrace :: (Enum n, TypeableFloat n, Renderable (Path V2 n) b) => QDiagram b V2 n Any -> QDiagram b V2 n Any #

Mark the trace of a diagram by placing 64 red dots 1/100th its size along the trace.

showTrace' :: (Enum n, TypeableFloat n, Renderable (Path V2 n) b) => TraceOpts n -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Mark the trace of a diagram, with control over colour and scale of marker dot and the number of points on the trace.

showEnvelope :: (Enum n, TypeableFloat n, Renderable (Path V2 n) b) => QDiagram b V2 n Any -> QDiagram b V2 n Any #

Mark the envelope with an approximating cubic spline using 32 points, medium line width and red line color.

showEnvelope' :: (Enum n, TypeableFloat n, Renderable (Path V2 n) b) => EnvelopeOpts n -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Mark the envelope with an approximating cubic spline with control over the color, line width and number of points.

showOrigin' :: (TypeableFloat n, Renderable (Path V2 n) b, Monoid' m) => OriginOpts n -> QDiagram b V2 n m -> QDiagram b V2 n m #

Mark the origin of a diagram, with control over colour and scale of marker dot.

showOrigin :: (TypeableFloat n, Renderable (Path V2 n) b, Monoid' m) => QDiagram b V2 n m -> QDiagram b V2 n m #

Mark the origin of a diagram by placing a red dot 1/50th its size.

data TraceOpts n #

Constructors

TraceOpts 

Fields

Instances
Floating n => Default (TraceOpts n) 
Instance details

Defined in Diagrams.TwoD.Model

Methods

def :: TraceOpts n #

data EnvelopeOpts n #

Constructors

EnvelopeOpts 
Instances
OrderedField n => Default (EnvelopeOpts n) 
Instance details

Defined in Diagrams.TwoD.Model

Methods

def :: EnvelopeOpts n #

data OriginOpts n #

Constructors

OriginOpts 

Fields

Instances
Fractional n => Default (OriginOpts n) 
Instance details

Defined in Diagrams.TwoD.Model

Methods

def :: OriginOpts n #

cubicSpline :: (V t ~ v, N t ~ n, TrailLike t, Fractional (v n)) => Bool -> [Point v n] -> t #

Construct a spline path-like thing of cubic segments from a list of vertices, with the first vertex as the starting point. The first argument specifies whether the path should be closed.

pts = map p2 [(0,0), (2,3), (5,-2), (-4,1), (0,3)]
spot = circle 0.2 # fc blue # lw none
mkPath closed = position (zip pts (repeat spot))
             <> cubicSpline closed pts
cubicSplineEx = (mkPath False ||| strutX 2 ||| mkPath True)
              # centerXY # pad 1.1

For more information, see http://mathworld.wolfram.com/CubicSpline.html.

bspline :: (TrailLike t, V t ~ v, N t ~ n) => BSpline v n -> t #

Generate a uniform cubic B-spline from the given control points. The spline starts and ends at the first and last control points, and is tangent to the line to the second(-to-last) control point. It does not necessarily pass through any of the other control points.

pts = map p2 [(0,0), (2,3), (5,-2), (-4,1), (0,3)]
spot = circle 0.2 # fc blue # lw none
bsplineEx = mconcat
  [ position (zip pts (repeat spot))
  , bspline pts
  ]
  # frame 0.5

type BSpline (v :: Type -> Type) n = [Point v n] #

facingZ :: (R3 v, Functor v, Fractional n) => Deformation v v n #

perspectiveZ1 :: (R3 v, Functor v, Fractional n) => Deformation v v n #

The perspective division onto the plane z=1 along lines going through the origin.

parallelZ0 :: (R3 v, Num n) => Deformation v v n #

The parallel projection onto the plane z=0

facingY :: (R2 v, Functor v, Fractional n) => Deformation v v n #

facingX :: (R1 v, Functor v, Fractional n) => Deformation v v n #

The viewing transform for a viewer facing along the positive X axis. X coördinates stay fixed, while Y coördinates are compressed with increasing distance. asDeformation (translation unitX) <> parallelX0 <> frustrumX = perspectiveX1

perspectiveY1 :: (R2 v, Functor v, Floating n) => Deformation v v n #

The perspective division onto the plane y=1 along lines going through the origin.

parallelY0 :: (R2 v, Num n) => Deformation v v n #

The parallel projection onto the plane y=0

perspectiveX1 :: (R1 v, Functor v, Fractional n) => Deformation v v n #

The perspective division onto the plane x=1 along lines going through the origin.

parallelX0 :: (R1 v, Num n) => Deformation v v n #

The parallel projection onto the plane x=0

asDeformation :: (Additive v, Num n) => Transformation v n -> Deformation v v n #

asDeformation converts a Transformation to a Deformation by discarding the inverse transform. This allows reusing Transformations in the construction of Deformations.

newtype Deformation (v :: Type -> Type) (u :: Type -> Type) n #

Deformations are a superset of the affine transformations represented by the Transformation type. In general they are not invertible. Deformations include projective transformations. Deformation can represent other functions from points to points which are "well-behaved", in that they do not introduce small wiggles.

Constructors

Deformation (Point v n -> Point u n) 
Instances
Semigroup (Deformation v v n) 
Instance details

Defined in Diagrams.Deform

Methods

(<>) :: Deformation v v n -> Deformation v v n -> Deformation v v n #

sconcat :: NonEmpty (Deformation v v n) -> Deformation v v n #

stimes :: Integral b => b -> Deformation v v n -> Deformation v v n #

Monoid (Deformation v v n) 
Instance details

Defined in Diagrams.Deform

Methods

mempty :: Deformation v v n #

mappend :: Deformation v v n -> Deformation v v n -> Deformation v v n #

mconcat :: [Deformation v v n] -> Deformation v v n #

class Deformable a b where #

Methods

deform' :: N a -> Deformation (V a) (V b) (N a) -> a -> b #

deform' epsilon d a transforms a by the deformation d. If the type of a is not closed under projection, approximate to accuracy epsilon.

deform :: Deformation (V a) (V b) (N a) -> a -> b #

deform d a transforms a by the deformation d. If the type of a is not closed under projection, deform should call deform' with some reasonable default value of epsilon.

Instances
(Metric v, Metric u, OrderedField n, r ~ Located (Trail u n)) => Deformable (Located (Trail v n)) r 
Instance details

Defined in Diagrams.Deform

Methods

deform' :: N (Located (Trail v n)) -> Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r #

deform :: Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r #

r ~ Point u n => Deformable (Point v n) r 
Instance details

Defined in Diagrams.Deform

Methods

deform' :: N (Point v n) -> Deformation (V (Point v n)) (V r) (N (Point v n)) -> Point v n -> r #

deform :: Deformation (V (Point v n)) (V r) (N (Point v n)) -> Point v n -> r #

(Metric v, Metric u, OrderedField n, r ~ Path u n) => Deformable (Path v n) r 
Instance details

Defined in Diagrams.Deform

Methods

deform' :: N (Path v n) -> Deformation (V (Path v n)) (V r) (N (Path v n)) -> Path v n -> r #

deform :: Deformation (V (Path v n)) (V r) (N (Path v n)) -> Path v n -> r #

connectOutside' :: (TypeableFloat n, Renderable (Path V2 n) b, IsName n1, IsName n2) => ArrowOpts n -> n1 -> n2 -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

connectOutside :: (TypeableFloat n, Renderable (Path V2 n) b, IsName n1, IsName n2) => n1 -> n2 -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Draw an arrow from diagram named "n1" to diagram named "n2". The arrow lies on the line between the centres of the diagrams, but is drawn so that it stops at the boundaries of the diagrams, using traces to find the intersection points.

connectPerim' :: (TypeableFloat n, Renderable (Path V2 n) b, IsName n1, IsName n2) => ArrowOpts n -> n1 -> n2 -> Angle n -> Angle n -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

connectPerim :: (TypeableFloat n, Renderable (Path V2 n) b, IsName n1, IsName n2) => n1 -> n2 -> Angle n -> Angle n -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Connect two diagrams at point on the perimeter of the diagrams, choosen by angle.

connect' :: (TypeableFloat n, Renderable (Path V2 n) b, IsName n1, IsName n2) => ArrowOpts n -> n1 -> n2 -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Connect two diagrams with an arbitrary arrow.

connect :: (TypeableFloat n, Renderable (Path V2 n) b, IsName n1, IsName n2) => n1 -> n2 -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Connect two diagrams with a straight arrow.

arrowV' :: (TypeableFloat n, Renderable (Path V2 n) b) => ArrowOpts n -> V2 n -> QDiagram b V2 n Any #

arrowV' v creates an arrow with the direction and norm of the vector v (with its tail at the origin).

arrowV :: (TypeableFloat n, Renderable (Path V2 n) b) => V2 n -> QDiagram b V2 n Any #

arrowV v creates an arrow with the direction and norm of the vector v (with its tail at the origin), using default parameters.

arrowAt' :: (TypeableFloat n, Renderable (Path V2 n) b) => ArrowOpts n -> Point V2 n -> V2 n -> QDiagram b V2 n Any #

arrowAt :: (TypeableFloat n, Renderable (Path V2 n) b) => Point V2 n -> V2 n -> QDiagram b V2 n Any #

Create an arrow starting at s with length and direction determined by the vector v.

arrowBetween' :: (TypeableFloat n, Renderable (Path V2 n) b) => ArrowOpts n -> Point V2 n -> Point V2 n -> QDiagram b V2 n Any #

arrowBetween' opts s e creates an arrow pointing from s to e using the given options. In particular, it scales and rotates arrowShaft to go between s and e, taking head, tail, and gaps into account.

arrowBetween :: (TypeableFloat n, Renderable (Path V2 n) b) => Point V2 n -> Point V2 n -> QDiagram b V2 n Any #

arrowBetween s e creates an arrow pointing from s to e with default parameters.

arrow' :: (TypeableFloat n, Renderable (Path V2 n) b) => ArrowOpts n -> n -> QDiagram b V2 n Any #

arrow' opts len creates an arrow of length len using the given options, starting at the origin and ending at the point (len,0). In particular, it scales the given arrowShaft so that the entire arrow has length len.

arrow :: (TypeableFloat n, Renderable (Path V2 n) b) => n -> QDiagram b V2 n Any #

arrow len creates an arrow of length len with default parameters, starting at the origin and ending at the point (len,0).

shaftTexture :: TypeableFloat n => Lens' (ArrowOpts n) (Texture n) #

A lens for setting or modifying the texture of an arrow shaft.

tailTexture :: TypeableFloat n => Lens' (ArrowOpts n) (Texture n) #

A lens for setting or modifying the texture of an arrow tail. This is *not* a valid lens (see committed).

headTexture :: TypeableFloat n => Lens' (ArrowOpts n) (Texture n) #

A lens for setting or modifying the texture of an arrowhead. For example, one may write ... (with & headTexture .~ grad) to get an arrow with a head filled with a gradient, assuming grad has been defined. Or ... (with & headTexture .~ solid blue to set the head color to blue. For more general control over the style of arrowheads, see headStyle.

lengths :: Traversal' (ArrowOpts n) (Measure n) #

Set both the headLength and tailLength simultaneously.

gap :: Traversal' (ArrowOpts n) (Measure n) #

Same as gaps, provided for backward compatiiblity.

gaps :: Traversal' (ArrowOpts n) (Measure n) #

Set both the headGap and tailGap simultaneously.

tailStyle :: Lens' (ArrowOpts n) (Style V2 n) #

Style to apply to the tail. See headStyle.

tailLength :: Lens' (ArrowOpts n) (Measure n) #

The length of the tail plus its joint.

tailGap :: Lens' (ArrowOpts n) (Measure n) #

Distance to leave between the starting point and the tail.

shaftStyle :: Lens' (ArrowOpts n) (Style V2 n) #

Style to apply to the shaft. See headStyle.

headStyle :: Lens' (ArrowOpts n) (Style V2 n) #

Style to apply to the head. headStyle is modified by using the lens combinator %~ to change the current style. For example, to change an opaque black arrowhead to translucent orange: (with & headStyle %~ fc orange . opacity 0.75).

headLength :: Lens' (ArrowOpts n) (Measure n) #

The length from the start of the joint to the tip of the head.

headGap :: Lens' (ArrowOpts n) (Measure n) #

Distance to leave between the head and the target point.

arrowTail :: Lens' (ArrowOpts n) (ArrowHT n) #

A shape to place at the tail of the arrow.

arrowShaft :: Lens' (ArrowOpts n) (Trail V2 n) #

The trail to use for the arrow shaft.

arrowHead :: Lens' (ArrowOpts n) (ArrowHT n) #

A shape to place at the head of the arrow.

straightShaft :: OrderedField n => Trail V2 n #

Straight line arrow shaft.

data ArrowOpts n #

Instances
TypeableFloat n => Default (ArrowOpts n) 
Instance details

Defined in Diagrams.TwoD.Arrow

Methods

def :: ArrowOpts n #

quill :: (Floating n, Ord n) => ArrowHT n #

lineTail :: RealFloat n => ArrowHT n #

A line the same width as the shaft.

arrowtailQuill :: OrderedField n => Angle n -> ArrowHT n #

The angle is where the top left corner intersects the circle.

lineHead :: RealFloat n => ArrowHT n #

A line the same width as the shaft.

arrowheadThorn :: RealFloat n => Angle n -> ArrowHT n #

Curved sides, linear concave base. Illustrator CS5 #3

arrowheadSpike :: RealFloat n => Angle n -> ArrowHT n #

Isoceles triangle with curved concave base. Inkscape type 2.

arrowheadHalfDart :: RealFloat n => Angle n -> ArrowHT n #

Top half of an arrowheadDart.

arrowheadDart :: RealFloat n => Angle n -> ArrowHT n #

Isoceles triangle with linear concave base. Inkscape type 1 - dart like.

arrowheadTriangle :: RealFloat n => Angle n -> ArrowHT n #

Isoceles triangle style. The above example specifies an angle of `2/5 Turn`.

type ArrowHT n = n -> n -> (Path V2 n, Path V2 n) #

lighter :: HasStyle a => a -> a #

Set all text to be lighter than the inherited font weight.

bolder :: HasStyle a => a -> a #

Set all text to be bolder than the inherited font weight.

heavy :: HasStyle a => a -> a #

Set all text using a heavy/black font weight.

ultraBold :: HasStyle a => a -> a #

Set all text using an ultra-bold font weight.

semiBold :: HasStyle a => a -> a #

Set all text using a semi-bold font weight.

mediumWeight :: HasStyle a => a -> a #

Set all text using a medium font weight.

light :: HasStyle a => a -> a #

Set all text using a light font weight.

ultraLight :: HasStyle a => a -> a #

Set all text using a extra light font weight.

thinWeight :: HasStyle a => a -> a #

Set all text using a thin font weight.

bold :: HasStyle a => a -> a #

Set all text using a bold font weight.

oblique :: HasStyle a => a -> a #

Set all text using an oblique slant.

italic :: HasStyle a => a -> a #

Set all text in italics.

_fontSize :: (Typeable n, OrderedField n) => Lens' (Style v n) (Measure n) #

Lens to commit a font size. This is *not* a valid lens (see commited.

fontSizeL :: (N a ~ n, Typeable n, Num n, HasStyle a) => n -> a -> a #

A convenient sysnonym for 'fontSize (Local w)'.

fontSizeO :: (N a ~ n, Typeable n, HasStyle a) => n -> a -> a #

A convenient synonym for 'fontSize (Output w)'.

fontSizeN :: (N a ~ n, Typeable n, Num n, HasStyle a) => n -> a -> a #

A convenient synonym for 'fontSize (Normalized w)'.

fontSizeG :: (N a ~ n, Typeable n, Num n, HasStyle a) => n -> a -> a #

A convenient synonym for 'fontSize (Global w)'.

fontSize :: (N a ~ n, Typeable n, HasStyle a) => Measure n -> a -> a #

Set the font size, that is, the size of the font's em-square as measured within the current local vector space. The default size is local 1 (which is applied by recommendFontSize).

_font :: Lens' (Style v n) (Maybe String) #

Lens onto the font name of a style.

font :: HasStyle a => String -> a -> a #

Specify a font family to be used for all text within a diagram.

baselineText :: (TypeableFloat n, Renderable (Text n) b) => String -> QDiagram b V2 n Any #

Create a primitive text diagram from the given string, with the origin set to be on the baseline, at the beginning (although not bounding). This is the reference point of showText in the Cairo graphics library.

Note that it takes up no space.

alignedText :: (TypeableFloat n, Renderable (Text n) b) => n -> n -> String -> QDiagram b V2 n Any #

Create a primitive text diagram from the given string, with the origin set to a point interpolated within the bounding box. The first parameter varies from 0 (left) to 1 (right), and the second parameter from 0 (bottom) to 1 (top). Some backends do not implement this and instead snap to closest corner or the center.

The height of this box is determined by the font's potential ascent and descent, rather than the height of the particular string.

Note that it takes up no space.

topLeftText :: (TypeableFloat n, Renderable (Text n) b) => String -> QDiagram b V2 n Any #

Create a primitive text diagram from the given string, origin at the top left corner of the text's bounding box, equivalent to alignedText 0 1.

Note that it takes up no space.

text :: (TypeableFloat n, Renderable (Text n) b) => String -> QDiagram b V2 n Any #

Create a primitive text diagram from the given string, with center alignment, equivalent to alignedText 0.5 0.5.

Note that it takes up no space, as text size information is not available.

fcA :: (InSpace V2 n a, Floating n, Typeable n, HasStyle a) => AlphaColour Double -> a -> a #

A synonym for fillColor, specialized to AlphaColour Double (i.e. colors with transparency). See comment after fillColor about backends.

fc :: (InSpace V2 n a, Floating n, Typeable n, HasStyle a) => Colour Double -> a -> a #

A synonym for fillColor, specialized to Colour Double (i.e. opaque colors). See comment after fillColor about backends.

recommendFillColor :: (InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) => c -> a -> a #

Set a "recommended" fill color, to be used only if no explicit calls to fillColor (or fc, or fcA) are used. See comment after fillColor about backends.

fillColor :: (InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) => c -> a -> a #

Set the fill color. This function is polymorphic in the color type (so it can be used with either Colour or AlphaColour), but this can sometimes create problems for type inference, so the fc and fcA variants are provided with more concrete types.

_fillTexture :: (Typeable n, Floating n) => Lens' (Style V2 n) (Texture n) #

Commit a fill texture in a style. This is not a valid setter because it doesn't abide the functor law (see committed).

fillTexture :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => Texture n -> a -> a #

lcA :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => AlphaColour Double -> a -> a #

A synonym for lineColor, specialized to AlphaColour Double (i.e. colors with transparency). See comment in lineColor about backends.

lc :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => Colour Double -> a -> a #

A synonym for lineColor, specialized to Colour Double (i.e. opaque colors). See comment in lineColor about backends.

lineColor :: (InSpace V2 n a, Color c, Typeable n, Floating n, HasStyle a) => c -> a -> a #

Set the line (stroke) color. This function is polymorphic in the color type (so it can be used with either Colour or AlphaColour), but this can sometimes create problems for type inference, so the lc and lcA variants are provided with more concrete types.

lineTextureA :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => LineTexture n -> a -> a #

lineTexture :: (InSpace V2 n a, Typeable n, Floating n, HasStyle a) => Texture n -> a -> a #

mkRadialGradient :: Num n => [GradientStop n] -> Point V2 n -> n -> Point V2 n -> n -> SpreadMethod -> Texture n #

Make a radial gradient texture from a stop list, radius, start point, end point, and SpreadMethod. The rGradTrans field is set to the identity transfrom, to change it use the rGradTrans lens.

mkLinearGradient :: Num n => [GradientStop n] -> Point V2 n -> Point V2 n -> SpreadMethod -> Texture n #

Make a linear gradient texture from a stop list, start point, end point, and SpreadMethod. The lGradTrans field is set to the identity transfrom, to change it use the lGradTrans lens.

mkStops :: [(Colour Double, d, Double)] -> [GradientStop d] #

A convenient function for making gradient stops from a list of triples. (An opaque color, a stop fraction, an opacity).

defaultRG :: Fractional n => Texture n #

A default is provided so that radial gradients can easily be created using lenses. For example, rg = defaultRG & rGradRadius1 .~ 0.25. Note that no default value is provided for rGradStops, this must be set before the gradient value is used, otherwise the object will appear transparent.

defaultLG :: Fractional n => Texture n #

A default is provided so that linear gradients can easily be created using lenses. For example, lg = defaultLG & lGradStart .~ (0.25 ^& 0.33). Note that no default value is provided for lGradStops, this must be set before the gradient value is used, otherwise the object will appear transparent.

solid :: Color a => a -> Texture n #

Convert a solid colour into a texture.

_AC :: Prism' (Texture n) (AlphaColour Double) #

Prism onto an AlphaColour Double of a SC texture.

rGradTrans :: Lens' (RGradient n) (Transformation V2 n) #

A transformation to be applied to the gradient. Usually this field will start as the identity transform and capture the transforms that are applied to the gradient.

rGradStops :: Lens' (RGradient n) [GradientStop n] #

A list of stops (colors and fractions).

rGradSpreadMethod :: Lens' (RGradient n) SpreadMethod #

For setting the spread method.

rGradRadius1 :: Lens' (RGradient n) n #

The radius of the outer circle in local coordinates.

rGradRadius0 :: Lens' (RGradient n) n #

The radius of the inner cirlce in local coordinates.

rGradCenter1 :: Lens' (RGradient n) (Point V2 n) #

The center of the outer circle.

rGradCenter0 :: Lens' (RGradient n) (Point V2 n) #

The center point of the inner circle.

data Texture n #

A Texture is either a color SC, linear gradient LG, or radial gradient RG. An object can have only one texture which is determined by the Last semigroup structure.

Constructors

SC SomeColor 
LG (LGradient n) 
RG (RGradient n) 
Instances
Floating n => Transformable (Texture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

Methods

transform :: Transformation (V (Texture n)) (N (Texture n)) -> Texture n -> Texture n #

type V (Texture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (Texture n) = V2
type N (Texture n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (Texture n) = n

lGradTrans :: Lens' (LGradient n) (Transformation V2 n) #

A transformation to be applied to the gradient. Usually this field will start as the identity transform and capture the transforms that are applied to the gradient.

lGradStops :: Lens' (LGradient n) [GradientStop n] #

A list of stops (colors and fractions).

lGradStart :: Lens' (LGradient n) (Point V2 n) #

The starting point for the first gradient stop. The coordinates are in local units and the default is (-0.5, 0).

lGradSpreadMethod :: Lens' (LGradient n) SpreadMethod #

For setting the spread method.

lGradEnd :: Lens' (LGradient n) (Point V2 n) #

The ending point for the last gradient stop.The coordinates are in local units and the default is (0.5, 0).

data RGradient n #

Radial Gradient

Instances
Fractional n => Transformable (RGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (RGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (RGradient n) = V2
type N (RGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (RGradient n) = n

stopFraction :: Lens' (GradientStop n) n #

The fraction for stop.

stopColor :: Lens' (GradientStop n) SomeColor #

A color for the stop.

data SpreadMethod #

The SpreadMethod determines what happens before lGradStart and after lGradEnd. GradPad fills the space before the start of the gradient with the color of the first stop and the color after end of the gradient with the color of the last stop. GradRepeat restarts the gradient and GradReflect restarts the gradient with the stops in reverse order.

data LGradient n #

Linear Gradient

Instances
Fractional n => Transformable (LGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (LGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type V (LGradient n) = V2
type N (LGradient n) 
Instance details

Defined in Diagrams.TwoD.Attributes

type N (LGradient n) = n

data GradientStop d #

A gradient stop contains a color and fraction (usually between 0 and 1)

Constructors

GradientStop 

raster :: Num n => (Int -> Int -> AlphaColour Double) -> Int -> Int -> DImage n Embedded #

Create an image "from scratch" by specifying the pixel data

rasterDia :: (TypeableFloat n, Renderable (DImage n Embedded) b) => (Int -> Int -> AlphaColour Double) -> Int -> Int -> QDiagram b V2 n Any #

Crate a diagram from raw raster data.

uncheckedImageRef :: Num n => FilePath -> Int -> Int -> DImage n External #

Make an "unchecked" image reference; have to specify a width and height. Unless the aspect ratio of the external image is the w :: h, then the image will be distorted.

loadImageExt :: Num n => FilePath -> IO (Either String (DImage n External)) #

Check that a file exists, and use JuicyPixels to figure out the right size, but save a reference to the image instead of the raster data

loadImageEmb :: Num n => FilePath -> IO (Either String (DImage n Embedded)) #

Use JuicyPixels to read a file in any format and wrap it in a DImage. The width and height of the image are set to their actual values.

image :: (TypeableFloat n, Typeable a, Renderable (DImage n a) b) => DImage n a -> QDiagram b V2 n Any #

Make a DImage into a Diagram.

data Embedded #

Instances
SVGFloat n => Renderable (DImage n Embedded) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> DImage n Embedded -> Render SVG (V (DImage n Embedded)) (N (DImage n Embedded)) #

data External #

data Native t #

Instances
SVGFloat n => Renderable (DImage n (Native Img)) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> DImage n (Native Img) -> Render SVG (V (DImage n (Native Img))) (N (DImage n (Native Img))) #

data ImageData a where #

ImageData is either a JuicyPixels DynamicImage tagged as Embedded or a reference tagged as External. Additionally Native is provided for external libraries to hook into.

Constructors

ImageRaster :: forall a. DynamicImage -> ImageData Embedded 
ImageRef :: forall a. FilePath -> ImageData External 
ImageNative :: forall a t. t -> ImageData (Native t) 

data DImage a b #

An image primitive, the two ints are width followed by height. Will typically be created by loadImageEmb or loadImageExt which, will handle setting the width and height to the actual width and height of the image.

Constructors

DImage (ImageData b) Int Int (Transformation V2 a) 
Instances
Fractional n => Transformable (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

Methods

transform :: Transformation (V (DImage n a)) (N (DImage n a)) -> DImage n a -> DImage n a #

Fractional n => HasOrigin (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

Methods

moveOriginTo :: Point (V (DImage n a)) (N (DImage n a)) -> DImage n a -> DImage n a #

Fractional n => Renderable (DImage n a) NullBackend 
Instance details

Defined in Diagrams.TwoD.Image

Methods

render :: NullBackend -> DImage n a -> Render NullBackend (V (DImage n a)) (N (DImage n a)) #

SVGFloat n => Renderable (DImage n (Native Img)) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> DImage n (Native Img) -> Render SVG (V (DImage n (Native Img))) (N (DImage n (Native Img))) #

SVGFloat n => Renderable (DImage n Embedded) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> DImage n Embedded -> Render SVG (V (DImage n Embedded)) (N (DImage n Embedded)) #

RealFloat n => HasQuery (DImage n a) Any 
Instance details

Defined in Diagrams.TwoD.Image

Methods

getQuery :: DImage n a -> Query (V (DImage n a)) (N (DImage n a)) Any #

type V (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

type V (DImage n a) = V2
type N (DImage n a) 
Instance details

Defined in Diagrams.TwoD.Image

type N (DImage n a) = n

intersectPointsT' :: OrderedField n => n -> Located (Trail V2 n) -> Located (Trail V2 n) -> [P2 n] #

Compute the intersect points between two located trails within the given tolerance.

intersectPointsT :: OrderedField n => Located (Trail V2 n) -> Located (Trail V2 n) -> [P2 n] #

Compute the intersect points between two located trails.

intersectPointsP' :: OrderedField n => n -> Path V2 n -> Path V2 n -> [P2 n] #

Compute the intersect points between two paths within given tolerance.

intersectPointsP :: OrderedField n => Path V2 n -> Path V2 n -> [P2 n] #

Compute the intersect points between two paths.

intersectPoints' :: (InSpace V2 n t, SameSpace t s, ToPath t, ToPath s, OrderedField n) => n -> t -> s -> [P2 n] #

Find the intersect points of two objects that can be converted to a path within the given tolerance.

intersectPoints :: (InSpace V2 n t, SameSpace t s, ToPath t, ToPath s, OrderedField n) => t -> s -> [P2 n] #

Find the intersect points of two objects that can be converted to a path.

clipped :: TypeableFloat n => Path V2 n -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Clip a diagram to the clip path taking the envelope and trace of the clip path.

clipTo :: TypeableFloat n => Path V2 n -> QDiagram b V2 n Any -> QDiagram b V2 n Any #

Clip a diagram to the given path setting its envelope to the pointwise minimum of the envelopes of the diagram and path. The trace consists of those parts of the original diagram's trace which fall within the clipping path, or parts of the path's trace within the original diagram.

clipBy :: (HasStyle a, V a ~ V2, N a ~ n, TypeableFloat n) => Path V2 n -> a -> a #

Clip a diagram by the given path:

  • Only the parts of the diagram which lie in the interior of the path will be drawn.
  • The envelope of the diagram is unaffected.

_clip :: (Typeable n, OrderedField n) => Lens' (Style V2 n) [Path V2 n] #

Lens onto the Clip in a style. An empty list means no clipping.

_Clip :: Iso (Clip n) (Clip n') [Path V2 n] [Path V2 n'] #

_fillRule :: Lens' (Style V2 n) FillRule #

Lens onto the fill rule of a style.

fillRule :: HasStyle a => FillRule -> a -> a #

Specify the fill rule that should be used for determining which points are inside a path.

strokeLocLoop :: (TypeableFloat n, Renderable (Path V2 n) b) => Located (Trail' Loop V2 n) -> QDiagram b V2 n Any #

A convenience function for converting a Located loop directly into a diagram; strokeLocLoop = stroke . trailLike . mapLoc wrapLoop.

strokeLocLine :: (TypeableFloat n, Renderable (Path V2 n) b) => Located (Trail' Line V2 n) -> QDiagram b V2 n Any #

A convenience function for converting a Located line directly into a diagram; strokeLocLine = stroke . trailLike . mapLoc wrapLine.

strokeLocT :: (TypeableFloat n, Renderable (Path V2 n) b) => Located (Trail V2 n) -> QDiagram b V2 n Any #

Deprecated synonym for strokeLocTrail.

strokeLocTrail :: (TypeableFloat n, Renderable (Path V2 n) b) => Located (Trail V2 n) -> QDiagram b V2 n Any #

A convenience function for converting a Located Trail directly into a diagram; strokeLocTrail = stroke . trailLike.

strokeLoop :: (TypeableFloat n, Renderable (Path V2 n) b) => Trail' Loop V2 n -> QDiagram b V2 n Any #

A composition of strokeT and wrapLoop for conveniently converting a loop directly into a diagram.

strokeLine :: (TypeableFloat n, Renderable (Path V2 n) b) => Trail' Line V2 n -> QDiagram b V2 n Any #

A composition of strokeT and wrapLine for conveniently converting a line directly into a diagram.

strokeT' :: (TypeableFloat n, Renderable (Path V2 n) b, IsName a) => StrokeOpts a -> Trail V2 n -> QDiagram b V2 n Any #

Deprecated synonym for strokeTrail'.

strokeTrail' :: (TypeableFloat n, Renderable (Path V2 n) b, IsName a) => StrokeOpts a -> Trail V2 n -> QDiagram b V2 n Any #

A composition of stroke' and pathFromTrail for conveniently converting a trail directly into a diagram.

strokeT :: (TypeableFloat n, Renderable (Path V2 n) b) => Trail V2 n -> QDiagram b V2 n Any #

stroke specialised to Trail.

strokeTrail :: (TypeableFloat n, Renderable (Path V2 n) b) => Trail V2 n -> QDiagram b V2 n Any #

stroke specialised to Trail.

strokePath' :: (TypeableFloat n, Renderable (Path V2 n) b, IsName a) => StrokeOpts a -> Path V2 n -> QDiagram b V2 n Any #

stroke' specialised to Path.

strokeP' :: (TypeableFloat n, Renderable (Path V2 n) b, IsName a) => StrokeOpts a -> Path V2 n -> QDiagram b V2 n Any #

stroke' specialised to Path.

strokePath :: (TypeableFloat n, Renderable (Path V2 n) b) => Path V2 n -> QDiagram b V2 n Any #

stroke specialised to Path.

strokeP :: (TypeableFloat n, Renderable (Path V2 n) b) => Path V2 n -> QDiagram b V2 n Any #

stroke specialised to Path.

stroke' :: (InSpace V2 n t, ToPath t, TypeableFloat n, Renderable (Path V2 n) b, IsName a) => StrokeOpts a -> t -> QDiagram b V2 n Any #

A variant of stroke that takes an extra record of options to customize its behaviour. In particular:

  • Names can be assigned to the path's vertices

StrokeOpts is an instance of Default, so stroke' (with & ... ) syntax may be used.

stroke :: (InSpace V2 n t, ToPath t, TypeableFloat n, Renderable (Path V2 n) b) => t -> QDiagram b V2 n Any #

Convert a ToPath object into a diagram. The resulting diagram has the names 0, 1, ... assigned to each of the path's vertices.

See also stroke', which takes an extra options record allowing its behaviour to be customized.

stroke :: Path V2 Double                  -> Diagram b
stroke :: Located (Trail V2 Double)       -> Diagram b
stroke :: Located (Trail' Loop V2 Double) -> Diagram b
stroke :: Located (Trail' Line V2 Double) -> Diagram b

vertexNames :: Lens (StrokeOpts a) (StrokeOpts a') [[a]] [[a']] #

Atomic names that should be assigned to the vertices of the path so that they can be referenced later. If there are not enough names, the extra vertices are not assigned names; if there are too many, the extra names are ignored. Note that this is a list of lists of names, since paths can consist of multiple trails. The first list of names are assigned to the vertices of the first trail, the second list to the second trail, and so on.

The default value is the empty list.

queryFillRule :: Lens' (StrokeOpts a) FillRule #

The fill rule used for determining which points are inside the path. The default is Winding. NOTE: for now, this only affects the resulting diagram's Query, not how it will be drawn! To set the fill rule determining how it is to be drawn, use the fillRule function.

data FillRule #

Enumeration of algorithms or "rules" for determining which points lie in the interior of a (possibly self-intersecting) path.

Constructors

Winding

Interior points are those with a nonzero winding number. See http://en.wikipedia.org/wiki/Nonzero-rule.

EvenOdd

Interior points are those where a ray extended infinitely in a particular direction crosses the path an odd number of times. See http://en.wikipedia.org/wiki/Even-odd_rule.

Instances
Eq FillRule 
Instance details

Defined in Diagrams.TwoD.Path

Ord FillRule 
Instance details

Defined in Diagrams.TwoD.Path

Show FillRule 
Instance details

Defined in Diagrams.TwoD.Path

Semigroup FillRule 
Instance details

Defined in Diagrams.TwoD.Path

Default FillRule 
Instance details

Defined in Diagrams.TwoD.Path

Methods

def :: FillRule #

AttributeClass FillRule 
Instance details

Defined in Diagrams.TwoD.Path

data StrokeOpts a #

A record of options that control how a path is stroked. StrokeOpts is an instance of Default, so a StrokeOpts records can be created using with { ... } notation.

Constructors

StrokeOpts 

Fields

Instances
Default (StrokeOpts a) 
Instance details

Defined in Diagrams.TwoD.Path

Methods

def :: StrokeOpts a #

roundedRect' :: (InSpace V2 n t, TrailLike t, RealFloat n) => n -> n -> RoundedRectOpts n -> t #

roundedRect' works like roundedRect but allows you to set the radius of each corner indivually, using RoundedRectOpts. The default corner radius is 0. Each radius can also be negative, which results in the curves being reversed to be inward instead of outward.

roundedRect :: (InSpace V2 n t, TrailLike t, RealFloat n) => n -> n -> n -> t #

roundedRect w h r generates a closed trail, or closed path centered at the origin, of an axis-aligned rectangle with width w, height h, and circular rounded corners of radius r. If r is negative the corner will be cut out in a reverse arc. If the size of r is larger than half the smaller dimension of w and h, then it will be reduced to fit in that range, to prevent the corners from overlapping. The trail or path begins with the right edge and proceeds counterclockwise. If you need to specify a different radius for each corner individually, use roundedRect' instead.

roundedRectEx = pad 1.1 . centerXY $ hcat' (with & sep .~ 0.2)
  [ roundedRect  0.5 0.4 0.1
  , roundedRect  0.5 0.4 (-0.1)
  , roundedRect' 0.7 0.4 (with & radiusTL .~ 0.2
                               & radiusTR .~ -0.2
                               & radiusBR .~ 0.1)
  ]

dodecagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular dodecagon, with sides of the given length and base parallel to the x-axis.

hendecagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular hendecagon, with sides of the given length and base parallel to the x-axis.

decagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular decagon, with sides of the given length and base parallel to the x-axis.

nonagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular nonagon, with sides of the given length and base parallel to the x-axis.

octagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular octagon, with sides of the given length and base parallel to the x-axis.

septagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A synonym for heptagon. It is, however, completely inferior, being a base admixture of the Latin septum (seven) and the Greek γωνία (angle).

heptagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular heptagon, with sides of the given length and base parallel to the x-axis.

hexagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular hexagon, with sides of the given length and base parallel to the x-axis.

pentagon :: (InSpace V2 n t, TrailLike t) => n -> t #

A regular pentagon, with sides of the given length and base parallel to the x-axis.

triangle :: (InSpace V2 n t, TrailLike t) => n -> t #

An equilateral triangle, with sides of the given length and base parallel to the x-axis.

eqTriangle :: (InSpace V2 n t, TrailLike t) => n -> t #

A synonym for triangle, provided for backwards compatibility.

regPoly :: (InSpace V2 n t, TrailLike t) => Int -> n -> t #

Create a regular polygon. The first argument is the number of sides, and the second is the length of the sides. (Compare to the polygon function with a PolyRegular option, which produces polygons of a given radius).

The polygon will be oriented with one edge parallel to the x-axis.

rect :: (InSpace V2 n t, TrailLike t) => n -> n -> t #

rect w h is an axis-aligned rectangle of width w and height h, centered at the origin.

square :: (InSpace V2 n t, TrailLike t) => n -> t #

A square with its center at the origin and sides of the given length, oriented parallel to the axes.

unitSquare :: (InSpace V2 n t, TrailLike t) => t #

A square with its center at the origin and sides of length 1, oriented parallel to the axes.

vrule :: (InSpace V2 n t, TrailLike t) => n -> t #

Create a centered vertical (T-B) line of the given length.

vruleEx = hcat' (with & sep .~ 0.2) (map vrule [1, 1.2 .. 2])
        # centerXY # pad 1.1

hrule :: (InSpace V2 n t, TrailLike t) => n -> t #

Create a centered horizontal (L-R) line of the given length.

hruleEx = vcat' (with & sep .~ 0.2) (map hrule [1..5])
        # centerXY # pad 1.1

data RoundedRectOpts d #

Constructors

RoundedRectOpts 

Fields

Instances
Num d => Default (RoundedRectOpts d) 
Instance details

Defined in Diagrams.TwoD.Shapes

Methods

def :: RoundedRectOpts d #

star :: OrderedField n => StarOpts -> [Point V2 n] -> Path V2 n #

Create a generalized star polygon. The StarOpts are used to determine in which order the given vertices should be connected. The intention is that the second argument of type [Point v] could be generated by a call to polygon, regPoly, or the like, since a list of vertices is TrailLike. But of course the list can be generated any way you like. A Path v is returned (instead of any TrailLike) because the resulting path may have more than one component, for example if the vertices are to be connected in several disjoint cycles.

polygon :: (InSpace V2 n t, TrailLike t) => PolygonOpts n -> t #

Generate the polygon described by the given options.

polyTrail :: OrderedField n => PolygonOpts n -> Located (Trail V2 n) #

Generate a polygon. See PolygonOpts for more information.

polyType :: Lens' (PolygonOpts n) (PolyType n) #

Specification for the polygon's vertices.

polyOrient :: Lens' (PolygonOpts n) (PolyOrientation n) #

Should a rotation be applied to the polygon in order to orient it in a particular way?

polyCenter :: Lens' (PolygonOpts n) (Point V2 n) #

Should a translation be applied to the polygon in order to place the center at a particular location?

data StarOpts #

Options for creating "star" polygons, where the edges connect possibly non-adjacent vertices.

Constructors

StarFun (Int -> Int)

Specify the order in which the vertices should be connected by a function that maps each vertex index to the index of the vertex that should come next. Indexing of vertices begins at 0.

StarSkip Int

Specify a star polygon by a "skip". A skip of 1 indicates a normal polygon, where edges go between successive vertices. A skip of 2 means that edges will connect every second vertex, skipping one in between. Generally, a skip of n means that edges will connect every nth vertex.

data PolyType n #

Method used to determine the vertices of a polygon.

Constructors

PolyPolar [Angle n] [n]

A "polar" polygon.

  • The first argument is a list of central angles from each vertex to the next.
  • The second argument is a list of radii from the origin to each successive vertex.

To construct an n-gon, use a list of n-1 angles and n radii. Extra angles or radii are ignored.

Cyclic polygons (with all vertices lying on a circle) can be constructed using a second argument of (repeat r).

PolySides [Angle n] [n]

A polygon determined by the distance between successive vertices and the external angles formed by each three successive vertices. In other words, a polygon specified by "turtle graphics": go straight ahead x1 units; turn by external angle a1; go straight ahead x2 units; turn by external angle a2; etc. The polygon will be centered at the centroid of its vertices.

  • The first argument is a list of vertex angles, giving the external angle at each vertex from the previous vertex to the next. The first angle in the list is the external angle at the second vertex; the first edge always starts out heading in the positive y direction from the first vertex.
  • The second argument is a list of distances between successive vertices.

To construct an n-gon, use a list of n-2 angles and n-1 edge lengths. Extra angles or lengths are ignored.

PolyRegular Int n

A regular polygon with the given number of sides (first argument) and the given radius (second argument).

data PolyOrientation n #

Determine how a polygon should be oriented.

Constructors

NoOrient

No special orientation; the first vertex will be at (1,0).

OrientH

Orient horizontally, so the bottommost edge is parallel to the x-axis. This is the default.

OrientV

Orient vertically, so the leftmost edge is parallel to the y-axis.

OrientTo (V2 n)

Orient so some edge is facing in the direction of, that is, perpendicular to, the given vector.

data PolygonOpts n #

Options for specifying a polygon.

Instances
Num n => Default (PolygonOpts n)

The default polygon is a regular pentagon of radius 1, centered at the origin, aligned to the x-axis.

Instance details

Defined in Diagrams.TwoD.Polygons

Methods

def :: PolygonOpts n #

reversePath :: (Metric v, OrderedField n) => Path v n -> Path v n #

Reverse all the component trails of a path.

scalePath :: (HasLinearMap v, Metric v, OrderedField n) => n -> Path v n -> Path v n #

Scale a path using its centroid (see pathCentroid) as the base point for the scale.

partitionPath :: (Located (Trail v n) -> Bool) -> Path v n -> (Path v n, Path v n) #

Partition a path into two paths based on a predicate on trails: the first containing all the trails for which the predicate returns True, and the second containing the remaining trails.

explodePath :: (V t ~ v, N t ~ n, TrailLike t) => Path v n -> [[t]] #

"Explode" a path by exploding every component trail (see explodeTrail).

fixPath :: (Metric v, OrderedField n) => Path v n -> [[FixedSegment v n]] #

Convert a path into a list of lists of FixedSegments.

pathLocSegments :: (Metric v, OrderedField n) => Path v n -> [[Located (Segment Closed v n)]] #

Convert a path into a list of lists of located segments.

pathCentroid :: (Metric v, OrderedField n) => Path v n -> Point v n #

Compute the centroid of a path (i.e. the average location of its vertices; see pathVertices).

pathOffsets :: (Metric v, OrderedField n) => Path v n -> [v n] #

Compute the total offset of each trail comprising a path (see trailOffset).

pathVertices :: (Metric v, OrderedField n) => Path v n -> [[Point v n]] #

Like pathVertices', with a default tolerance.

pathVertices' :: (Metric v, OrderedField n) => n -> Path v n -> [[Point v n]] #

Extract the vertices of a path, resulting in a separate list of vertices for each component trail. Here a vertex is defined as a non-differentiable point on the trail, i.e. a sharp corner. (Vertices are thus a subset of the places where segments join; if you want all joins between segments, see pathPoints.) The tolerance determines how close the tangents of two segments must be at their endpoints to consider the transition point to be differentiable. See trailVertices for more information.

pathFromLocTrail :: (Metric v, OrderedField n) => Located (Trail v n) -> Path v n #

Convert a located trail to a singleton path. This is equivalent to trailLike, but provided with a more specific name and type for convenience.

pathFromTrailAt :: (Metric v, OrderedField n) => Trail v n -> Point v n -> Path v n #

Convert a trail to a path with a particular starting point.

pathFromTrail :: (Metric v, OrderedField n) => Trail v n -> Path v n #

Convert a trail to a path beginning at the origin.

pathTrails :: Path v n -> [Located (Trail v n)] #

Extract the located trails making up a Path.

newtype Path (v :: Type -> Type) n #

A path is a (possibly empty) list of Located Trails. Hence, unlike trails, paths are not translationally invariant, and they form a monoid under superposition (placing one path on top of another) rather than concatenation.

Constructors

Path [Located (Trail v n)] 
Instances
Eq (v n) => Eq (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

(==) :: Path v n -> Path v n -> Bool #

(/=) :: Path v n -> Path v n -> Bool #

Ord (v n) => Ord (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

compare :: Path v n -> Path v n -> Ordering #

(<) :: Path v n -> Path v n -> Bool #

(<=) :: Path v n -> Path v n -> Bool #

(>) :: Path v n -> Path v n -> Bool #

(>=) :: Path v n -> Path v n -> Bool #

max :: Path v n -> Path v n -> Path v n #

min :: Path v n -> Path v n -> Path v n #

Show (v n) => Show (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

showsPrec :: Int -> Path v n -> ShowS #

show :: Path v n -> String #

showList :: [Path v n] -> ShowS #

Generic (Path v n) 
Instance details

Defined in Diagrams.Path

Associated Types

type Rep (Path v n) :: Type -> Type #

Methods

from :: Path v n -> Rep (Path v n) x #

to :: Rep (Path v n) x -> Path v n #

Semigroup (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

(<>) :: Path v n -> Path v n -> Path v n #

sconcat :: NonEmpty (Path v n) -> Path v n #

stimes :: Integral b => b -> Path v n -> Path v n #

Monoid (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

mempty :: Path v n #

mappend :: Path v n -> Path v n -> Path v n #

mconcat :: [Path v n] -> Path v n #

(OrderedField n, Metric v, Serialize (v n), Serialize (V (v n) (N (v n)))) => Serialize (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

put :: Putter (Path v n) #

get :: Get (Path v n) #

(Metric v, OrderedField n) => Juxtaposable (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

juxtapose :: Vn (Path v n) -> Path v n -> Path v n -> Path v n #

(Metric v, OrderedField n) => Enveloped (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

getEnvelope :: Path v n -> Envelope (V (Path v n)) (N (Path v n)) #

(HasLinearMap v, Metric v, OrderedField n) => Transformable (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

transform :: Transformation (V (Path v n)) (N (Path v n)) -> Path v n -> Path v n #

(Additive v, Num n) => HasOrigin (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

moveOriginTo :: Point (V (Path v n)) (N (Path v n)) -> Path v n -> Path v n #

ToPath (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Path v n -> Path (V (Path v n)) (N (Path v n)) #

(Metric v, OrderedField n) => TrailLike (Path v n)

Paths are trail-like; a trail can be used to construct a singleton path.

Instance details

Defined in Diagrams.Path

Methods

trailLike :: Located (Trail (V (Path v n)) (N (Path v n))) -> Path v n #

(Metric v, OrderedField n) => Alignable (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

alignBy' :: (InSpace v0 n0 (Path v n), Fractional n0, HasOrigin (Path v n)) => (v0 n0 -> Path v n -> Point v0 n0) -> v0 n0 -> n0 -> Path v n -> Path v n #

defaultBoundary :: (V (Path v n) ~ v0, N (Path v n) ~ n0) => v0 n0 -> Path v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (Path v n), Fractional n0, HasOrigin (Path v n)) => v0 n0 -> n0 -> Path v n -> Path v n #

(Metric v, OrderedField n) => Reversing (Path v n)

Same as reversePath.

Instance details

Defined in Diagrams.Path

Methods

reversing :: Path v n -> Path v n #

AsEmpty (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

_Empty :: Prism' (Path v n) () #

Wrapped (Path v n) 
Instance details

Defined in Diagrams.Path

Associated Types

type Unwrapped (Path v n) :: Type #

Methods

_Wrapped' :: Iso' (Path v n) (Unwrapped (Path v n)) #

(HasLinearMap v, Metric v, OrderedField n) => Renderable (Path v n) NullBackend 
Instance details

Defined in Diagrams.Path

Methods

render :: NullBackend -> Path v n -> Render NullBackend (V (Path v n)) (N (Path v n)) #

SVGFloat n => Renderable (Path V2 n) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> Path V2 n -> Render SVG (V (Path V2 n)) (N (Path V2 n)) #

(Metric v, Metric u, OrderedField n, r ~ Path u n) => Deformable (Path v n) r 
Instance details

Defined in Diagrams.Deform

Methods

deform' :: N (Path v n) -> Deformation (V (Path v n)) (V r) (N (Path v n)) -> Path v n -> r #

deform :: Deformation (V (Path v n)) (V r) (N (Path v n)) -> Path v n -> r #

Rewrapped (Path v n) (Path v' n') 
Instance details

Defined in Diagrams.Path

Snoc (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Snoc :: Prism (Path v n) (Path v' n') (Path v n, Located (Trail v n)) (Path v' n', Located (Trail v' n')) #

Cons (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Cons :: Prism (Path v n) (Path v' n') (Located (Trail v n), Path v n) (Located (Trail v' n'), Path v' n') #

Each (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

each :: Traversal (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) #

type Rep (Path v n) 
Instance details

Defined in Diagrams.Path

type Rep (Path v n) = D1 (MetaData "Path" "Diagrams.Path" "diagrams-lib-1.4.2.3-4IkVVBmK9qBElHMtgqeLQ1" True) (C1 (MetaCons "Path" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Located (Trail v n)])))
type V (Path v n) 
Instance details

Defined in Diagrams.Path

type V (Path v n) = v
type N (Path v n) 
Instance details

Defined in Diagrams.Path

type N (Path v n) = n
type Unwrapped (Path v n) 
Instance details

Defined in Diagrams.Path

type Unwrapped (Path v n) = [Located (Trail v n)]

class ToPath t where #

Type class for things that can be converted to a Path.

Note that this class is very different from TrailLike. TrailLike is usually the result of a library function to give you a convenient, polymorphic result (Path, Diagram etc.).

Methods

toPath :: t -> Path (V t) (N t) #

toPath takes something that can be converted to Path and returns the Path.

Instances
ToPath a => ToPath [a] 
Instance details

Defined in Diagrams.Path

Methods

toPath :: [a] -> Path (V [a]) (N [a]) #

ToPath (Located [Segment Closed v n]) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located [Segment Closed v n] -> Path (V (Located [Segment Closed v n])) (N (Located [Segment Closed v n])) #

ToPath (Located (Trail' l v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Trail' l v n) -> Path (V (Located (Trail' l v n))) (N (Located (Trail' l v n))) #

ToPath (Located (Trail v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Trail v n) -> Path (V (Located (Trail v n))) (N (Located (Trail v n))) #

ToPath (Located (Segment Closed v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Segment Closed v n) -> Path (V (Located (Segment Closed v n))) (N (Located (Segment Closed v n))) #

ToPath (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Path v n -> Path (V (Path v n)) (N (Path v n)) #

ToPath (Trail v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Trail v n -> Path (V (Trail v n)) (N (Trail v n)) #

ToPath (FixedSegment v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: FixedSegment v n -> Path (V (FixedSegment v n)) (N (FixedSegment v n)) #

ToPath (Trail' l v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Trail' l v n -> Path (V (Trail' l v n)) (N (Trail' l v n)) #

boundaryFromMay :: (Metric v, OrderedField n, Semigroup m) => Subdiagram b v n m -> v n -> Maybe (Point v n) #

Compute the furthest point on the boundary of a subdiagram, beginning from the location (local origin) of the subdiagram and moving in the direction of the given vector, or Nothing if there is no such point.

boundaryFrom :: (OrderedField n, Metric v, Semigroup m) => Subdiagram b v n m -> v n -> Point v n #

Compute the furthest point on the boundary of a subdiagram, beginning from the location (local origin) of the subdiagram and moving in the direction of the given vector. If there is no such point, the origin is returned; see also boundaryFromMay.

composeAligned #

Arguments

:: (Monoid' m, Floating n, Ord n, Metric v) 
=> (QDiagram b v n m -> QDiagram b v n m)

Alignment function

-> ([QDiagram b v n m] -> QDiagram b v n m)

Composition function

-> [QDiagram b v n m] 
-> QDiagram b v n m 

Compose a list of diagrams using the given composition function, first aligning them all according to the given alignment, but retain the local origin of the first diagram, as it would be if the composition function were applied directly. That is, composeAligned algn comp is equivalent to translate v . comp . map algn for some appropriate translation vector v.

Unfortunately, this only works for diagrams (and not, say, paths) because there is no most general type for alignment functions, and no generic way to find out what an alignment function does to the origin of things. (However, it should be possible to make a version of this function that works specifically on paths, if such a thing were deemed useful.)

alignedEx1 = (hsep 2 # composeAligned alignT) (map circle [1,3,5,2])
           # showOrigin
           # frame 0.5

alignedEx2 = (mconcat # composeAligned alignTL) [circle 1, square 1, triangle 1, pentagon 1]
           # showOrigin
           # frame 0.1

cat' :: (InSpace v n a, Metric v, Floating n, Juxtaposable a, Monoid' a, HasOrigin a) => v n -> CatOpts n -> [a] -> a #

Like cat, but taking an extra CatOpts arguments allowing the user to specify

  • The spacing method: catenation (uniform spacing between envelopes) or distribution (uniform spacing between local origins). The default is catenation.
  • The amount of separation between successive diagram envelopes/origins (depending on the spacing method). The default is 0.

CatOpts is an instance of Default, so with may be used for the second argument, as in cat' (1,2) (with & sep .~ 2).

Note that cat' v (with & catMethod .~ Distrib) === mconcat (distributing with a separation of 0 is the same as superimposing).

cat :: (InSpace v n a, Metric v, Floating n, Juxtaposable a, Monoid' a, HasOrigin a) => v n -> [a] -> a #

cat v positions a list of objects so that their local origins lie along a line in the direction of v. Successive objects will have their envelopes just touching. The local origin of the result will be the same as the local origin of the first object.

See also cat', which takes an extra options record allowing certain aspects of the operation to be tweaked.

sep :: Lens' (CatOpts n) n #

How much separation should be used between successive diagrams (default: 0)? When catMethod = Cat, this is the distance between envelopes; when catMethod = Distrib, this is the distance between origins.

catMethod :: Lens' (CatOpts n) CatMethod #

Which CatMethod should be used: normal catenation (default), or distribution?

atPoints :: (InSpace v n a, HasOrigin a, Monoid' a) => [Point v n] -> [a] -> a #

Curried version of position, takes a list of points and a list of objects.

position :: (InSpace v n a, HasOrigin a, Monoid' a) => [(Point v n, a)] -> a #

Position things absolutely: combine a list of objects (e.g. diagrams or paths) by assigning them absolute positions in the vector space of the combined object.

positionEx = position (zip (map mkPoint [-3, -2.8 .. 3]) (repeat spot))
  where spot      = circle 0.2 # fc black
        mkPoint :: Double -> P2 Double
        mkPoint x = p2 (x,x*x)

appends :: (Juxtaposable a, Monoid' a) => a -> [(Vn a, a)] -> a #

appends x ys appends each of the objects in ys to the object x in the corresponding direction. Note that each object in ys is positioned beside x without reference to the other objects in ys, so this is not the same as iterating beside.

appendsEx = appends c (zip (iterateN 6 (rotateBy (1/6)) unitX) (repeat c))
            # centerXY # pad 1.1
  where c = circle 1

atDirection :: (InSpace v n a, Metric v, Floating n, Juxtaposable a, Semigroup a) => Direction v n -> a -> a -> a #

Place two diagrams (or other juxtaposable objects) adjacent to one another, with the second diagram placed in the direction d from the first. The local origin of the resulting combined diagram is the same as the local origin of the first. See the documentation of beside for more information.

beside :: (Juxtaposable a, Semigroup a) => Vn a -> a -> a -> a #

Place two monoidal objects (i.e. diagrams, paths, animations...) next to each other along the given vector. In particular, place the second object so that the vector points from the local origin of the first object to the local origin of the second object, at a distance so that their envelopes are just tangent. The local origin of the new, combined object is the local origin of the first object (unless the first object is the identity element, in which case the second object is returned unchanged).

besideEx = beside (r2 (20,30))
                  (circle 1 # fc orange)
                  (circle 1.5 # fc purple)
           # showOrigin
           # centerXY # pad 1.1

Note that beside v is associative, so objects under beside v form a semigroup for any given vector v. In fact, they also form a monoid: mempty is clearly a right identity (beside v d1 mempty === d1), and there should also be a special case to make it a left identity, as described above.

In older versions of diagrams, beside put the local origin of the result at the point of tangency between the two inputs. That semantics can easily be recovered by performing an alignment on the first input before combining. That is, if beside' denotes the old semantics,

beside' v x1 x2 = beside v (x1 # align v) x2

To get something like beside v x1 x2 whose local origin is identified with that of x2 instead of x1, use beside (negateV v) x2 x1.

beneath :: (Metric v, OrderedField n, Monoid' m) => QDiagram b v n m -> QDiagram b v n m -> QDiagram b v n m infixl 6 #

beneath is just a convenient synonym for flip atop; that is, d1 `beneath` d2 is the diagram with d2 superimposed on top of d1.

intrudeEnvelope :: (Metric v, OrderedField n, Monoid' m) => v n -> QDiagram b v n m -> QDiagram b v n m #

intrudeEnvelope v d asymmetrically "intrudes" the envelope of a diagram away from the given direction. All parts of the envelope within 90 degrees of this direction are modified, offset inwards by the magnitude of the vector.

Note that this could create strange inverted envelopes, where diameter v d < 0 .

extrudeEnvelope :: (Metric v, OrderedField n, Monoid' m) => v n -> QDiagram b v n m -> QDiagram b v n m #

extrudeEnvelope v d asymmetrically "extrudes" the envelope of a diagram in the given direction. All parts of the envelope within 90 degrees of this direction are modified, offset outwards by the magnitude of the vector.

This works by offsetting the envelope distance proportionally to the cosine of the difference in angle, and leaving it unchanged when this factor is negative.

strut :: (Metric v, OrderedField n) => v n -> QDiagram b v n m #

strut v is a diagram which produces no output, but with respect to alignment and envelope acts like a 1-dimensional segment oriented along the vector v, with local origin at its center. (Note, however, that it has an empty trace; for 2D struts with a nonempty trace see strutR2 from Diagrams.TwoD.Combinators.) Useful for manually creating separation between two diagrams.

strutEx = (circle 1 ||| strut unitX ||| circle 1) # centerXY # pad 1.1

frame :: (Metric v, OrderedField n, Monoid' m) => n -> QDiagram b v n m -> QDiagram b v n m #

frame s increases the envelope of a diagram by and absolute amount s, s is in the local units of the diagram. This function is similar to pad, only it takes an absolute quantity and pre-centering should not be necessary.

pad :: (Metric v, OrderedField n, Monoid' m) => n -> QDiagram b v n m -> QDiagram b v n m #

pad s "pads" a diagram, expanding its envelope by a factor of s (factors between 0 and 1 can be used to shrink the envelope). Note that the envelope will expand with respect to the local origin, so if the origin is not centered the padding may appear "uneven". If this is not desired, the origin can be centered (using, e.g., centerXY for 2D diagrams) before applying pad.

phantom :: (InSpace v n a, Monoid' m, Enveloped a, Traced a) => a -> QDiagram b v n m #

phantom x produces a "phantom" diagram, which has the same envelope and trace as x but produces no output.

withTrace :: (InSpace v n a, Metric v, OrderedField n, Monoid' m, Traced a) => a -> QDiagram b v n m -> QDiagram b v n m #

Use the trace from some object as the trace for a diagram, in place of the diagram's default trace.

withEnvelope :: (InSpace v n a, Monoid' m, Enveloped a) => a -> QDiagram b v n m -> QDiagram b v n m #

Use the envelope from some object as the envelope for a diagram, in place of the diagram's default envelope.

sqNewEnv =
    circle 1 # fc green
    |||
    (    c # dashingG [0.1,0.1] 0 # lc white
      <> square 2 # withEnvelope (c :: D V2 Double) # fc blue
    )
c = circle 0.8
withEnvelopeEx = sqNewEnv # centerXY # pad 1.5

data CatMethod #

Methods for concatenating diagrams.

Constructors

Cat

Normal catenation: simply put diagrams next to one another (possibly with a certain distance in between each). The distance between successive diagram envelopes will be consistent; the distance between origins may vary if the diagrams are of different sizes.

Distrib

Distribution: place the local origins of diagrams at regular intervals. With this method, the distance between successive origins will be consistent but the distance between envelopes may not be. Indeed, depending on the amount of separation, diagrams may overlap.

data CatOpts n #

Options for cat'.

Instances
Num n => Default (CatOpts n) 
Instance details

Defined in Diagrams.Combinators

Methods

def :: CatOpts n #

ellipseXY :: (TrailLike t, V t ~ V2, N t ~ n, Transformable t) => n -> n -> t #

ellipseXY x y creates an axis-aligned ellipse, centered at the origin, with radius x along the x-axis and radius y along the y-axis.

ellipse :: (TrailLike t, V t ~ V2, N t ~ n, Transformable t) => n -> t #

ellipse e constructs an ellipse with eccentricity e by scaling the unit circle in the X direction. The eccentricity must be within the interval [0,1).

circle :: (TrailLike t, V t ~ V2, N t ~ n, Transformable t) => n -> t #

A circle of the given radius, centered at the origin. As a path, it begins at (r,0).

unitCircle :: (TrailLike t, V t ~ V2, N t ~ n) => t #

A circle of radius 1, with center at the origin.

annularWedge :: (TrailLike t, V t ~ V2, N t ~ n, RealFloat n) => n -> n -> Direction V2 n -> Angle n -> t #

Create an annular wedge of the given radii, beginning at the first direction and extending through the given sweep angle. The radius of the outer circle is given first.

annularWedgeEx = hsep 0.50
  [ annularWedge 1 0.5 xDir (1/4 @@ turn)
  , annularWedge 1 0.3 (rotate (7/30 @@ turn) xDir) (4/30 @@ turn)
  , annularWedge 1 0.7 (rotate (1/8 @@ turn) xDir) (3/4 @@ turn)
  ]
  # fc blue
  # centerXY # pad 1.1

arcBetween :: (TrailLike t, V t ~ V2, N t ~ n, RealFloat n) => Point V2 n -> Point V2 n -> n -> t #

arcBetween p q height creates an arc beginning at p and ending at q, with its midpoint at a distance of abs height away from the straight line from p to q. A positive value of height results in an arc to the left of the line from p to q; a negative value yields one to the right.

arcBetweenEx = mconcat
  [ arcBetween origin (p2 (2,1)) ht | ht <- [-0.2, -0.1 .. 0.2] ]
  # centerXY # pad 1.1

wedge :: (InSpace V2 n t, OrderedField n, TrailLike t) => n -> Direction V2 n -> Angle n -> t #

Create a circular wedge of the given radius, beginning at the given direction and extending through the given angle.

wedgeEx = hcat' (with & sep .~ 0.5)
  [ wedge 1 xDir (1/4 @@ turn)
  , wedge 1 (rotate (7/30 @@ turn) xDir) (4/30 @@ turn)
  , wedge 1 (rotate (1/8 @@ turn) xDir) (3/4 @@ turn)
  ]
  # fc blue
  # centerXY # pad 1.1

arcCW :: (InSpace V2 n t, RealFloat n, TrailLike t) => Direction V2 n -> Direction V2 n -> t #

Like arcAngleCCW but clockwise.

arcCCW :: (InSpace V2 n t, RealFloat n, TrailLike t) => Direction V2 n -> Direction V2 n -> t #

Given a start direction s and end direction e, arcCCW s e is the path of a radius one arc counterclockwise between the two directions. The origin of the arc is its center.

arc' :: (InSpace V2 n t, OrderedField n, TrailLike t) => n -> Direction V2 n -> Angle n -> t #

Given a radus r, a start direction d and an angle s, arc' r d s is the path of a radius (abs r) arc starting at d and sweeping out the angle s counterclockwise (for positive s). The origin of the arc is its center.

arc'Ex = mconcat [ arc' r xDir (1/4 @@ turn) | r <- [0.5,-1,1.5] ]
       # centerXY # pad 1.1

arc :: (InSpace V2 n t, OrderedField n, TrailLike t) => Direction V2 n -> Angle n -> t #

Given a start direction d and a sweep angle s, arc d s is the path of a radius one arc starting at d and sweeping out the angle s counterclockwise (for positive s). The resulting Trail is allowed to wrap around and overlap itself.

explodeTrail :: (V t ~ v, N t ~ n, TrailLike t) => Located (Trail v n) -> [t] #

Given a concretely located trail, "explode" it by turning each segment into its own separate trail. Useful for (say) applying a different style to each segment.

explodeTrailEx
  = pentagon 1
  # explodeTrail  -- generate a list of diagrams
  # zipWith lc [orange, green, yellow, red, blue]
  # mconcat # centerXY # pad 1.1

(~~) :: (V t ~ v, N t ~ n, TrailLike t) => Point v n -> Point v n -> t #

Create a linear trail between two given points.

twiddleEx
  = mconcat ((~~) <$> hexagon 1 <*> hexagon 1)
  # centerXY # pad 1.1

fromVertices :: TrailLike t => [Point (V t) (N t)] -> t #

Construct a trail-like thing connecting the given vertices with linear segments, with the first vertex as the location. If no vertices are given, the empty trail is used with the origin as the location.

import Data.List (transpose)

fromVerticesEx =
  ( [ pentagon 1
    , pentagon 1.3 # rotateBy (1/15)
    , pentagon 1.5 # rotateBy (2/15)
    ]
    # transpose
    # concat
  )
  # fromVertices
  # closeTrail # strokeTrail
  # centerXY # pad 1.1

fromLocOffsets :: (V t ~ v, N t ~ n, V (v n) ~ v, N (v n) ~ n, TrailLike t) => Located [v n] -> t #

Construct a trail-like thing of linear segments from a located list of offsets.

fromOffsets :: TrailLike t => [Vn t] -> t #

Construct a trail-like thing of linear segments from a list of offsets, with the origin as the location.

fromOffsetsEx = fromOffsets
  [ unitX
  , unitX # rotateBy (1/6)
  , unitX # rotateBy (-1/6)
  , unitX
  ]
  # centerXY # pad 1.1

fromLocSegments :: TrailLike t => Located [Segment Closed (V t) (N t)] -> t #

Construct a trail-like thing from a located list of segments.

fromSegments :: TrailLike t => [Segment Closed (V t) (N t)] -> t #

Construct a trail-like thing from a list of segments, with the origin as the location.

fromSegmentsEx = fromSegments
  [ straight (r2 (1,1))
  , bézier3  (r2 (1,1)) unitX unit_Y
  , straight unit_X
  ]
  # centerXY # pad 1.1

class (Metric (V t), OrderedField (N t)) => TrailLike t where #

A type class for trail-like things, i.e. things which can be constructed from a concretely located Trail. Instances include lines, loops, trails, paths, lists of vertices, two-dimensional Diagrams, and Located variants of all the above.

Usually, type variables with TrailLike constraints are used as the output types of functions, like

  foo :: (TrailLike t) => ... -> t
  

Functions with such a type can be used to construct trails, paths, diagrams, lists of points, and so on, depending on the context.

To write a function with a signature like the above, you can of course call trailLike directly; more typically, one would use one of the provided functions like fromOffsets, fromVertices, fromSegments, or ~~.

Methods

trailLike #

Arguments

:: Located (Trail (V t) (N t))

The concretely located trail. Note that some trail-like things (e.g. Trails) may ignore the location.

-> t 
Instances
(Metric v, OrderedField n) => TrailLike [Point v n]

A list of points is trail-like; this instance simply computes the vertices of the trail, using trailPoints.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V [Point v n]) (N [Point v n])) -> [Point v n] #

TrailLike t => TrailLike (TransInv t)

Translationally invariant things are trail-like as long as the underlying type is.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (TransInv t)) (N (TransInv t))) -> TransInv t #

TrailLike t => TrailLike (Located t)

Located things are trail-like as long as the underlying type is. The location is taken to be the location of the input located trail.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Located t)) (N (Located t))) -> Located t #

(Metric v, OrderedField n) => TrailLike (Path v n)

Paths are trail-like; a trail can be used to construct a singleton path.

Instance details

Defined in Diagrams.Path

Methods

trailLike :: Located (Trail (V (Path v n)) (N (Path v n))) -> Path v n #

(Metric v, OrderedField n) => TrailLike (Trail v n)

Trails are trail-like; the location is simply ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail v n)) (N (Trail v n))) -> Trail v n #

(Metric v, OrderedField n) => TrailLike (Trail' Line v n)

Lines are trail-like. If given a Trail which contains a loop, the loop will be cut with cutLoop. The location is ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail' Line v n)) (N (Trail' Line v n))) -> Trail' Line v n #

(Metric v, OrderedField n) => TrailLike (Trail' Loop v n)

Loops are trail-like. If given a Trail containing a line, the line will be turned into a loop using glueLine. The location is ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail' Loop v n)) (N (Trail' Loop v n))) -> Trail' Loop v n #

reverseLocLoop :: (Metric v, OrderedField n) => Located (Trail' Loop v n) -> Located (Trail' Loop v n) #

Reverse a concretely located loop. See reverseLocTrail. Note that this is guaranteed to preserve the location.

reverseLoop :: (Metric v, OrderedField n) => Trail' Loop v n -> Trail' Loop v n #

Reverse a loop. See reverseTrail.

reverseLocLine :: (Metric v, OrderedField n) => Located (Trail' Line v n) -> Located (Trail' Line v n) #

Reverse a concretely located line. See reverseLocTrail.

reverseLine :: (Metric v, OrderedField n) => Trail' Line v n -> Trail' Line v n #

Reverse a line. See reverseTrail.

reverseLocTrail :: (Metric v, OrderedField n) => Located (Trail v n) -> Located (Trail v n) #

Reverse a concretely located trail. The endpoint of the original trail becomes the starting point of the reversed trail, so the original and reversed trails comprise exactly the same set of points. reverseLocTrail is an involution, i.e.

  reverseLocTrail . reverseLocTrail === id
  

reverseTrail :: (Metric v, OrderedField n) => Trail v n -> Trail v n #

Reverse a trail. Semantically, if a trail given by a function t from [0,1] to vectors, then the reverse of t is given by t'(s) = t(1-s). reverseTrail is an involution, that is,

  reverseTrail . reverseTrail === id
  

trailLocSegments :: (Metric v, OrderedField n) => Located (Trail v n) -> [Located (Segment Closed v n)] #

Convert a concretely located trail into a list of located segments.

unfixTrail :: (Metric v, Ord n, Floating n) => [FixedSegment v n] -> Located (Trail v n) #

Convert a list of fixed segments into a located trail. Note that this may lose information: it throws away the locations of all but the first FixedSegment. This does not matter precisely when each FixedSegment begins where the previous one ends.

This is almost left inverse to fixTrail, that is, unfixTrail . fixTrail == id, except for the fact that unfixTrail will never yield a Loop. In the case of a loop, we instead have glueTrail . unfixTrail . fixTrail == id. On the other hand, it is not the case that fixTrail . unfixTrail == id since unfixTrail may lose information.

fixTrail :: (Metric v, OrderedField n) => Located (Trail v n) -> [FixedSegment v n] #

Convert a concretely located trail into a list of fixed segments. unfixTrail is almost its left inverse.

loopVertices :: (Metric v, OrderedField n) => Located (Trail' Loop v n) -> [Point v n] #

Same as loopVertices', with a default tolerance.

loopVertices' :: (Metric v, OrderedField n) => n -> Located (Trail' Loop v n) -> [Point v n] #

Extract the vertices of a concretely located loop. Note that the initial vertex is not repeated at the end. See trailVertices for more information.

lineVertices :: (Metric v, OrderedField n) => Located (Trail' Line v n) -> [Point v n] #

Like lineVertices', with a default tolerance.

lineVertices' :: (Metric v, OrderedField n) => n -> Located (Trail' Line v n) -> [Point v n] #

Extract the vertices of a concretely located line. See trailVertices for more information.

trailVertices :: (Metric v, OrderedField n) => Located (Trail v n) -> [Point v n] #

Like trailVertices', with a default tolerance.

trailVertices' :: (Metric v, OrderedField n) => n -> Located (Trail v n) -> [Point v n] #

Extract the vertices of a concretely located trail. Here a vertex is defined as a non-differentiable point on the trail, i.e. a sharp corner. (Vertices are thus a subset of the places where segments join; if you want all joins between segments, see trailPoints.) The tolerance determines how close the tangents of two segments must be at their endpoints to consider the transition point to be differentiable.

Note that for loops, the starting vertex will not be repeated at the end. If you want this behavior, you can use cutTrail to make the loop into a line first, which happens to repeat the same vertex at the start and end, e.g. with trailVertices . mapLoc cutTrail.

It does not make sense to ask for the vertices of a Trail by itself; if you want the vertices of a trail with the first vertex at, say, the origin, you can use trailVertices . (`at` origin).

lineOffset :: (Metric v, OrderedField n) => Trail' Line v n -> v n #

Compute the offset from the start of a line to the end. (Note, there is no corresponding loopOffset function because by definition it would be constantly zero.)

loopOffsets :: (Metric v, OrderedField n) => Trail' Loop v n -> [v n] #

Extract the offsets of the segments of a loop.

lineOffsets :: Trail' Line v n -> [v n] #

Extract the offsets of the segments of a line.

trailOffset :: (Metric v, OrderedField n) => Trail v n -> v n #

Compute the offset from the start of a trail to the end. Satisfies

  trailOffset === sumV . trailOffsets
  

but is more efficient.

trailOffsetEx = (strokeLine almostClosed <> showOffset) # centerXY # pad 1.1
  where showOffset = fromOffsets [trailOffset (wrapLine almostClosed)]
                   # strokeP # lc red

trailOffsets :: (Metric v, OrderedField n) => Trail v n -> [v n] #

Extract the offsets of the segments of a trail.

trailSegments :: (Metric v, OrderedField n) => Trail v n -> [Segment Closed v n] #

Extract the segments of a trail. If the trail is a loop it will first have cutLoop applied.

loopSegments :: Trail' Loop v n -> ([Segment Closed v n], Segment Open v n) #

Extract the segments comprising a loop: a list of closed segments, and one final open segment.

onLineSegments :: (Metric v, OrderedField n) => ([Segment Closed v n] -> [Segment Closed v n]) -> Trail' Line v n -> Trail' Line v n #

Modify a line by applying a function to its list of segments.

lineSegments :: Trail' Line v n -> [Segment Closed v n] #

Extract the segments comprising a line.

isLoop :: Trail v n -> Bool #

Determine whether a trail is a loop.

isLine :: Trail v n -> Bool #

Determine whether a trail is a line.

isTrailEmpty :: (Metric v, OrderedField n) => Trail v n -> Bool #

Test whether a trail is empty. Note that loops are never empty.

isLineEmpty :: (Metric v, OrderedField n) => Trail' Line v n -> Bool #

Test whether a line is empty.

cutTrail :: (Metric v, OrderedField n) => Trail v n -> Trail v n #

cutTrail is a variant of cutLoop for Trail; it is the is the identity on lines and performs cutLoop on loops.

cutLoop :: (Metric v, OrderedField n) => Trail' Loop v n -> Trail' Line v n #

Turn a loop into a line by "cutting" it at the common start/end point, resulting in a line which just happens to start and end at the same place.

cutLoop is right inverse to glueLine, that is,

  glueLine . cutLoop === id
  

closeTrail :: Trail v n -> Trail v n #

closeTrail is a variant of closeLine for Trail, which performs closeLine on lines and is the identity on loops.

closeLine :: Trail' Line v n -> Trail' Loop v n #

Make a line into a loop by adding a new linear segment from the line's end to its start.

closeLine does not have any particularly nice theoretical properties, but can be useful e.g. when you want to make a closed polygon out of a list of points where the initial point is not repeated at the end. To use glueLine, one would first have to duplicate the initial vertex, like

glueLine . lineFromVertices $ ps ++ [head ps]

Using closeLine, however, one can simply

closeLine . lineFromVertices $ ps

closeLineEx = pad 1.1 . centerXY . hcat' (with & sep .~ 1)
  $ [almostClosed # strokeLine, almostClosed # closeLine # strokeLoop]

glueTrail :: (Metric v, OrderedField n) => Trail v n -> Trail v n #

glueTrail is a variant of glueLine which works on Trails. It performs glueLine on lines and is the identity on loops.

glueLine :: (Metric v, OrderedField n) => Trail' Line v n -> Trail' Loop v n #

Make a line into a loop by "gluing" the endpoint to the starting point. In particular, the offset of the final segment is modified so that it ends at the starting point of the entire trail. Typically, you would first construct a line which you know happens to end where it starts, and then call glueLine to turn it into a loop.

glueLineEx = pad 1.1 . hsep 1
  $ [almostClosed # strokeLine, almostClosed # glueLine # strokeLoop]

almostClosed :: Trail' Line V2 Double
almostClosed = fromOffsets $ map r2 [(2, -1), (-3, -0.5), (-2, 1), (1, 0.5)]

glueLine is left inverse to cutLoop, that is,

  glueLine . cutLoop === id
  

trailFromVertices :: (Metric v, OrderedField n) => [Point v n] -> Trail v n #

trailFromVertices === wrapTrail . lineFromVertices, for conveniently constructing a Trail instead of a Trail' Line.

lineFromVertices :: (Metric v, OrderedField n) => [Point v n] -> Trail' Line v n #

Construct a line containing only linear segments from a list of vertices. Note that only the relative offsets between the vertices matters; the information about their absolute position will be discarded. That is, for all vectors v,

lineFromVertices === lineFromVertices . translate v

If you want to retain the position information, you should instead use the more general fromVertices function to construct, say, a Located (Trail' Line v) or a Located (Trail v).

import Diagrams.Coordinates
lineFromVerticesEx = pad 1.1 . centerXY . strokeLine
  $ lineFromVertices [origin, 0 ^& 1, 1 ^& 2, 5 ^& 1]

trailFromOffsets :: (Metric v, OrderedField n) => [v n] -> Trail v n #

trailFromOffsets === wrapTrail . lineFromOffsets, for conveniently constructing a Trail instead of a Trail' Line.

lineFromOffsets :: (Metric v, OrderedField n) => [v n] -> Trail' Line v n #

Construct a line containing only linear segments from a list of vectors, where each vector represents the offset from one vertex to the next. See also fromOffsets.

import Diagrams.Coordinates
lineFromOffsetsEx = strokeLine $ lineFromOffsets [ 2 ^& 1, 2 ^& (-1), 2 ^& 0.5 ]

trailFromSegments :: (Metric v, OrderedField n) => [Segment Closed v n] -> Trail v n #

trailFromSegments === wrapTrail . lineFromSegments, for conveniently constructing a Trail instead of a Trail'.

loopFromSegments :: (Metric v, OrderedField n) => [Segment Closed v n] -> Segment Open v n -> Trail' Loop v n #

Construct a loop from a list of closed segments and an open segment that completes the loop.

lineFromSegments :: (Metric v, OrderedField n) => [Segment Closed v n] -> Trail' Line v n #

Construct a line from a list of closed segments.

emptyTrail :: (Metric v, OrderedField n) => Trail v n #

A wrapped variant of emptyLine.

emptyLine :: (Metric v, OrderedField n) => Trail' Line v n #

The empty line, which is the identity for concatenation of lines.

wrapLoop :: Trail' Loop v n -> Trail v n #

Convert a loop into a Trail. This is the same as wrapTrail, but with a more specific type, which can occasionally be convenient for fixing the type of a polymorphic expression.

wrapLine :: Trail' Line v n -> Trail v n #

Convert a line into a Trail. This is the same as wrapTrail, but with a more specific type, which can occasionally be convenient for fixing the type of a polymorphic expression.

wrapTrail :: Trail' l v n -> Trail v n #

Convert a Trail' into a Trail, hiding the type-level distinction between lines and loops.

onLine :: (Metric v, OrderedField n) => (Trail' Line v n -> Trail' Line v n) -> Trail v n -> Trail v n #

Modify a Trail by specifying a transformation on lines. If the trail is a line, the transformation will be applied directly. If it is a loop, it will first be cut using cutLoop, the transformation applied, and then glued back into a loop with glueLine. That is,

  onLine f === onTrail f (glueLine . f . cutLoop)
  

Note that there is no corresponding onLoop function, because there is no nice way in general to convert a line into a loop, operate on it, and then convert back.

withLine :: (Metric v, OrderedField n) => (Trail' Line v n -> r) -> Trail v n -> r #

An eliminator for Trail based on eliminating lines: if the trail is a line, the given function is applied; if it is a loop, it is first converted to a line with cutLoop. That is,

withLine f === withTrail f (f . cutLoop)

onTrail :: (Trail' Line v n -> Trail' l1 v n) -> (Trail' Loop v n -> Trail' l2 v n) -> Trail v n -> Trail v n #

Modify a Trail, specifying two separate transformations for the cases of a line or a loop.

withTrail :: (Trail' Line v n -> r) -> (Trail' Loop v n -> r) -> Trail v n -> r #

A generic eliminator for Trail, taking functions specifying what to do in the case of a line or a loop.

_LocLoop :: Prism' (Located (Trail v n)) (Located (Trail' Loop v n)) #

Prism onto a Located Loop.

_LocLine :: Prism' (Located (Trail v n)) (Located (Trail' Line v n)) #

Prism onto a Located Line.

_Loop :: Prism' (Trail v n) (Trail' Loop v n) #

Prism onto a Loop.

_Line :: Prism' (Trail v n) (Trail' Line v n) #

Prism onto a Line.

getSegment :: t -> GetSegment t #

Create a GetSegment wrapper around a trail, after which you can call atParam, atStart, or atEnd to extract a segment.

withTrail' :: (Trail' Line v n -> r) -> (Trail' Loop v n -> r) -> Trail' l v n -> r #

A generic eliminator for Trail', taking functions specifying what to do in the case of a line or a loop.

offset :: (OrderedField n, Metric v, Measured (SegMeasure v n) t) => t -> v n #

Compute the total offset of anything measured by SegMeasure.

numSegs :: (Num c, Measured (SegMeasure v n) a) => a -> c #

Compute the number of segments of anything measured by SegMeasure (e.g. SegMeasure itself, Segment, SegTree, Trails...)

trailMeasure :: (SegMeasure v n :>: m, Measured (SegMeasure v n) t) => a -> (m -> a) -> t -> a #

Given a default result (to be used in the case of an empty trail), and a function to map a single measure to a result, extract the given measure for a trail and use it to compute a result. Put another way, lift a function on a single measure (along with a default value) to a function on an entire trail.

newtype SegTree (v :: Type -> Type) n #

A SegTree represents a sequence of closed segments, stored in a fingertree so we can easily recover various monoidal measures of the segments (number of segments, arc length, envelope...) and also easily slice and dice them according to the measures (e.g., split off the smallest number of segments from the beginning which have a combined arc length of at least 5).

Constructors

SegTree (FingerTree (SegMeasure v n) (Segment Closed v n)) 
Instances
Eq (v n) => Eq (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

(==) :: SegTree v n -> SegTree v n -> Bool #

(/=) :: SegTree v n -> SegTree v n -> Bool #

Ord (v n) => Ord (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

compare :: SegTree v n -> SegTree v n -> Ordering #

(<) :: SegTree v n -> SegTree v n -> Bool #

(<=) :: SegTree v n -> SegTree v n -> Bool #

(>) :: SegTree v n -> SegTree v n -> Bool #

(>=) :: SegTree v n -> SegTree v n -> Bool #

max :: SegTree v n -> SegTree v n -> SegTree v n #

min :: SegTree v n -> SegTree v n -> SegTree v n #

Show (v n) => Show (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

showsPrec :: Int -> SegTree v n -> ShowS #

show :: SegTree v n -> String #

showList :: [SegTree v n] -> ShowS #

(Ord n, Floating n, Metric v) => Semigroup (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

(<>) :: SegTree v n -> SegTree v n -> SegTree v n #

sconcat :: NonEmpty (SegTree v n) -> SegTree v n #

stimes :: Integral b => b -> SegTree v n -> SegTree v n #

(Floating n, Ord n, Metric v) => Monoid (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

mempty :: SegTree v n #

mappend :: SegTree v n -> SegTree v n -> SegTree v n #

mconcat :: [SegTree v n] -> SegTree v n #

(OrderedField n, Metric v, Serialize (v n)) => Serialize (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

put :: Putter (SegTree v n) #

get :: Get (SegTree v n) #

(Floating n, Ord n, Metric v) => Transformable (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

transform :: Transformation (V (SegTree v n)) (N (SegTree v n)) -> SegTree v n -> SegTree v n #

(Metric v, OrderedField n, Real n) => Parametric (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: SegTree v n -> N (SegTree v n) -> Codomain (SegTree v n) (N (SegTree v n)) #

Num n => DomainBounds (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

domainLower :: SegTree v n -> N (SegTree v n) #

domainUpper :: SegTree v n -> N (SegTree v n) #

(Metric v, OrderedField n, Real n) => EndValues (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: SegTree v n -> Codomain (SegTree v n) (N (SegTree v n)) #

atEnd :: SegTree v n -> Codomain (SegTree v n) (N (SegTree v n)) #

(Metric v, OrderedField n, Real n) => Sectionable (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

splitAtParam :: SegTree v n -> N (SegTree v n) -> (SegTree v n, SegTree v n) #

section :: SegTree v n -> N (SegTree v n) -> N (SegTree v n) -> SegTree v n #

reverseDomain :: SegTree v n -> SegTree v n #

(Metric v, OrderedField n, Real n) => HasArcLength (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (SegTree v n) -> SegTree v n -> Interval (N (SegTree v n)) #

arcLength :: N (SegTree v n) -> SegTree v n -> N (SegTree v n) #

stdArcLength :: SegTree v n -> N (SegTree v n) #

arcLengthToParam :: N (SegTree v n) -> SegTree v n -> N (SegTree v n) -> N (SegTree v n) #

stdArcLengthToParam :: SegTree v n -> N (SegTree v n) -> N (SegTree v n) #

Wrapped (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Associated Types

type Unwrapped (SegTree v n) :: Type #

Methods

_Wrapped' :: Iso' (SegTree v n) (Unwrapped (SegTree v n)) #

Rewrapped (SegTree v n) (SegTree v' n') 
Instance details

Defined in Diagrams.Trail

(Floating n, Ord n, Metric v) => Measured (SegMeasure v n) (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

measure :: SegTree v n -> SegMeasure v n #

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (SegTree v n) (SegTree u n') (SegTree v n, Segment Closed v n) (SegTree u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (SegTree v n) (SegTree u n') (Segment Closed v n, SegTree v n) (Segment Closed u n', SegTree u n') #

type V (SegTree v n) 
Instance details

Defined in Diagrams.Trail

type V (SegTree v n) = v
type N (SegTree v n) 
Instance details

Defined in Diagrams.Trail

type N (SegTree v n) = n
type Codomain (SegTree v n) 
Instance details

Defined in Diagrams.Trail

type Codomain (SegTree v n) = v
type Unwrapped (SegTree v n) 
Instance details

Defined in Diagrams.Trail

data Line #

Type tag for trails with distinct endpoints.

Instances
(Metric v, OrderedField n) => Parametric (GetSegment (Trail' Line v n))

Parameters less than 0 yield the first segment; parameters greater than 1 yield the last. A parameter exactly at the junction of two segments yields the second segment (i.e. the one with higher parameter values).

Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n) => EndValues (GetSegment (Trail' Line v n)) 
Instance details

Defined in Diagrams.Trail

(OrderedField n, Metric v) => Semigroup (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

(<>) :: Trail' Line v n -> Trail' Line v n -> Trail' Line v n #

sconcat :: NonEmpty (Trail' Line v n) -> Trail' Line v n #

stimes :: Integral b => b -> Trail' Line v n -> Trail' Line v n #

(Metric v, OrderedField n) => Monoid (Trail' Line v n)

The empty trail is constantly the zero vector. Trails are composed via concatenation. Note that only lines have a monoid instance (and not loops).

Instance details

Defined in Diagrams.Trail

Methods

mempty :: Trail' Line v n #

mappend :: Trail' Line v n -> Trail' Line v n -> Trail' Line v n #

mconcat :: [Trail' Line v n] -> Trail' Line v n #

(Metric v, OrderedField n) => TrailLike (Trail' Line v n)

Lines are trail-like. If given a Trail which contains a loop, the loop will be cut with cutLoop. The location is ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail' Line v n)) (N (Trail' Line v n))) -> Trail' Line v n #

(Metric v, OrderedField n, Real n) => Sectionable (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

splitAtParam :: Trail' Line v n -> N (Trail' Line v n) -> (Trail' Line v n, Trail' Line v n) #

section :: Trail' Line v n -> N (Trail' Line v n) -> N (Trail' Line v n) -> Trail' Line v n #

reverseDomain :: Trail' Line v n -> Trail' Line v n #

(Metric v, OrderedField n) => AsEmpty (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

_Empty :: Prism' (Trail' Line v n) () #

Wrapped (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Associated Types

type Unwrapped (Trail' Line v n) :: Type #

Methods

_Wrapped' :: Iso' (Trail' Line v n) (Unwrapped (Trail' Line v n)) #

Rewrapped (Trail' Line v n) (Trail' Line v' n') 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (Trail' Line v n) (Trail' Line u n') (Trail' Line v n, Segment Closed v n) (Trail' Line u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (Trail' Line v n) (Trail' Line u n') (Segment Closed v n, Trail' Line v n) (Segment Closed u n', Trail' Line u n') #

type Unwrapped (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

type Unwrapped (Trail' Line v n) = SegTree v n

data Loop #

Type tag for "loopy" trails which return to their starting point.

Instances
(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail' Loop v n))

The parameterization for loops wraps around, i.e. parameters are first reduced "mod 1".

Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail' Loop v n)) 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n) => TrailLike (Trail' Loop v n)

Loops are trail-like. If given a Trail containing a line, the line will be turned into a loop using glueLine. The location is ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail' Loop v n)) (N (Trail' Loop v n))) -> Trail' Loop v n #

data Trail' l (v :: Type -> Type) n where #

Intuitively, a trail is a single, continuous path through space. However, a trail has no fixed starting point; it merely specifies how to move through space, not where. For example, "take three steps forward, then turn right twenty degrees and take two more steps" is an intuitive analog of a trail; these instructions specify a path through space from any given starting location. To be precise, trails are translation-invariant; applying a translation to a trail has no effect.

A Located Trail, on the other hand, is a trail paired with some concrete starting location ("start at the big tree on the corner, then take three steps forward, ..."). See the Diagrams.Located module for help working with Located values.

Formally, the semantics of a trail is a continuous (though not necessarily differentiable) function from the real interval [0,1] to vectors in some vector space. (In contrast, a Located trail is a continuous function from [0,1] to points in some affine space.)

There are two types of trails:

  • A "line" (think of the "train", "subway", or "bus" variety, rather than the "straight" variety...) is a trail with two distinct endpoints. Actually, a line can have the same start and end points, but it is still drawn as if it had distinct endpoints: the two endpoints will have the appropriate end caps, and the trail will not be filled. Lines have a Monoid instance where mappend corresponds to concatenation, i.e. chaining one line after the other.
  • A "loop" is required to end in the same place it starts (that is, t(0) = t(1)). Loops are filled and are drawn as one continuous loop, with the appropriate join at the start/endpoint rather than end caps. Loops do not have a Monoid instance.

To convert between lines and loops, see glueLine, closeLine, and cutLoop.

To construct trails, see emptyTrail, trailFromSegments, trailFromVertices, trailFromOffsets, and friends. You can also get any type of trail from any function which returns a TrailLike (e.g. functions in Diagrams.TwoD.Shapes, and many others; see Diagrams.TrailLike).

To extract information from trails, see withLine, isLoop, trailSegments, trailOffsets, trailVertices, and friends.

Constructors

Line :: forall l (v :: Type -> Type) n. SegTree v n -> Trail' Line v n 
Loop :: forall l (v :: Type -> Type) n. SegTree v n -> Segment Open v n -> Trail' Loop v n 
Instances
ToPath (Located (Trail' l v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Trail' l v n) -> Path (V (Located (Trail' l v n))) (N (Located (Trail' l v n))) #

(Metric v, OrderedField n) => Parametric (GetSegment (Trail' Line v n))

Parameters less than 0 yield the first segment; parameters greater than 1 yield the last. A parameter exactly at the junction of two segments yields the second segment (i.e. the one with higher parameter values).

Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail' Loop v n))

The parameterization for loops wraps around, i.e. parameters are first reduced "mod 1".

Instance details

Defined in Diagrams.Trail

(Parametric (GetSegment (Trail' c v n)), Additive v, Num n) => Parametric (Tangent (Trail' c v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Tangent (Trail' c v n) -> N (Tangent (Trail' c v n)) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

(Metric v, OrderedField n) => EndValues (GetSegment (Trail' Line v n)) 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail' Loop v n)) 
Instance details

Defined in Diagrams.Trail

(Parametric (GetSegment (Trail' c v n)), EndValues (GetSegment (Trail' c v n)), Additive v, Num n) => EndValues (Tangent (Trail' c v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

atEnd :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

(Metric v, OrderedField n) => Reversing (Located (Trail' l v n))

Same as reverseLocLine or reverseLocLoop.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Located (Trail' l v n) -> Located (Trail' l v n) #

Eq (v n) => Eq (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

(==) :: Trail' l v n -> Trail' l v n -> Bool #

(/=) :: Trail' l v n -> Trail' l v n -> Bool #

Ord (v n) => Ord (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

compare :: Trail' l v n -> Trail' l v n -> Ordering #

(<) :: Trail' l v n -> Trail' l v n -> Bool #

(<=) :: Trail' l v n -> Trail' l v n -> Bool #

(>) :: Trail' l v n -> Trail' l v n -> Bool #

(>=) :: Trail' l v n -> Trail' l v n -> Bool #

max :: Trail' l v n -> Trail' l v n -> Trail' l v n #

min :: Trail' l v n -> Trail' l v n -> Trail' l v n #

Show (v n) => Show (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

showsPrec :: Int -> Trail' l v n -> ShowS #

show :: Trail' l v n -> String #

showList :: [Trail' l v n] -> ShowS #

(OrderedField n, Metric v) => Semigroup (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

(<>) :: Trail' Line v n -> Trail' Line v n -> Trail' Line v n #

sconcat :: NonEmpty (Trail' Line v n) -> Trail' Line v n #

stimes :: Integral b => b -> Trail' Line v n -> Trail' Line v n #

(Metric v, OrderedField n) => Monoid (Trail' Line v n)

The empty trail is constantly the zero vector. Trails are composed via concatenation. Note that only lines have a monoid instance (and not loops).

Instance details

Defined in Diagrams.Trail

Methods

mempty :: Trail' Line v n #

mappend :: Trail' Line v n -> Trail' Line v n -> Trail' Line v n #

mconcat :: [Trail' Line v n] -> Trail' Line v n #

(Metric v, OrderedField n) => Enveloped (Trail' l v n)

The envelope for a trail is based at the trail's start.

Instance details

Defined in Diagrams.Trail

Methods

getEnvelope :: Trail' l v n -> Envelope (V (Trail' l v n)) (N (Trail' l v n)) #

(HasLinearMap v, Metric v, OrderedField n) => Transformable (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

transform :: Transformation (V (Trail' l v n)) (N (Trail' l v n)) -> Trail' l v n -> Trail' l v n #

ToPath (Trail' l v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Trail' l v n -> Path (V (Trail' l v n)) (N (Trail' l v n)) #

(Metric v, OrderedField n) => TrailLike (Trail' Line v n)

Lines are trail-like. If given a Trail which contains a loop, the loop will be cut with cutLoop. The location is ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail' Line v n)) (N (Trail' Line v n))) -> Trail' Line v n #

(Metric v, OrderedField n) => TrailLike (Trail' Loop v n)

Loops are trail-like. If given a Trail containing a line, the line will be turned into a loop using glueLine. The location is ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail' Loop v n)) (N (Trail' Loop v n))) -> Trail' Loop v n #

(Metric v, OrderedField n, Real n) => Parametric (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Trail' l v n -> N (Trail' l v n) -> Codomain (Trail' l v n) (N (Trail' l v n)) #

Num n => DomainBounds (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

domainLower :: Trail' l v n -> N (Trail' l v n) #

domainUpper :: Trail' l v n -> N (Trail' l v n) #

(Metric v, OrderedField n, Real n) => EndValues (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Trail' l v n -> Codomain (Trail' l v n) (N (Trail' l v n)) #

atEnd :: Trail' l v n -> Codomain (Trail' l v n) (N (Trail' l v n)) #

(Metric v, OrderedField n, Real n) => Sectionable (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

splitAtParam :: Trail' Line v n -> N (Trail' Line v n) -> (Trail' Line v n, Trail' Line v n) #

section :: Trail' Line v n -> N (Trail' Line v n) -> N (Trail' Line v n) -> Trail' Line v n #

reverseDomain :: Trail' Line v n -> Trail' Line v n #

(Metric v, OrderedField n, Real n) => HasArcLength (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (Trail' l v n) -> Trail' l v n -> Interval (N (Trail' l v n)) #

arcLength :: N (Trail' l v n) -> Trail' l v n -> N (Trail' l v n) #

stdArcLength :: Trail' l v n -> N (Trail' l v n) #

arcLengthToParam :: N (Trail' l v n) -> Trail' l v n -> N (Trail' l v n) -> N (Trail' l v n) #

stdArcLengthToParam :: Trail' l v n -> N (Trail' l v n) -> N (Trail' l v n) #

(Metric v, OrderedField n) => Reversing (Trail' l v n)

Same as reverseLine or reverseLoop.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Trail' l v n -> Trail' l v n #

(Metric v, OrderedField n) => AsEmpty (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

_Empty :: Prism' (Trail' Line v n) () #

Wrapped (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Associated Types

type Unwrapped (Trail' Line v n) :: Type #

Methods

_Wrapped' :: Iso' (Trail' Line v n) (Unwrapped (Trail' Line v n)) #

(HasLinearMap v, Metric v, OrderedField n) => Renderable (Trail' o v n) NullBackend 
Instance details

Defined in Diagrams.Trail

Methods

render :: NullBackend -> Trail' o v n -> Render NullBackend (V (Trail' o v n)) (N (Trail' o v n)) #

Rewrapped (Trail' Line v n) (Trail' Line v' n') 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (Trail' Line v n) (Trail' Line u n') (Trail' Line v n, Segment Closed v n) (Trail' Line u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (Trail' Line v n) (Trail' Line u n') (Segment Closed v n, Trail' Line v n) (Segment Closed u n', Trail' Line u n') #

type V (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

type V (Trail' l v n) = v
type N (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

type N (Trail' l v n) = n
type Codomain (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

type Codomain (Trail' l v n) = v
type Unwrapped (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

type Unwrapped (Trail' Line v n) = SegTree v n

newtype GetSegment t #

A newtype wrapper around trails which exists solely for its Parametric, DomainBounds and EndValues instances. The idea is that if tr is a trail, you can write, e.g.

  getSegment tr atParam 0.6
  

or

  atStart (getSegment tr)
  

to get the segment at parameter 0.6 or the first segment in the trail, respectively.

The codomain for GetSegment, i.e. the result you get from calling atParam, atStart, or atEnd, is GetSegmentCodomain, which is a newtype wrapper around Maybe (v, Segment Closed v, AnIso' n n). Nothing results if the trail is empty; otherwise, you get:

  • the offset from the start of the trail to the beginning of the segment,
  • the segment itself, and
  • a reparameterization isomorphism: in the forward direction, it translates from parameters on the whole trail to a parameters on the segment. Note that for technical reasons you have to call cloneIso on the AnIso' value to get a real isomorphism you can use.

Constructors

GetSegment t 
Instances
(Metric v, OrderedField n) => Parametric (GetSegment (Trail' Line v n))

Parameters less than 0 yield the first segment; parameters greater than 1 yield the last. A parameter exactly at the junction of two segments yields the second segment (i.e. the one with higher parameter values).

Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail' Loop v n))

The parameterization for loops wraps around, i.e. parameters are first reduced "mod 1".

Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: GetSegment (Trail v n) -> N (GetSegment (Trail v n)) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

DomainBounds t => DomainBounds (GetSegment t) 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n) => EndValues (GetSegment (Trail' Line v n)) 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail' Loop v n)) 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

atEnd :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

type V (GetSegment t) 
Instance details

Defined in Diagrams.Trail

type V (GetSegment t) = V t
type N (GetSegment t) 
Instance details

Defined in Diagrams.Trail

type N (GetSegment t) = N t
type Codomain (GetSegment t) 
Instance details

Defined in Diagrams.Trail

newtype GetSegmentCodomain (v :: Type -> Type) n #

Constructors

GetSegmentCodomain (Maybe (v n, Segment Closed v n, AnIso' n n)) 

data Trail (v :: Type -> Type) n where #

Trail is a wrapper around Trail', hiding whether the underlying Trail' is a line or loop (though which it is can be recovered; see e.g. withTrail).

Constructors

Trail :: forall (v :: Type -> Type) n l. Trail' l v n -> Trail v n 
Instances
ToPath (Located (Trail v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Trail v n) -> Path (V (Located (Trail v n))) (N (Located (Trail v n))) #

(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: GetSegment (Trail v n) -> N (GetSegment (Trail v n)) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

(Metric v, OrderedField n, Real n) => Parametric (Tangent (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Tangent (Trail v n) -> N (Tangent (Trail v n)) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

atEnd :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

(Metric v, OrderedField n, Real n) => EndValues (Tangent (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

atEnd :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

(Metric v, OrderedField n) => Reversing (Located (Trail v n))

Same as reverseLocTrail.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Located (Trail v n) -> Located (Trail v n) #

(Metric v, Metric u, OrderedField n, r ~ Located (Trail u n)) => Deformable (Located (Trail v n)) r 
Instance details

Defined in Diagrams.Deform

Methods

deform' :: N (Located (Trail v n)) -> Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r #

deform :: Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r #

Eq (v n) => Eq (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

(==) :: Trail v n -> Trail v n -> Bool #

(/=) :: Trail v n -> Trail v n -> Bool #

Ord (v n) => Ord (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

compare :: Trail v n -> Trail v n -> Ordering #

(<) :: Trail v n -> Trail v n -> Bool #

(<=) :: Trail v n -> Trail v n -> Bool #

(>) :: Trail v n -> Trail v n -> Bool #

(>=) :: Trail v n -> Trail v n -> Bool #

max :: Trail v n -> Trail v n -> Trail v n #

min :: Trail v n -> Trail v n -> Trail v n #

Show (v n) => Show (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

showsPrec :: Int -> Trail v n -> ShowS #

show :: Trail v n -> String #

showList :: [Trail v n] -> ShowS #

(OrderedField n, Metric v) => Semigroup (Trail v n)

Two Trails are combined by first ensuring they are both lines (using cutTrail on loops) and then concatenating them. The result, in general, is a line. However, there is a special case for the empty line, which acts as the identity (so combining the empty line with a loop results in a loop).

Instance details

Defined in Diagrams.Trail

Methods

(<>) :: Trail v n -> Trail v n -> Trail v n #

sconcat :: NonEmpty (Trail v n) -> Trail v n #

stimes :: Integral b => b -> Trail v n -> Trail v n #

(Metric v, OrderedField n) => Monoid (Trail v n)

Trails are combined as described in the Semigroup instance; the empty line is the identity element, with special cases so that combining the empty line with a loop results in the unchanged loop (in all other cases loops will be cut). Note that this does, in fact, satisfy the monoid laws, though it is a bit strange. Mostly it is provided for convenience, so one can work directly with Trails instead of working with Trail' Lines and then wrapping.

Instance details

Defined in Diagrams.Trail

Methods

mempty :: Trail v n #

mappend :: Trail v n -> Trail v n -> Trail v n #

mconcat :: [Trail v n] -> Trail v n #

(Serialize (v n), OrderedField n, Metric v) => Serialize (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

put :: Putter (Trail v n) #

get :: Get (Trail v n) #

(Metric v, OrderedField n) => Enveloped (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

getEnvelope :: Trail v n -> Envelope (V (Trail v n)) (N (Trail v n)) #

(HasLinearMap v, Metric v, OrderedField n) => Transformable (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

transform :: Transformation (V (Trail v n)) (N (Trail v n)) -> Trail v n -> Trail v n #

ToPath (Trail v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Trail v n -> Path (V (Trail v n)) (N (Trail v n)) #

(Metric v, OrderedField n) => TrailLike (Trail v n)

Trails are trail-like; the location is simply ignored.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Trail v n)) (N (Trail v n))) -> Trail v n #

(Metric v, OrderedField n, Real n) => Parametric (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Trail v n -> N (Trail v n) -> Codomain (Trail v n) (N (Trail v n)) #

Num n => DomainBounds (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

domainLower :: Trail v n -> N (Trail v n) #

domainUpper :: Trail v n -> N (Trail v n) #

(Metric v, OrderedField n, Real n) => EndValues (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Trail v n -> Codomain (Trail v n) (N (Trail v n)) #

atEnd :: Trail v n -> Codomain (Trail v n) (N (Trail v n)) #

(Metric v, OrderedField n, Real n) => Sectionable (Trail v n)

Note that there is no Sectionable instance for Trail' Loop, because it does not make sense (splitting a loop at a parameter results in a single line, not two loops). However, it's convenient to have a Sectionable instance for Trail; if the Trail contains a loop the loop will first be cut and then splitAtParam called on the resulting line. This is semantically a bit silly, so please don't rely on it. (*E.g.* if this is really the behavior you want, consider first calling cutLoop yourself.)

Instance details

Defined in Diagrams.Trail

Methods

splitAtParam :: Trail v n -> N (Trail v n) -> (Trail v n, Trail v n) #

section :: Trail v n -> N (Trail v n) -> N (Trail v n) -> Trail v n #

reverseDomain :: Trail v n -> Trail v n #

(Metric v, OrderedField n, Real n) => HasArcLength (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (Trail v n) -> Trail v n -> Interval (N (Trail v n)) #

arcLength :: N (Trail v n) -> Trail v n -> N (Trail v n) #

stdArcLength :: Trail v n -> N (Trail v n) #

arcLengthToParam :: N (Trail v n) -> Trail v n -> N (Trail v n) -> N (Trail v n) #

stdArcLengthToParam :: Trail v n -> N (Trail v n) -> N (Trail v n) #

(Metric v, OrderedField n) => Reversing (Trail v n)

Same as reverseTrail.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Trail v n -> Trail v n #

(Metric v, OrderedField n) => AsEmpty (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

_Empty :: Prism' (Trail v n) () #

Wrapped (Trail v n) 
Instance details

Defined in Diagrams.Trail

Associated Types

type Unwrapped (Trail v n) :: Type #

Methods

_Wrapped' :: Iso' (Trail v n) (Unwrapped (Trail v n)) #

Rewrapped (Trail v n) (Trail v' n') 
Instance details

Defined in Diagrams.Trail

Snoc (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Snoc :: Prism (Path v n) (Path v' n') (Path v n, Located (Trail v n)) (Path v' n', Located (Trail v' n')) #

Cons (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Cons :: Prism (Path v n) (Path v' n') (Located (Trail v n), Path v n) (Located (Trail v' n'), Path v' n') #

Each (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

each :: Traversal (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) #

type V (Trail v n) 
Instance details

Defined in Diagrams.Trail

type V (Trail v n) = v
type N (Trail v n) 
Instance details

Defined in Diagrams.Trail

type N (Trail v n) = n
type Codomain (Trail v n) 
Instance details

Defined in Diagrams.Trail

type Codomain (Trail v n) = v
type Unwrapped (Trail v n) 
Instance details

Defined in Diagrams.Trail

type Unwrapped (Trail v n) = Either (Trail' Line v n) (Trail' Loop v n)

normalAtEnd :: (InSpace V2 n t, EndValues (Tangent t), Floating n) => t -> V2 n #

Compute the normal vector at the end of a segment or trail.

normalAtStart :: (InSpace V2 n t, EndValues (Tangent t), Floating n) => t -> V2 n #

Compute the normal vector at the start of a segment or trail.

normalAtParam :: (InSpace V2 n t, Parametric (Tangent t), Floating n) => t -> n -> V2 n #

Compute the (unit) normal vector to a segment or trail at a particular parameter.

Examples of more specific types this function can have include

  • Segment Closed V2 Double -> Double -> V2 Double
  • Trail' Line V2 Double -> Double -> V2 Double
  • Located (Trail V2 Double) -> Double -> V2 Double

See the instances listed for the Tangent newtype for more.

tangentAtEnd :: EndValues (Tangent t) => t -> Vn t #

Compute the tangent vector at the end of a segment or trail.

tangentAtStart :: EndValues (Tangent t) => t -> Vn t #

Compute the tangent vector at the start of a segment or trail.

tangentAtParam :: Parametric (Tangent t) => t -> N t -> Vn t #

Compute the tangent vector to a segment or trail at a particular parameter.

Examples of more specific types this function can have include

  • Segment Closed V2 -> Double -> V2 Double
  • Trail' Line V2 -> Double -> V2 Double
  • Located (Trail V2) -> Double -> V2 Double

See the instances listed for the Tangent newtype for more.

newtype Tangent t #

A newtype wrapper used to give different instances of Parametric and EndValues that compute tangent vectors.

Constructors

Tangent t 
Instances
(Parametric (GetSegment (Trail' c v n)), Additive v, Num n) => Parametric (Tangent (Trail' c v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Tangent (Trail' c v n) -> N (Tangent (Trail' c v n)) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

(Metric v, OrderedField n, Real n) => Parametric (Tangent (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Tangent (Trail v n) -> N (Tangent (Trail v n)) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

(Additive v, Num n) => Parametric (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

(Additive v, Num n) => Parametric (Tangent (FixedSegment v n)) 
Instance details

Defined in Diagrams.Tangent

Parametric (Tangent t) => Parametric (Tangent (Located t)) 
Instance details

Defined in Diagrams.Tangent

Methods

atParam :: Tangent (Located t) -> N (Tangent (Located t)) -> Codomain (Tangent (Located t)) (N (Tangent (Located t))) #

DomainBounds t => DomainBounds (Tangent t) 
Instance details

Defined in Diagrams.Tangent

Methods

domainLower :: Tangent t -> N (Tangent t) #

domainUpper :: Tangent t -> N (Tangent t) #

(Parametric (GetSegment (Trail' c v n)), EndValues (GetSegment (Trail' c v n)), Additive v, Num n) => EndValues (Tangent (Trail' c v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

atEnd :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

(Metric v, OrderedField n, Real n) => EndValues (Tangent (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

atEnd :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

(Additive v, Num n) => EndValues (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

(Additive v, Num n) => EndValues (Tangent (FixedSegment v n)) 
Instance details

Defined in Diagrams.Tangent

(DomainBounds t, EndValues (Tangent t)) => EndValues (Tangent (Located t)) 
Instance details

Defined in Diagrams.Tangent

type V (Tangent t) 
Instance details

Defined in Diagrams.Tangent

type V (Tangent t) = V t
type N (Tangent t) 
Instance details

Defined in Diagrams.Tangent

type N (Tangent t) = N t
type Codomain (Tangent t) 
Instance details

Defined in Diagrams.Tangent

type Codomain (Tangent t) = V t

type SegMeasure (v :: Type -> Type) n = SegCount ::: (ArcLength n ::: (OffsetEnvelope v n ::: ())) #

SegMeasure collects up all the measurements over a chain of segments.

getArcLengthBounded :: (Num n, Ord n) => n -> ArcLength n -> Interval n #

Given a specified tolerance, project out the cached arc length if it is accurate enough; otherwise call the generic arc length function with the given tolerance.

getArcLengthFun :: ArcLength n -> n -> Interval n #

Project out the generic arc length function taking the tolerance as an argument.

getArcLengthCached :: ArcLength n -> Interval n #

Project out the cached arc length, stored together with error bounds.

fixedSegIso :: (Num n, Additive v) => Iso' (FixedSegment v n) (Located (Segment Closed v n)) #

Use a FixedSegment to make an Iso between an a fixed segment and a located segment.

fromFixedSeg :: (Num n, Additive v) => FixedSegment v n -> Located (Segment Closed v n) #

Convert a FixedSegment back into a located Segment.

mkFixedSeg :: (Num n, Additive v) => Located (Segment Closed v n) -> FixedSegment v n #

Create a FixedSegment from a located Segment.

reverseSegment :: (Num n, Additive v) => Segment Closed v n -> Segment Closed v n #

Reverse the direction of a segment.

openCubic :: v n -> v n -> Segment Open v n #

An open cubic segment. This means the trail makes a cubic bézier with control vectors v1 and v2 to form a loop.

openLinear :: Segment Open v n #

An open linear segment. This means the trail makes a straight line from the last segment the beginning to form a loop.

segOffset :: Segment Closed v n -> v n #

Compute the offset from the start of a segment to the end. Note that in the case of a Bézier segment this is not the same as the length of the curve itself; for that, see arcLength.

bézier3 :: v n -> v n -> v n -> Segment Closed v n #

bézier3 is the same as bezier3, but with more snobbery.

bezier3 :: v n -> v n -> v n -> Segment Closed v n #

bezier3 c1 c2 x constructs a translationally invariant cubic Bézier curve where the offsets from the first endpoint to the first and second control point and endpoint are respectively given by c1, c2, and x.

straight :: v n -> Segment Closed v n #

straight v constructs a translationally invariant linear segment with direction and length given by the vector v.

mapSegmentVectors :: (v n -> v' n') -> Segment c v n -> Segment c v' n' #

Map over the vectors of each segment.

data Open #

Type tag for open segments.

Instances
Serialize (v n) => Serialize (Segment Open v n) 
Instance details

Defined in Diagrams.Segment

Methods

put :: Putter (Segment Open v n) #

get :: Get (Segment Open v n) #

data Closed #

Type tag for closed segments.

Instances
ToPath (Located [Segment Closed v n]) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located [Segment Closed v n] -> Path (V (Located [Segment Closed v n])) (N (Located [Segment Closed v n])) #

ToPath (Located (Segment Closed v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Segment Closed v n) -> Path (V (Located (Segment Closed v n))) (N (Located (Segment Closed v n))) #

(Additive v, Num n) => Parametric (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

(Additive v, Num n) => EndValues (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (SegTree v n) (SegTree u n') (SegTree v n, Segment Closed v n) (SegTree u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (SegTree v n) (SegTree u n') (Segment Closed v n, SegTree v n) (Segment Closed u n', SegTree u n') #

(OrderedField n, Metric v) => Measured (SegMeasure v n) (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: Segment Closed v n -> SegMeasure v n #

Serialize (v n) => Serialize (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

put :: Putter (Segment Closed v n) #

get :: Get (Segment Closed v n) #

(Metric v, OrderedField n) => Enveloped (Segment Closed v n)

The envelope for a segment is based at the segment's start.

Instance details

Defined in Diagrams.Segment

Methods

getEnvelope :: Segment Closed v n -> Envelope (V (Segment Closed v n)) (N (Segment Closed v n)) #

(Additive v, Num n) => Parametric (Segment Closed v n)

atParam yields a parametrized view of segments as continuous functions [0,1] -> v, which give the offset from the start of the segment for each value of the parameter between 0 and 1. It is designed to be used infix, like seg `atParam` 0.5.

Instance details

Defined in Diagrams.Segment

Methods

atParam :: Segment Closed v n -> N (Segment Closed v n) -> Codomain (Segment Closed v n) (N (Segment Closed v n)) #

Num n => DomainBounds (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Num n) => EndValues (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Fractional n) => Sectionable (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n) => HasArcLength (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Num n) => Reversing (Segment Closed v n)

Reverse the direction of a segment.

Instance details

Defined in Diagrams.Segment

Methods

reversing :: Segment Closed v n -> Segment Closed v n #

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (Trail' Line v n) (Trail' Line u n') (Trail' Line v n, Segment Closed v n) (Trail' Line u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (Trail' Line v n) (Trail' Line u n') (Segment Closed v n, Trail' Line v n) (Segment Closed u n', Trail' Line u n') #

type Codomain (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

type Codomain (Segment Closed v n) = v

data Offset c (v :: Type -> Type) n where #

The offset of a segment is the vector from its starting point to its end. The offset for an open segment is determined by the context, i.e. its endpoint is not fixed. The offset for a closed segment is stored explicitly, i.e. its endpoint is at a fixed offset from its start.

Constructors

OffsetOpen :: forall c (v :: Type -> Type) n. Offset Open v n 
OffsetClosed :: forall c (v :: Type -> Type) n. v n -> Offset Closed v n 
Instances
Functor v => Functor (Offset c v) 
Instance details

Defined in Diagrams.Segment

Methods

fmap :: (a -> b) -> Offset c v a -> Offset c v b #

(<$) :: a -> Offset c v b -> Offset c v a #

Eq (v n) => Eq (Offset c v n) 
Instance details

Defined in Diagrams.Segment

Methods

(==) :: Offset c v n -> Offset c v n -> Bool #

(/=) :: Offset c v n -> Offset c v n -> Bool #

Ord (v n) => Ord (Offset c v n) 
Instance details

Defined in Diagrams.Segment

Methods

compare :: Offset c v n -> Offset c v n -> Ordering #

(<) :: Offset c v n -> Offset c v n -> Bool #

(<=) :: Offset c v n -> Offset c v n -> Bool #

(>) :: Offset c v n -> Offset c v n -> Bool #

(>=) :: Offset c v n -> Offset c v n -> Bool #

max :: Offset c v n -> Offset c v n -> Offset c v n #

min :: Offset c v n -> Offset c v n -> Offset c v n #

Show (v n) => Show (Offset c v n) 
Instance details

Defined in Diagrams.Segment

Methods

showsPrec :: Int -> Offset c v n -> ShowS #

show :: Offset c v n -> String #

showList :: [Offset c v n] -> ShowS #

Transformable (Offset c v n) 
Instance details

Defined in Diagrams.Segment

Methods

transform :: Transformation (V (Offset c v n)) (N (Offset c v n)) -> Offset c v n -> Offset c v n #

(Additive v, Num n) => Reversing (Offset c v n)

Reverses the direction of closed offsets.

Instance details

Defined in Diagrams.Segment

Methods

reversing :: Offset c v n -> Offset c v n #

Each (Offset c v n) (Offset c v' n') (v n) (v' n') 
Instance details

Defined in Diagrams.Segment

Methods

each :: Traversal (Offset c v n) (Offset c v' n') (v n) (v' n') #

type V (Offset c v n) 
Instance details

Defined in Diagrams.Segment

type V (Offset c v n) = v
type N (Offset c v n) 
Instance details

Defined in Diagrams.Segment

type N (Offset c v n) = n

data Segment c (v :: Type -> Type) n #

The atomic constituents of the concrete representation currently used for trails are segments, currently limited to single straight lines or cubic Bézier curves. Segments are translationally invariant, that is, they have no particular "location" and are unaffected by translations. They are, however, affected by other transformations such as rotations and scales.

Constructors

Linear !(Offset c v n)

A linear segment with given offset.

Cubic !(v n) !(v n) !(Offset c v n)

A cubic Bézier segment specified by three offsets from the starting point to the first control point, second control point, and ending point, respectively.

Instances
ToPath (Located [Segment Closed v n]) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located [Segment Closed v n] -> Path (V (Located [Segment Closed v n])) (N (Located [Segment Closed v n])) #

ToPath (Located (Segment Closed v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Segment Closed v n) -> Path (V (Located (Segment Closed v n))) (N (Located (Segment Closed v n))) #

(Additive v, Num n) => Parametric (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

(Additive v, Num n) => EndValues (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

Functor v => Functor (Segment c v) 
Instance details

Defined in Diagrams.Segment

Methods

fmap :: (a -> b) -> Segment c v a -> Segment c v b #

(<$) :: a -> Segment c v b -> Segment c v a #

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (SegTree v n) (SegTree u n') (SegTree v n, Segment Closed v n) (SegTree u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (SegTree v n) (SegTree u n') (Segment Closed v n, SegTree v n) (Segment Closed u n', SegTree u n') #

(OrderedField n, Metric v) => Measured (SegMeasure v n) (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: Segment Closed v n -> SegMeasure v n #

Eq (v n) => Eq (Segment c v n) 
Instance details

Defined in Diagrams.Segment

Methods

(==) :: Segment c v n -> Segment c v n -> Bool #

(/=) :: Segment c v n -> Segment c v n -> Bool #

Ord (v n) => Ord (Segment c v n) 
Instance details

Defined in Diagrams.Segment

Methods

compare :: Segment c v n -> Segment c v n -> Ordering #

(<) :: Segment c v n -> Segment c v n -> Bool #

(<=) :: Segment c v n -> Segment c v n -> Bool #

(>) :: Segment c v n -> Segment c v n -> Bool #

(>=) :: Segment c v n -> Segment c v n -> Bool #

max :: Segment c v n -> Segment c v n -> Segment c v n #

min :: Segment c v n -> Segment c v n -> Segment c v n #

Show (v n) => Show (Segment c v n) 
Instance details

Defined in Diagrams.Segment

Methods

showsPrec :: Int -> Segment c v n -> ShowS #

show :: Segment c v n -> String #

showList :: [Segment c v n] -> ShowS #

Serialize (v n) => Serialize (Segment Open v n) 
Instance details

Defined in Diagrams.Segment

Methods

put :: Putter (Segment Open v n) #

get :: Get (Segment Open v n) #

Serialize (v n) => Serialize (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

put :: Putter (Segment Closed v n) #

get :: Get (Segment Closed v n) #

(Metric v, OrderedField n) => Enveloped (Segment Closed v n)

The envelope for a segment is based at the segment's start.

Instance details

Defined in Diagrams.Segment

Methods

getEnvelope :: Segment Closed v n -> Envelope (V (Segment Closed v n)) (N (Segment Closed v n)) #

Transformable (Segment c v n) 
Instance details

Defined in Diagrams.Segment

Methods

transform :: Transformation (V (Segment c v n)) (N (Segment c v n)) -> Segment c v n -> Segment c v n #

(Additive v, Num n) => Parametric (Segment Closed v n)

atParam yields a parametrized view of segments as continuous functions [0,1] -> v, which give the offset from the start of the segment for each value of the parameter between 0 and 1. It is designed to be used infix, like seg `atParam` 0.5.

Instance details

Defined in Diagrams.Segment

Methods

atParam :: Segment Closed v n -> N (Segment Closed v n) -> Codomain (Segment Closed v n) (N (Segment Closed v n)) #

Num n => DomainBounds (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Num n) => EndValues (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Fractional n) => Sectionable (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n) => HasArcLength (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Num n) => Reversing (Segment Closed v n)

Reverse the direction of a segment.

Instance details

Defined in Diagrams.Segment

Methods

reversing :: Segment Closed v n -> Segment Closed v n #

Renderable (Segment c v n) NullBackend 
Instance details

Defined in Diagrams.Segment

Methods

render :: NullBackend -> Segment c v n -> Render NullBackend (V (Segment c v n)) (N (Segment c v n)) #

Each (Segment c v n) (Segment c v' n') (v n) (v' n') 
Instance details

Defined in Diagrams.Segment

Methods

each :: Traversal (Segment c v n) (Segment c v' n') (v n) (v' n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (Trail' Line v n) (Trail' Line u n') (Trail' Line v n, Segment Closed v n) (Trail' Line u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (Trail' Line v n) (Trail' Line u n') (Segment Closed v n, Trail' Line v n) (Segment Closed u n', Trail' Line u n') #

type V (Segment c v n) 
Instance details

Defined in Diagrams.Segment

type V (Segment c v n) = v
type N (Segment c v n) 
Instance details

Defined in Diagrams.Segment

type N (Segment c v n) = n
type Codomain (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

type Codomain (Segment Closed v n) = v

data FixedSegment (v :: Type -> Type) n #

FixedSegments are like Segments except that they have absolute locations. FixedSegment v is isomorphic to Located (Segment Closed v), as witnessed by mkFixedSeg and fromFixedSeg, but FixedSegment is convenient when one needs the absolute locations of the vertices and control points.

Constructors

FLinear (Point v n) (Point v n) 
FCubic (Point v n) (Point v n) (Point v n) (Point v n) 
Instances
(Additive v, Num n) => Parametric (Tangent (FixedSegment v n)) 
Instance details

Defined in Diagrams.Tangent

(Additive v, Num n) => EndValues (Tangent (FixedSegment v n)) 
Instance details

Defined in Diagrams.Tangent

Show (v n) => Show (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n) => Enveloped (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Methods

getEnvelope :: FixedSegment v n -> Envelope (V (FixedSegment v n)) (N (FixedSegment v n)) #

(Additive v, Num n) => Transformable (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Num n) => HasOrigin (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Methods

moveOriginTo :: Point (V (FixedSegment v n)) (N (FixedSegment v n)) -> FixedSegment v n -> FixedSegment v n #

ToPath (FixedSegment v n) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: FixedSegment v n -> Path (V (FixedSegment v n)) (N (FixedSegment v n)) #

(Additive v, Num n) => Parametric (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Methods

atParam :: FixedSegment v n -> N (FixedSegment v n) -> Codomain (FixedSegment v n) (N (FixedSegment v n)) #

Num n => DomainBounds (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Num n) => EndValues (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Additive v, Fractional n) => Sectionable (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n) => HasArcLength (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Reversing (FixedSegment v n)

Reverses the control points.

Instance details

Defined in Diagrams.Segment

Methods

reversing :: FixedSegment v n -> FixedSegment v n #

Each (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') 
Instance details

Defined in Diagrams.Segment

Methods

each :: Traversal (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') #

type V (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

type V (FixedSegment v n) = v
type N (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

type N (FixedSegment v n) = n
type Codomain (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

type Codomain (FixedSegment v n) = Point v

newtype SegCount #

A type to track the count of segments in a Trail.

Constructors

SegCount (Sum Int) 
Instances
Semigroup SegCount 
Instance details

Defined in Diagrams.Segment

Monoid SegCount 
Instance details

Defined in Diagrams.Segment

Wrapped SegCount 
Instance details

Defined in Diagrams.Segment

Associated Types

type Unwrapped SegCount :: Type #

Rewrapped SegCount SegCount 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n) => Measured (SegMeasure v n) (SegMeasure v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: SegMeasure v n -> SegMeasure v n #

(Floating n, Ord n, Metric v) => Measured (SegMeasure v n) (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

measure :: SegTree v n -> SegMeasure v n #

(OrderedField n, Metric v) => Measured (SegMeasure v n) (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: Segment Closed v n -> SegMeasure v n #

type Unwrapped SegCount 
Instance details

Defined in Diagrams.Segment

newtype ArcLength n #

A type to represent the total arc length of a chain of segments. The first component is a "standard" arc length, computed to within a tolerance of 10e-6. The second component is a generic arc length function taking the tolerance as an argument.

Constructors

ArcLength (Sum (Interval n), n -> Sum (Interval n)) 
Instances
(Num n, Ord n) => Semigroup (ArcLength n) 
Instance details

Defined in Diagrams.Segment

Methods

(<>) :: ArcLength n -> ArcLength n -> ArcLength n #

sconcat :: NonEmpty (ArcLength n) -> ArcLength n #

stimes :: Integral b => b -> ArcLength n -> ArcLength n #

(Num n, Ord n) => Monoid (ArcLength n) 
Instance details

Defined in Diagrams.Segment

Wrapped (ArcLength n) 
Instance details

Defined in Diagrams.Segment

Associated Types

type Unwrapped (ArcLength n) :: Type #

Rewrapped (ArcLength n) (ArcLength n') 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n) => Measured (SegMeasure v n) (SegMeasure v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: SegMeasure v n -> SegMeasure v n #

(Floating n, Ord n, Metric v) => Measured (SegMeasure v n) (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

measure :: SegTree v n -> SegMeasure v n #

(OrderedField n, Metric v) => Measured (SegMeasure v n) (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: Segment Closed v n -> SegMeasure v n #

type Unwrapped (ArcLength n) 
Instance details

Defined in Diagrams.Segment

type Unwrapped (ArcLength n) = (Sum (Interval n), n -> Sum (Interval n))

newtype TotalOffset (v :: Type -> Type) n #

A type to represent the total cumulative offset of a chain of segments.

Constructors

TotalOffset (v n) 
Instances
(Num n, Additive v) => Semigroup (TotalOffset v n) 
Instance details

Defined in Diagrams.Segment

Methods

(<>) :: TotalOffset v n -> TotalOffset v n -> TotalOffset v n #

sconcat :: NonEmpty (TotalOffset v n) -> TotalOffset v n #

stimes :: Integral b => b -> TotalOffset v n -> TotalOffset v n #

(Num n, Additive v) => Monoid (TotalOffset v n) 
Instance details

Defined in Diagrams.Segment

Methods

mempty :: TotalOffset v n #

mappend :: TotalOffset v n -> TotalOffset v n -> TotalOffset v n #

mconcat :: [TotalOffset v n] -> TotalOffset v n #

Wrapped (TotalOffset v n) 
Instance details

Defined in Diagrams.Segment

Associated Types

type Unwrapped (TotalOffset v n) :: Type #

Rewrapped (TotalOffset v n) (TotalOffset v' n') 
Instance details

Defined in Diagrams.Segment

type Unwrapped (TotalOffset v n) 
Instance details

Defined in Diagrams.Segment

type Unwrapped (TotalOffset v n) = v n

data OffsetEnvelope (v :: Type -> Type) n #

A type to represent the offset and envelope of a chain of segments. They have to be paired into one data structure, since combining the envelopes of two consecutive chains needs to take the offset of the first into account.

Constructors

OffsetEnvelope 

Fields

Instances
(Metric v, OrderedField n) => Semigroup (OffsetEnvelope v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n) => Measured (SegMeasure v n) (SegMeasure v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: SegMeasure v n -> SegMeasure v n #

(Floating n, Ord n, Metric v) => Measured (SegMeasure v n) (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

measure :: SegTree v n -> SegMeasure v n #

(OrderedField n, Metric v) => Measured (SegMeasure v n) (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

Methods

measure :: Segment Closed v n -> SegMeasure v n #

_loc :: Lens' (Located a) (Point (V a) (N a)) #

Lens onto the location of something Located.

located :: SameSpace a b => Lens (Located a) (Located b) a b #

A lens giving access to the object within a Located wrapper.

mapLoc :: SameSpace a b => (a -> b) -> Located a -> Located b #

Located is not a Functor, since changing the type could change the type of the associated vector space, in which case the associated location would no longer have the right type. mapLoc has an extra constraint specifying that the vector space must stay the same.

(Technically, one can say that for every vector space v, Located is a little-f (endo)functor on the category of types with associated vector space v; but that is not covered by the standard Functor class.)

viewLoc :: Located a -> (Point (V a) (N a), a) #

Deconstruct a Located a into a location and a value of type a. viewLoc can be especially useful in conjunction with the ViewPatterns extension.

at :: a -> Point (V a) (N a) -> Located a infix 5 #

Construct a Located a from a value of type a and a location. at is intended to be used infix, like x `at` origin.

data Located a #

"Located" things, i.e. things with a concrete location: intuitively, Located a ~ (Point, a). Wrapping a translationally invariant thing (e.g. a Segment or Trail) in Located pins it down to a particular location and makes it no longer translationally invariant.

Located is intentionally abstract. To construct Located values, use at. To destruct, use viewLoc, unLoc, or loc. To map, use mapLoc.

Much of the utility of having a concrete type for the Located concept lies in the type class instances we can give it. The HasOrigin, Transformable, Enveloped, Traced, and TrailLike instances are particularly useful; see the documented instances below for more information.

Constructors

Loc 

Fields

  • loc :: Point (V a) (N a)

    Project out the location of a Located value.

  • unLoc :: a

    Project the value of type a out of a Located a, discarding the location.

Instances
(Eq (V a (N a)), Eq a) => Eq (Located a) 
Instance details

Defined in Diagrams.Located

Methods

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

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

(Ord (V a (N a)), Ord a) => Ord (Located a) 
Instance details

Defined in Diagrams.Located

Methods

compare :: Located a -> Located a -> Ordering #

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

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

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

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

max :: Located a -> Located a -> Located a #

min :: Located a -> Located a -> Located a #

(Read (V a (N a)), Read a) => Read (Located a) 
Instance details

Defined in Diagrams.Located

(Show (V a (N a)), Show a) => Show (Located a) 
Instance details

Defined in Diagrams.Located

Methods

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

show :: Located a -> String #

showList :: [Located a] -> ShowS #

Generic (Located a) 
Instance details

Defined in Diagrams.Located

Associated Types

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

Methods

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

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

(Serialize a, Serialize (V a (N a))) => Serialize (Located a) 
Instance details

Defined in Diagrams.Located

Methods

put :: Putter (Located a) #

get :: Get (Located a) #

Enveloped a => Juxtaposable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

juxtapose :: Vn (Located a) -> Located a -> Located a -> Located a #

Enveloped a => Enveloped (Located a)

The envelope of a Located a is the envelope of the a, translated to the location.

Instance details

Defined in Diagrams.Located

Methods

getEnvelope :: Located a -> Envelope (V (Located a)) (N (Located a)) #

(Traced a, Num (N a)) => Traced (Located a)

The trace of a Located a is the trace of the a, translated to the location.

Instance details

Defined in Diagrams.Located

Methods

getTrace :: Located a -> Trace (V (Located a)) (N (Located a)) #

Qualifiable a => Qualifiable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

(.>>) :: IsName a0 => a0 -> Located a -> Located a #

(Additive (V a), Num (N a), Transformable a) => Transformable (Located a)

Applying a transformation t to a Located a results in the transformation being applied to the location, and the linear portion of t being applied to the value of type a (i.e. it is not translated).

Instance details

Defined in Diagrams.Located

Methods

transform :: Transformation (V (Located a)) (N (Located a)) -> Located a -> Located a #

(Num (N a), Additive (V a)) => HasOrigin (Located a)

Located a is an instance of HasOrigin whether a is or not. In particular, translating a Located a simply translates the associated point (and does not affect the value of type a).

Instance details

Defined in Diagrams.Located

Methods

moveOriginTo :: Point (V (Located a)) (N (Located a)) -> Located a -> Located a #

ToPath (Located [Segment Closed v n]) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located [Segment Closed v n] -> Path (V (Located [Segment Closed v n])) (N (Located [Segment Closed v n])) #

ToPath (Located (Trail' l v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Trail' l v n) -> Path (V (Located (Trail' l v n))) (N (Located (Trail' l v n))) #

ToPath (Located (Trail v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Trail v n) -> Path (V (Located (Trail v n))) (N (Located (Trail v n))) #

ToPath (Located (Segment Closed v n)) 
Instance details

Defined in Diagrams.Path

Methods

toPath :: Located (Segment Closed v n) -> Path (V (Located (Segment Closed v n))) (N (Located (Segment Closed v n))) #

TrailLike t => TrailLike (Located t)

Located things are trail-like as long as the underlying type is. The location is taken to be the location of the input located trail.

Instance details

Defined in Diagrams.TrailLike

Methods

trailLike :: Located (Trail (V (Located t)) (N (Located t))) -> Located t #

Alignable a => Alignable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

alignBy' :: (InSpace v n (Located a), Fractional n, HasOrigin (Located a)) => (v n -> Located a -> Point v n) -> v n -> n -> Located a -> Located a #

defaultBoundary :: (V (Located a) ~ v, N (Located a) ~ n) => v n -> Located a -> Point v n #

alignBy :: (InSpace v n (Located a), Fractional n, HasOrigin (Located a)) => v n -> n -> Located a -> Located a #

Parametric (Tangent t) => Parametric (Tangent (Located t)) 
Instance details

Defined in Diagrams.Tangent

Methods

atParam :: Tangent (Located t) -> N (Tangent (Located t)) -> Codomain (Tangent (Located t)) (N (Tangent (Located t))) #

(InSpace v n a, Parametric a, Codomain a ~ v) => Parametric (Located a) 
Instance details

Defined in Diagrams.Located

Methods

atParam :: Located a -> N (Located a) -> Codomain (Located a) (N (Located a)) #

DomainBounds a => DomainBounds (Located a) 
Instance details

Defined in Diagrams.Located

Methods

domainLower :: Located a -> N (Located a) #

domainUpper :: Located a -> N (Located a) #

(DomainBounds t, EndValues (Tangent t)) => EndValues (Tangent (Located t)) 
Instance details

Defined in Diagrams.Tangent

(InSpace v n a, EndValues a, Codomain a ~ v) => EndValues (Located a) 
Instance details

Defined in Diagrams.Located

Methods

atStart :: Located a -> Codomain (Located a) (N (Located a)) #

atEnd :: Located a -> Codomain (Located a) (N (Located a)) #

(InSpace v n a, Fractional n, Parametric a, Sectionable a, Codomain a ~ v) => Sectionable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

splitAtParam :: Located a -> N (Located a) -> (Located a, Located a) #

section :: Located a -> N (Located a) -> N (Located a) -> Located a #

reverseDomain :: Located a -> Located a #

(InSpace v n a, Fractional n, HasArcLength a, Codomain a ~ v) => HasArcLength (Located a) 
Instance details

Defined in Diagrams.Located

Methods

arcLengthBounded :: N (Located a) -> Located a -> Interval (N (Located a)) #

arcLength :: N (Located a) -> Located a -> N (Located a) #

stdArcLength :: Located a -> N (Located a) #

arcLengthToParam :: N (Located a) -> Located a -> N (Located a) -> N (Located a) #

stdArcLengthToParam :: Located a -> N (Located a) -> N (Located a) #

(Metric v, OrderedField n) => Reversing (Located (Trail' l v n))

Same as reverseLocLine or reverseLocLoop.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Located (Trail' l v n) -> Located (Trail' l v n) #

(Metric v, OrderedField n) => Reversing (Located (Trail v n))

Same as reverseLocTrail.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Located (Trail v n) -> Located (Trail v n) #

(Metric v, Metric u, OrderedField n, r ~ Located (Trail u n)) => Deformable (Located (Trail v n)) r 
Instance details

Defined in Diagrams.Deform

Methods

deform' :: N (Located (Trail v n)) -> Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r #

deform :: Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r #

Snoc (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Snoc :: Prism (Path v n) (Path v' n') (Path v n, Located (Trail v n)) (Path v' n', Located (Trail v' n')) #

Cons (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Cons :: Prism (Path v n) (Path v' n') (Located (Trail v n), Path v n) (Located (Trail v' n'), Path v' n') #

Each (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

each :: Traversal (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) #

type Rep (Located a) 
Instance details

Defined in Diagrams.Located

type Rep (Located a) = D1 (MetaData "Located" "Diagrams.Located" "diagrams-lib-1.4.2.3-4IkVVBmK9qBElHMtgqeLQ1" False) (C1 (MetaCons "Loc" PrefixI True) (S1 (MetaSel (Just "loc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Point (V a) (N a))) :*: S1 (MetaSel (Just "unLoc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type V (Located a) 
Instance details

Defined in Diagrams.Located

type V (Located a) = V a
type N (Located a) 
Instance details

Defined in Diagrams.Located

type N (Located a) = N a
type Codomain (Located a) 
Instance details

Defined in Diagrams.Located

snugCenterXYZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

centerXYZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Center an object in three dimensions.

snugCenterYZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

centerYZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Center along both the Y- and Z-axes.

snugCenterXZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

centerXZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Center along both the X- and Z-axes.

snugCenterZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

centerZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Center the local origin along the Z-axis.

snugZ :: (V a ~ v, N a ~ n, Alignable a, Traced a, HasOrigin a, R3 v, Fractional n) => n -> a -> a #

See the documentation for alignZ.

alignZ :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a) => n -> a -> a #

Like alignX, but moving the local origin in the Z direction, with an argument of 1 corresponding to the top edge and (-1) corresponding to the bottom edge.

snugZMax :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

alignZMax :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Translate the diagram along unitZ so that all points have negative z-values.

snugZMin :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

alignZMin :: (InSpace v n a, R3 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Translate the diagram along unitZ so that all points have positive z-values.

snugYMax :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

alignYMax :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Translate the diagram along unitY so that all points have negative y-values.

snugYMin :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

alignYMin :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Translate the diagram along unitY so that all points have positive y-values.

snugXMax :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

alignXMax :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Translate the diagram along unitX so that all points have negative x-values.

snugXMin :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

alignXMin :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Translate the diagram along unitX so that all points have positive x-values.

snugCenterXY :: (InSpace v n a, R2 v, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a #

centerXY :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Center along both the X- and Y-axes.

snugCenterY :: (InSpace v n a, R2 v, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a #

centerY :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Center the local origin along the Y-axis.

snugCenterX :: (InSpace v n a, R1 v, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a #

centerX :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) => a -> a #

Center the local origin along the X-axis.

snugY :: (InSpace v n a, R2 v, Fractional n, Alignable a, Traced a, HasOrigin a) => n -> a -> a #

See the documentation for alignY.

alignY :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => n -> a -> a #

Like alignX, but moving the local origin vertically, with an argument of 1 corresponding to the top edge and (-1) corresponding to the bottom edge.

snugX :: (InSpace v n a, R1 v, Fractional n, Alignable a, Traced a, HasOrigin a) => n -> a -> a #

See the documentation for alignX.

alignX :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) => n -> a -> a #

alignX and snugX move the local origin horizontally as follows:

  • alignX (-1) moves the local origin to the left edge of the boundary;
  • align 1 moves the local origin to the right edge;
  • any other argument interpolates linearly between these. For example, alignX 0 centers, alignX 2 moves the origin one "radius" to the right of the right edge, and so on.
  • snugX works the same way.

alignBR :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

alignBL :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

alignTR :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

alignTL :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

snugB :: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a #

alignB :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

Align along the bottom edge.

snugT :: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a #

alignT :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

Align along the top edge.

snugR :: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a #

alignR :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

Align along the right edge.

snugL :: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a #

alignL :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a #

Align along the left edge, i.e. translate the diagram in a horizontal direction so that the local origin is on the left edge of the envelope.

snugCenter :: (InSpace v n a, Traversable v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

Like center using trace.

snugCenterV :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> a -> a #

Like centerV using trace.

center :: (InSpace v n a, Fractional n, Traversable v, Alignable a, HasOrigin a) => a -> a #

center centers an enveloped object along all of its basis vectors.

centerV :: (InSpace v n a, Fractional n, Alignable a, HasOrigin a) => v n -> a -> a #

centerV v centers an enveloped object along the direction of v.

snug :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> a -> a #

Like align but uses trace.

snugBy :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> n -> a -> a #

Version of alignBy specialized to use traceBoundary

align :: (InSpace v n a, Fractional n, Alignable a, HasOrigin a) => v n -> a -> a #

align v aligns an enveloped object along the edge in the direction of v. That is, it moves the local origin in the direction of v until it is on the edge of the envelope. (Note that if the local origin is outside the envelope to begin with, it may have to move "backwards".)

traceBoundary :: (V a ~ v, N a ~ n, Num n, Traced a) => v n -> a -> Point v n #

envelopeBoundary :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> Point v n #

Some standard functions which can be used as the boundary argument to alignBy'.

alignBy'Default :: (InSpace v n a, Fractional n, HasOrigin a) => (v n -> a -> Point v n) -> v n -> n -> a -> a #

Default implementation of alignBy for types with HasOrigin and AdditiveGroup instances.

class Alignable a where #

Class of things which can be aligned.

Minimal complete definition

defaultBoundary

Methods

alignBy' :: (InSpace v n a, Fractional n, HasOrigin a) => (v n -> a -> Point v n) -> v n -> n -> a -> a #

alignBy v d a moves the origin of a along the vector v. If d = 1, the origin is moved to the edge of the boundary in the direction of v; if d = -1, it moves to the edge of the boundary in the direction of the negation of v. Other values of d interpolate linearly (so for example, d = 0 centers the origin along the direction of v).

defaultBoundary :: (V a ~ v, N a ~ n) => v n -> a -> Point v n #

alignBy :: (InSpace v n a, Fractional n, HasOrigin a) => v n -> n -> a -> a #

Instances
(V b ~ v, N b ~ n, Metric v, OrderedField n, Alignable b) => Alignable [b] 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v n [b], Fractional n, HasOrigin [b]) => (v n -> [b] -> Point v n) -> v n -> n -> [b] -> [b] #

defaultBoundary :: (V [b] ~ v, N [b] ~ n) => v n -> [b] -> Point v n #

alignBy :: (InSpace v n [b], Fractional n, HasOrigin [b]) => v n -> n -> [b] -> [b] #

(V b ~ v, N b ~ n, Metric v, OrderedField n, Alignable b) => Alignable (Set b) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v n (Set b), Fractional n, HasOrigin (Set b)) => (v n -> Set b -> Point v n) -> v n -> n -> Set b -> Set b #

defaultBoundary :: (V (Set b) ~ v, N (Set b) ~ n) => v n -> Set b -> Point v n #

alignBy :: (InSpace v n (Set b), Fractional n, HasOrigin (Set b)) => v n -> n -> Set b -> Set b #

Alignable a => Alignable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

alignBy' :: (InSpace v n (Located a), Fractional n, HasOrigin (Located a)) => (v n -> Located a -> Point v n) -> v n -> n -> Located a -> Located a #

defaultBoundary :: (V (Located a) ~ v, N (Located a) ~ n) => v n -> Located a -> Point v n #

alignBy :: (InSpace v n (Located a), Fractional n, HasOrigin (Located a)) => v n -> n -> Located a -> Located a #

(InSpace v n a, HasOrigin a, Alignable a) => Alignable (b -> a)

Although the alignBy method for the (b -> a) instance is sensible, there is no good implementation for defaultBoundary. Instead, we provide a total method, but one that is not sensible. This should not present a serious problem as long as your use of Alignable happens through alignBy.

Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v n (b -> a), Fractional n, HasOrigin (b -> a)) => (v n -> (b -> a) -> Point v n) -> v n -> n -> (b -> a) -> b -> a #

defaultBoundary :: (V (b -> a) ~ v, N (b -> a) ~ n) => v n -> (b -> a) -> Point v n #

alignBy :: (InSpace v n (b -> a), Fractional n, HasOrigin (b -> a)) => v n -> n -> (b -> a) -> b -> a #

(V b ~ v, N b ~ n, Metric v, OrderedField n, Alignable b) => Alignable (Map k b) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v n (Map k b), Fractional n, HasOrigin (Map k b)) => (v n -> Map k b -> Point v n) -> v n -> n -> Map k b -> Map k b #

defaultBoundary :: (V (Map k b) ~ v, N (Map k b) ~ n) => v n -> Map k b -> Point v n #

alignBy :: (InSpace v n (Map k b), Fractional n, HasOrigin (Map k b)) => v n -> n -> Map k b -> Map k b #

(Metric v, OrderedField n) => Alignable (Envelope v n) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v0 n0 (Envelope v n), Fractional n0, HasOrigin (Envelope v n)) => (v0 n0 -> Envelope v n -> Point v0 n0) -> v0 n0 -> n0 -> Envelope v n -> Envelope v n #

defaultBoundary :: (V (Envelope v n) ~ v0, N (Envelope v n) ~ n0) => v0 n0 -> Envelope v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (Envelope v n), Fractional n0, HasOrigin (Envelope v n)) => v0 n0 -> n0 -> Envelope v n -> Envelope v n #

(Metric v, OrderedField n) => Alignable (Trace v n) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v0 n0 (Trace v n), Fractional n0, HasOrigin (Trace v n)) => (v0 n0 -> Trace v n -> Point v0 n0) -> v0 n0 -> n0 -> Trace v n -> Trace v n #

defaultBoundary :: (V (Trace v n) ~ v0, N (Trace v n) ~ n0) => v0 n0 -> Trace v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (Trace v n), Fractional n0, HasOrigin (Trace v n)) => v0 n0 -> n0 -> Trace v n -> Trace v n #

(Metric v, Traversable v, OrderedField n) => Alignable (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

alignBy' :: (InSpace v0 n0 (BoundingBox v n), Fractional n0, HasOrigin (BoundingBox v n)) => (v0 n0 -> BoundingBox v n -> Point v0 n0) -> v0 n0 -> n0 -> BoundingBox v n -> BoundingBox v n #

defaultBoundary :: (V (BoundingBox v n) ~ v0, N (BoundingBox v n) ~ n0) => v0 n0 -> BoundingBox v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (BoundingBox v n), Fractional n0, HasOrigin (BoundingBox v n)) => v0 n0 -> n0 -> BoundingBox v n -> BoundingBox v n #

(Metric v, OrderedField n) => Alignable (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

alignBy' :: (InSpace v0 n0 (Path v n), Fractional n0, HasOrigin (Path v n)) => (v0 n0 -> Path v n -> Point v0 n0) -> v0 n0 -> n0 -> Path v n -> Path v n #

defaultBoundary :: (V (Path v n) ~ v0, N (Path v n) ~ n0) => v0 n0 -> Path v n -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (Path v n), Fractional n0, HasOrigin (Path v n)) => v0 n0 -> n0 -> Path v n -> Path v n #

(Metric v, OrderedField n, Monoid' m) => Alignable (QDiagram b v n m) 
Instance details

Defined in Diagrams.Align

Methods

alignBy' :: (InSpace v0 n0 (QDiagram b v n m), Fractional n0, HasOrigin (QDiagram b v n m)) => (v0 n0 -> QDiagram b v n m -> Point v0 n0) -> v0 n0 -> n0 -> QDiagram b v n m -> QDiagram b v n m #

defaultBoundary :: (V (QDiagram b v n m) ~ v0, N (QDiagram b v n m) ~ n0) => v0 n0 -> QDiagram b v n m -> Point v0 n0 #

alignBy :: (InSpace v0 n0 (QDiagram b v n m), Fractional n0, HasOrigin (QDiagram b v n m)) => v0 n0 -> n0 -> QDiagram b v n m -> QDiagram b v n m #

globalPackage :: IO FilePath #

Find ghc's global package database. Throws an error if it isn't found.

findSandbox :: [FilePath] -> IO (Maybe FilePath) #

Search for a sandbox in the following order:

  • Test given FilePaths if they point directly to a database or contain a cabal config file (or any parent directory containing a config file).
  • Same test for DIAGRAMS_SANDBOX environment value
  • Environment values of GHC_PACKAGE_PATH, HSENV and PACKAGE_DB_FOR_GHC that point to a database.
  • Test for config file (cabal.sandbox.config) in the current directory and its parents.

findHsFile :: FilePath -> IO (Maybe FilePath) #

Given some file (no extension or otherwise) try to find a haskell source file.

foldB :: (a -> a -> a) -> a -> [a] -> a #

Given an associative binary operation and a default value to use in the case of an empty list, perform a balanced fold over a list. For example,

  foldB (+) z [a,b,c,d,e,f] == ((a+b) + (c+d)) + (e+f)
  

tau :: Floating a => a #

The circle constant, the ratio of a circle's circumference to its radius. Note that pi = tau/2.

For more information and a well-reasoned argument why we should all be using tau instead of pi, see The Tau Manifesto, http://tauday.com/.

To hear what it sounds like (and to easily memorize the first 30 digits or so), try http://youtu.be/3174T-3-59Q.

iterateN :: Int -> (a -> a) -> a -> [a] #

iterateN n f x returns the list of the first n iterates of f starting at x, that is, the list [x, f x, f (f x), ...] of length n. (Note that the last element of the list will be f applied to x (n-1) times.)

(##) :: AReview t b -> b -> t infixr 8 #

A replacement for lenses' # operator.

(#) :: a -> (a -> b) -> b infixl 8 #

Postfix function application, for conveniently applying attributes. Unlike ($), (#) has a high precedence (8), so d # foo # bar can be combined with other things using operators like (|||) or (<>) without needing parentheses.

applyAll :: [a -> a] -> a -> a #

applyAll takes a list of functions and applies them all to a value, in sequence from the last function in the list to the first. For example, applyAll [f1, f2, f3] a == f1 . f2 . f3 $ a.

with :: Default d => d #

Several functions exported by the diagrams library take a number of arguments giving the user control to "tweak" various aspects of their behavior. Rather than give such functions a long list of arguments, and to make it possible for the user to selectively override only certain arguments and use default values for others, such sets of arguments are collected into a record with named fields (see PolygonOpts in Diagrams.TwoD.Shapes for an example). Such record types are made instances of the Default class, which provides a single record structure (def) collecting the "default" arguments to the function. with is a synonym for def, which provides nice-looking syntax for simulating optional, named arguments in Haskell. For example,

  polygon with {sides = 7, edgeSkip = 2}
  

calls the polygon function with a single argument (note that record update binds more tightly than function application!), namely, with (the record of default arguments) where the sides and edgeSkip fields have been updated.

camAspect :: (Floating n, CameraLens l) => Camera l n -> n #

camLens :: Camera l n -> l n #

camUp :: Camera l n -> Direction V3 n #

mm50Narrow :: Floating n => PerspectiveLens n #

mm50Narrow has the same vertical field of view as mm50, but an aspect ratio of 4:3, for VGA and similar computer resolutions.

mm50Wide :: Floating n => PerspectiveLens n #

mm50blWide has the same vertical field of view as mm50, but an aspect ratio of 1.6, suitable for wide screen computer monitors.

mm50 :: Floating n => PerspectiveLens n #

mm50 has the field of view of a 50mm lens on standard 35mm film, hence an aspect ratio of 3:2.

facing_ZCamera :: (Floating n, Ord n, Typeable n, CameraLens l, Renderable (Camera l n) b) => l n -> QDiagram b V3 n Any #

'facing_ZCamera l' is a camera at the origin facing along the negative Z axis, with its up-axis coincident with the positive Y axis, with the projection defined by l.

mm50Camera :: (Typeable n, Floating n, Ord n, Renderable (Camera PerspectiveLens n) b) => QDiagram b V3 n Any #

A camera at the origin facing along the negative Z axis, with its up-axis coincident with the positive Y axis. The field of view is chosen to match a 50mm camera on 35mm film. Note that Cameras take up no space in the Diagram.

data OrthoLens n #

An orthographic projection

Constructors

OrthoLens 

Fields

Instances
CameraLens OrthoLens 
Instance details

Defined in Diagrams.ThreeD.Camera

Methods

aspect :: Floating n => OrthoLens n -> n #

type V (OrthoLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type V (OrthoLens n) = V3
type N (OrthoLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type N (OrthoLens n) = n

data Camera (l :: Type -> Type) n #

Instances
Num n => Transformable (Camera l n) 
Instance details

Defined in Diagrams.ThreeD.Camera

Methods

transform :: Transformation (V (Camera l n)) (N (Camera l n)) -> Camera l n -> Camera l n #

Num n => Renderable (Camera l n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Camera

Methods

render :: NullBackend -> Camera l n -> Render NullBackend (V (Camera l n)) (N (Camera l n)) #

type V (Camera l n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type V (Camera l n) = V3
type N (Camera l n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type N (Camera l n) = n

data PerspectiveLens n #

A perspective projection

Constructors

PerspectiveLens 

Fields

Instances
CameraLens PerspectiveLens 
Instance details

Defined in Diagrams.ThreeD.Camera

Methods

aspect :: Floating n => PerspectiveLens n -> n #

type V (PerspectiveLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type V (PerspectiveLens n) = V3
type N (PerspectiveLens n) 
Instance details

Defined in Diagrams.ThreeD.Camera

type N (PerspectiveLens n) = n

difference :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n #

intersection :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n #

union :: (CsgPrim a, CsgPrim b) => a n -> b n -> CSG n #

cylinder :: Num n => Frustum n #

A circular cylinder of radius 1 with one end cap centered on the origin, and extending to Z=1.

cone :: Num n => Frustum n #

A cone with its base centered on the origin, with radius 1 at the base, height 1, and it's apex on the positive Z axis.

frustum :: Num n => n -> n -> Frustum n #

A frustum of a right circular cone. It has height 1 oriented along the positive z axis, and radii r0 and r1 at Z=0 and Z=1. cone and cylinder are special cases.

cube :: Num n => Box n #

A cube with side length 1, in the positive octant, with one vertex at the origin.

sphere :: Num n => Ellipsoid n #

A sphere of radius 1 with its center at the origin.

data Ellipsoid n #

Constructors

Ellipsoid (Transformation V3 n) 
Instances
CsgPrim Ellipsoid 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

toCsg :: Ellipsoid n -> CSG n

OrderedField n => Enveloped (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: Ellipsoid n -> Envelope (V (Ellipsoid n)) (N (Ellipsoid n)) #

OrderedField n => Traced (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: Ellipsoid n -> Trace (V (Ellipsoid n)) (N (Ellipsoid n)) #

Fractional n => Transformable (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

OrderedField n => Skinned (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (Ellipsoid n) b, N (Ellipsoid n) ~ n0, TypeableFloat n0) => Ellipsoid n -> QDiagram b V3 n0 Any #

Fractional n => Renderable (Ellipsoid n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

(Num n, Ord n) => HasQuery (Ellipsoid n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Ellipsoid n -> Query (V (Ellipsoid n)) (N (Ellipsoid n)) Any #

type V (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (Ellipsoid n) = V3
type N (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (Ellipsoid n) = n

data Box n #

Constructors

Box (Transformation V3 n) 
Instances
CsgPrim Box 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

toCsg :: Box n -> CSG n

OrderedField n => Enveloped (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: Box n -> Envelope (V (Box n)) (N (Box n)) #

(Fractional n, Ord n) => Traced (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: Box n -> Trace (V (Box n)) (N (Box n)) #

Fractional n => Transformable (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

transform :: Transformation (V (Box n)) (N (Box n)) -> Box n -> Box n #

OrderedField n => Skinned (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (Box n) b, N (Box n) ~ n0, TypeableFloat n0) => Box n -> QDiagram b V3 n0 Any #

Fractional n => Renderable (Box n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

render :: NullBackend -> Box n -> Render NullBackend (V (Box n)) (N (Box n)) #

(Num n, Ord n) => HasQuery (Box n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Box n -> Query (V (Box n)) (N (Box n)) Any #

type V (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (Box n) = V3
type N (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (Box n) = n

data Frustum n #

Constructors

Frustum n n (Transformation V3 n) 
Instances
CsgPrim Frustum 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

toCsg :: Frustum n -> CSG n

(OrderedField n, RealFloat n) => Enveloped (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: Frustum n -> Envelope (V (Frustum n)) (N (Frustum n)) #

(RealFloat n, Ord n) => Traced (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: Frustum n -> Trace (V (Frustum n)) (N (Frustum n)) #

Fractional n => Transformable (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

transform :: Transformation (V (Frustum n)) (N (Frustum n)) -> Frustum n -> Frustum n #

Skinned (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (Frustum n) b, N (Frustum n) ~ n0, TypeableFloat n0) => Frustum n -> QDiagram b V3 n0 Any #

Fractional n => Renderable (Frustum n) NullBackend 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

render :: NullBackend -> Frustum n -> Render NullBackend (V (Frustum n)) (N (Frustum n)) #

OrderedField n => HasQuery (Frustum n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Frustum n -> Query (V (Frustum n)) (N (Frustum n)) Any #

type V (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (Frustum n) = V3
type N (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (Frustum n) = n

class Skinned t where #

Types which can be rendered as 3D Diagrams.

Methods

skin :: (Renderable t b, N t ~ n, TypeableFloat n) => t -> QDiagram b V3 n Any #

Instances
OrderedField n => Skinned (Ellipsoid n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (Ellipsoid n) b, N (Ellipsoid n) ~ n0, TypeableFloat n0) => Ellipsoid n -> QDiagram b V3 n0 Any #

OrderedField n => Skinned (Box n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (Box n) b, N (Box n) ~ n0, TypeableFloat n0) => Box n -> QDiagram b V3 n0 Any #

Skinned (Frustum n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (Frustum n) b, N (Frustum n) ~ n0, TypeableFloat n0) => Frustum n -> QDiagram b V3 n0 Any #

(RealFloat n, Ord n) => Skinned (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (CSG n) b, N (CSG n) ~ n0, TypeableFloat n0) => CSG n -> QDiagram b V3 n0 Any #

data CSG n #

A tree of Constructive Solid Geometry operations and the primitives that can be used in them.

Instances
CsgPrim CSG 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

toCsg :: CSG n -> CSG n

RealFloat n => Enveloped (CSG n)

The Envelope for an Intersection or Difference is simply the Envelope of the Union. This is wrong but easy to implement.

Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getEnvelope :: CSG n -> Envelope (V (CSG n)) (N (CSG n)) #

(RealFloat n, Ord n) => Traced (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getTrace :: CSG n -> Trace (V (CSG n)) (N (CSG n)) #

Fractional n => Transformable (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

transform :: Transformation (V (CSG n)) (N (CSG n)) -> CSG n -> CSG n #

(RealFloat n, Ord n) => Skinned (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

skin :: (Renderable (CSG n) b, N (CSG n) ~ n0, TypeableFloat n0) => CSG n -> QDiagram b V3 n0 Any #

(Floating n, Ord n) => HasQuery (CSG n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: CSG n -> Query (V (CSG n)) (N (CSG n)) Any #

type V (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type V (CSG n) = V3
type N (CSG n) 
Instance details

Defined in Diagrams.ThreeD.Shapes

type N (CSG n) = n

zDir :: (R3 v, Additive v, Num n) => Direction v n #

A Direction pointing in the Z direction.

unit_Z :: (R3 v, Additive v, Num n) => v n #

The unit vector in the negative X direction.

unitZ :: (R3 v, Additive v, Num n) => v n #

The unit vector in the positive Y direction.

reflectAcross :: (InSpace v n t, Metric v, Fractional n, Transformable t) => Point v n -> v n -> t -> t #

reflectAcross p v reflects a diagram across the plane though the point p and the vector v. This also works as a 2D transform where v is the normal to the line passing through point p.

reflectionAcross :: (Metric v, Fractional n) => Point v n -> v n -> Transformation v n #

reflectionAcross p v is a reflection across the plane through the point p and normal to vector v. This also works as a 2D transform where v is the normal to the line passing through point p.

reflectZ :: (InSpace v n t, R3 v, Transformable t) => t -> t #

Flip a diagram across z=0, i.e. send the point (x,y,z) to (x,y,-z).

reflectionZ :: (Additive v, R3 v, Num n) => Transformation v n #

Construct a transformation which flips a diagram across z=0, i.e. sends the point (x,y,z) to (x,y,-z).

translateZ :: (InSpace v n t, R3 v, Transformable t) => n -> t -> t #

Translate a diagram by the given distance in the y direction.

translationZ :: (Additive v, R3 v, Num n) => n -> Transformation v n #

Construct a transformation which translates by the given distance in the z direction.

scaleZ :: (InSpace v n t, R3 v, Fractional n, Transformable t) => n -> t -> t #

Scale a diagram by the given factor in the z direction. To scale uniformly, use scale.

scalingZ :: (Additive v, R3 v, Fractional n) => n -> Transformation v n #

Construct a transformation which scales by the given factor in the z direction.

pointAt' :: (Floating n, Ord n) => V3 n -> V3 n -> V3 n -> Transformation V3 n #

pointAt' has the same behavior as pointAt, but takes vectors instead of directions.

pointAt :: (Floating n, Ord n) => Direction V3 n -> Direction V3 n -> Direction V3 n -> Transformation V3 n #

pointAt about initial final produces a rotation which brings the direction initial to point in the direction final by first panning around about, then tilting about the axis perpendicular to about and final. In particular, if this can be accomplished without tilting, it will be, otherwise if only tilting is necessary, no panning will occur. The tilt will always be between ± 1/4 turn.

rotateAbout #

Arguments

:: (InSpace V3 n t, Floating n, Transformable t) 
=> Point V3 n

origin of rotation

-> Direction V3 n

direction of rotation axis

-> Angle n

angle of rotation

-> t 
-> t 

rotationAbout p d a is a rotation about a line parallel to d passing through p.

rotationAbout #

Arguments

:: Floating n 
=> Point V3 n

origin of rotation

-> Direction V3 n

direction of rotation axis

-> Angle n

angle of rotation

-> Transformation V3 n 

rotationAbout p d a is a rotation about a line parallel to d passing through p.

aboutY :: Floating n => Angle n -> Transformation V3 n #

Like aboutZ, but rotates about the Y axis, bringing postive x-values towards the negative z-axis.

aboutX :: Floating n => Angle n -> Transformation V3 n #

Like aboutZ, but rotates about the X axis, bringing positive y-values towards the positive z-axis.

aboutZ :: Floating n => Angle n -> Transformation V3 n #

Create a transformation which rotates by the given angle about a line parallel the Z axis passing through the local origin. A positive angle brings positive x-values towards the positive-y axis.

The angle can be expressed using any type which is an instance of Angle. For example, aboutZ (1/4 @@ turn), aboutZ (tau/4 @@ rad), and aboutZ (90 @@ deg) all represent the same transformation, namely, a counterclockwise rotation by a right angle. For more general rotations, see rotationAbout.

Note that writing aboutZ (1/4), with no type annotation, will yield an error since GHC cannot figure out which sort of angle you want to use.

shearY :: (InSpace V2 n t, Transformable t) => n -> t -> t #

shearY d performs a shear in the y-direction which sends (1,0) to (1,d).

shearingY :: Num n => n -> T2 n #

shearingY d is the linear transformation which is the identity on x coordinates and sends (1,0) to (1,d).

shearX :: (InSpace V2 n t, Transformable t) => n -> t -> t #

shearX d performs a shear in the x-direction which sends (0,1) to (d,1).

shearingX :: Num n => n -> T2 n #

shearingX d is the linear transformation which is the identity on y coordinates and sends (0,1) to (d,1).

reflectAbout :: (InSpace V2 n t, OrderedField n, Transformable t) => P2 n -> Direction V2 n -> t -> t #

reflectAbout p d reflects a diagram in the line determined by the point p and direction d.

reflectionAbout :: OrderedField n => P2 n -> Direction V2 n -> T2 n #

reflectionAbout p d is a reflection in the line determined by the point p and direction d.

reflectXY :: (InSpace v n t, R2 v, Transformable t) => t -> t #

Flips the diagram about x=y, i.e. send the point (x,y) to (y,x).

reflectionXY :: (Additive v, R2 v, Num n) => Transformation v n #

Construct a transformation which flips the diagram about x=y, i.e. sends the point (x,y) to (y,x).

reflectY :: (InSpace v n t, R2 v, Transformable t) => t -> t #

Flip a diagram from top to bottom, i.e. send the point (x,y) to (x,-y).

reflectionY :: (Additive v, R2 v, Num n) => Transformation v n #

Construct a transformation which flips a diagram from top to bottom, i.e. sends the point (x,y) to (x,-y).

reflectX :: (InSpace v n t, R1 v, Transformable t) => t -> t #

Flip a diagram from left to right, i.e. send the point (x,y) to (-x,y).

reflectionX :: (Additive v, R1 v, Num n) => Transformation v n #

Construct a transformation which flips a diagram from left to right, i.e. sends the point (x,y) to (-x,y).

scaleRotateTo :: (InSpace V2 n t, Transformable t, Floating n) => V2 n -> t -> t #

Rotate and uniformly scale around the local origin such that the x-axis aligns with the given vector. This satisfies the equation

scaleRotateTo v = rotateTo (dir v) . scale (norm v)

up to floating point rounding errors, but is more accurate and performant since it avoids cancellable uses of trigonometric functions.

scalingRotationTo :: Floating n => V2 n -> T2 n #

The angle-preserving linear map that aligns the x-axis unit vector with the given vector. See also scaleRotateTo.

translateY :: (InSpace v n t, R2 v, Transformable t) => n -> t -> t #

Translate a diagram by the given distance in the y (vertical) direction.

translationY :: (Additive v, R2 v, Num n) => n -> Transformation v n #

Construct a transformation which translates by the given distance in the y (vertical) direction.

translateX :: (InSpace v n t, R1 v, Transformable t) => n -> t -> t #

Translate a diagram by the given distance in the x (horizontal) direction.

translationX :: (Additive v, R1 v, Num n) => n -> Transformation v n #

Construct a transformation which translates by the given distance in the x (horizontal) direction.

scaleUToY :: (InSpace v n t, R2 v, Enveloped t, Transformable t) => n -> t -> t #

scaleUToY h scales a diagram uniformly by whatever factor required to make its height h. scaleUToY should not be applied to diagrams with a height of 0, such as hrule.

scaleUToX :: (InSpace v n t, R1 v, Enveloped t, Transformable t) => n -> t -> t #

scaleUToX w scales a diagram uniformly by whatever factor required to make its width w. scaleUToX should not be applied to diagrams with a width of 0, such as vrule.

scaleToY :: (InSpace v n t, R2 v, Enveloped t, Transformable t) => n -> t -> t #

scaleToY h scales a diagram in the y (vertical) direction by whatever factor required to make its height h. scaleToY should not be applied to diagrams with a height of 0, such as hrule.

scaleToX :: (InSpace v n t, R2 v, Enveloped t, Transformable t) => n -> t -> t #

scaleToX w scales a diagram in the x (horizontal) direction by whatever factor required to make its width w. scaleToX should not be applied to diagrams with a width of 0, such as vrule.

scaleY :: (InSpace v n t, R2 v, Fractional n, Transformable t) => n -> t -> t #

Scale a diagram by the given factor in the y (vertical) direction. To scale uniformly, use scale.

scalingY :: (Additive v, R2 v, Fractional n) => n -> Transformation v n #

Construct a transformation which scales by the given factor in the y (vertical) direction.

scaleX :: (InSpace v n t, R2 v, Fractional n, Transformable t) => n -> t -> t #

Scale a diagram by the given factor in the x (horizontal) direction. To scale uniformly, use scale.

scalingX :: (Additive v, R1 v, Fractional n) => n -> Transformation v n #

Construct a transformation which scales by the given factor in the x (horizontal) direction.

rotateTo :: (InSpace V2 n t, OrderedField n, Transformable t) => Direction V2 n -> t -> t #

Rotate around the local origin such that the x axis aligns with the given direction.

rotationTo :: OrderedField n => Direction V2 n -> T2 n #

The rotation that aligns the x-axis with the given direction.

rotateAround :: (InSpace V2 n t, Transformable t, Floating n) => P2 n -> Angle n -> t -> t #

rotateAbout p is like rotate, except it rotates around the point p instead of around the local origin.

rotationAround :: Floating n => P2 n -> Angle n -> T2 n #

rotationAbout p is a rotation about the point p (instead of around the local origin).

rotated :: (InSpace V2 n a, Floating n, SameSpace a b, Transformable a, Transformable b) => Angle n -> Iso a b a b #

Use an Angle to make an Iso between an object rotated and unrotated. This us useful for performing actions under a rotation:

under (rotated t) f = rotate (negated t) . f . rotate t
rotated t ## a      = rotate t a
a ^. rotated t      = rotate (-t) a
over (rotated t) f  = rotate t . f . rotate (negated t)

rotateBy :: (InSpace V2 n t, Transformable t, Floating n) => n -> t -> t #

A synonym for rotate, interpreting its argument in units of turns; it can be more convenient to write rotateBy (1/4) than rotate (1/4 @@ turn).

signedAngleBetweenDirs :: RealFloat n => Direction V2 n -> Direction V2 n -> Angle n #

Same as signedAngleBetween but for Directionss.

signedAngleBetween :: RealFloat n => V2 n -> V2 n -> Angle n #

Signed angle between two vectors. Currently defined as

signedAngleBetween u v = (u ^. _theta) ^-^ (v ^. _theta)

leftTurn :: (Num n, Ord n) => V2 n -> V2 n -> Bool #

leftTurn v1 v2 tests whether the direction of v2 is a left turn from v1 (that is, if the direction of v2 can be obtained from that of v1 by adding an angle 0 <= theta <= tau/2).

angleV :: Floating n => Angle n -> V2 n #

A unit vector at a specified angle counter-clockwise from the positive x-axis

angleDir :: Floating n => Angle n -> Direction V2 n #

A direction at a specified angle counter-clockwise from the xDir.

yDir :: (R2 v, Additive v, Num n) => Direction v n #

A Direction pointing in the Y direction.

xDir :: (R1 v, Additive v, Num n) => Direction v n #

A Direction pointing in the X direction.

unit_Y :: (R2 v, Additive v, Num n) => v n #

The unit vector in the negative Y direction.

unitY :: (R2 v, Additive v, Num n) => v n #

The unit vector in the positive Y direction.

unit_X :: (R1 v, Additive v, Num n) => v n #

The unit vector in the negative X direction.

unitX :: (R1 v, Additive v, Num n) => v n #

The unit vector in the positive X direction.

parallelLight #

Arguments

:: (Typeable n, OrderedField n, Renderable (ParallelLight n) b) 
=> Direction V3 n

The direction in which the light travels.

-> Colour Double

The color of the light.

-> QDiagram b V3 n Any 

Construct a Diagram with a single ParallelLight, which takes up no space.

pointLight #

Arguments

:: (Typeable n, Num n, Ord n, Renderable (PointLight n) b) 
=> Colour Double

The color of the light

-> QDiagram b V3 n Any 

Construct a Diagram with a single PointLight at the origin, which takes up no space.

data PointLight n #

A PointLight radiates uniformly in all directions from a given point.

Constructors

PointLight (Point V3 n) (Colour Double) 
Instances
Fractional n => Transformable (PointLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type V (PointLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type V (PointLight n) = V3
type N (PointLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type N (PointLight n) = n

data ParallelLight n #

A ParallelLight casts parallel rays in the specified direction, from some distant location outside the scene.

Constructors

ParallelLight (V3 n) (Colour Double) 
Instances
Transformable (ParallelLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type V (ParallelLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type V (ParallelLight n) = V3
type N (ParallelLight n) 
Instance details

Defined in Diagrams.ThreeD.Light

type N (ParallelLight n) = n

r3CylindricalIso :: RealFloat n => Iso' (V3 n) (n, Angle n, n) #

r3SphericalIso :: RealFloat n => Iso' (V3 n) (n, Angle n, Angle n) #

mkP3 :: n -> n -> n -> P3 n #

Curried version of r3.

p3Iso :: Iso' (P3 n) (n, n, n) #

unp3 :: P3 n -> (n, n, n) #

Convert a 3D point back into a triple of coordinates.

p3 :: (n, n, n) -> P3 n #

Construct a 3D point from a triple of coordinates.

unr3 :: V3 n -> (n, n, n) #

Convert a 3D vector back into a triple of components.

mkR3 :: n -> n -> n -> V3 n #

Curried version of r3.

r3 :: (n, n, n) -> V3 n #

Construct a 3D vector from a triple of components.

r3Iso :: Iso' (V3 n) (n, n, n) #

type P3 = Point V3 #

r2PolarIso :: RealFloat n => Iso' (V2 n) (n, Angle n) #

mkP2 :: n -> n -> P2 n #

Curried form of p2.

unp2 :: P2 n -> (n, n) #

Convert a 2D point back into a pair of coordinates. See also coords.

p2 :: (n, n) -> P2 n #

Construct a 2D point from a pair of coordinates. See also ^&.

mkR2 :: n -> n -> V2 n #

Curried form of r2.

unr2 :: V2 n -> (n, n) #

Convert a 2D vector back into a pair of components. See also coords.

r2 :: (n, n) -> V2 n #

Construct a 2D vector from a pair of components. See also &.

type P2 = Point V2 #

class HasR (t :: Type -> Type) where #

A space which has magnitude _r that can be calculated numerically.

Methods

_r :: RealFloat n => Lens' (t n) n #

Instances
HasR V2 
Instance details

Defined in Diagrams.TwoD.Types

Methods

_r :: RealFloat n => Lens' (V2 n) n #

HasR v => HasR (Point v) 
Instance details

Defined in Diagrams.TwoD.Types

Methods

_r :: RealFloat n => Lens' (Point v n) n #

translated :: (InSpace v n a, SameSpace a b, Transformable a, Transformable b) => v n -> Iso a b a b #

Use a vector to make an Iso between an object translated and untranslated.

under (translated v) f == translate (-v) . f . translate v
translated v ## a      == translate v a
a ^. translated v      == translate (-v) a
over (translated v) f  == translate v . f . translate (-v)

movedFrom :: (InSpace v n a, SameSpace a b, HasOrigin a, HasOrigin b) => Point v n -> Iso a b a b #

Use a Transformation to make an Iso between an object transformed and untransformed. We have

under (movedFrom p) f == moveTo p . f . moveTo (-p)
movedFrom p           == from (movedTo p)
movedFrom p ## a      == moveOriginTo p a
a ^. movedFrom p      == moveTo p a
over (movedFrom p) f  == moveTo (-p) . f . moveTo p

movedTo :: (InSpace v n a, SameSpace a b, HasOrigin a, HasOrigin b) => Point v n -> Iso a b a b #

Use a Point to make an Iso between an object moved to and from that point:

under (movedTo p) f == moveTo (-p) . f . moveTo p
over (movedTo p) f  == moveTo p . f . moveTo (-p)
movedTo p           == from (movedFrom p)
movedTo p ## a      == moveTo p a
a ^. movedTo p      == moveOriginTo p a

transformed :: (InSpace v n a, SameSpace a b, Transformable a, Transformable b) => Transformation v n -> Iso a b a b #

Use a Transformation to make an Iso between an object transformed and untransformed. This is useful for carrying out functions under another transform:

under (transformed t) f               == transform (inv t) . f . transform t
under (transformed t1) (transform t2) == transform (conjugate t1 t2)
transformed t ## a                    == transform t a
a ^. transformed t                    == transform (inv t) a

underT :: (InSpace v n a, SameSpace a b, Transformable a, Transformable b) => (a -> b) -> Transformation v n -> a -> b #

Carry out some transformation "under" another one: f `underT` t first applies t, then f, then the inverse of t. For example, scaleX 2 `underT` rotation (-1/8 @@ Turn) is the transformation which scales by a factor of 2 along the diagonal line y = x.

Note that

(transform t2) underT t1 == transform (conjugate t1 t2)

for all transformations t1 and t2.

See also the isomorphisms like transformed, movedTo, movedFrom, and translated.

conjugate :: (Additive v, Num n) => Transformation v n -> Transformation v n -> Transformation v n #

Conjugate one transformation by another. conjugate t1 t2 is the transformation which performs first t1, then t2, then the inverse of t1.

highlightSize :: Traversal' (Style v n) Double #

Traversal over the highlight size in a style. If the style has no Specular, setting this will do nothing.

highlightIntensity :: Traversal' (Style v n) Double #

Traversal over the highlight intensity of a style. If the style has no Specular, setting this will do nothing.

_highlight :: Lens' (Style v n) (Maybe Specular) #

Lens onto the possible specular highlight in a style

highlight :: HasStyle d => Specular -> d -> d #

Set the specular highlight.

_ambient :: Lens' (Style v n) (Maybe Double) #

Lens onto the possible ambience in a style.

ambient :: HasStyle d => Double -> d -> d #

Set the emittance due to ambient light.

_diffuse :: Lens' (Style v n) (Maybe Double) #

Lens onto the possible diffuse reflectance in a style.

diffuse :: HasStyle d => Double -> d -> d #

Set the diffuse reflectance.

_Diffuse :: Iso' Diffuse Double #

Isomorphism between Diffuse and Double

_sc :: Lens' (Style v n) (Maybe (Colour Double)) #

Lens onto the surface colour of a style.

sc :: HasStyle d => Colour Double -> d -> d #

Set the surface color.

newtype SurfaceColor #

SurfaceColor is the inherent pigment of an object, assumed to be opaque.

Constructors

SurfaceColor (Last (Colour Double)) 

newtype Diffuse #

Diffuse is the fraction of incident light reflected diffusely, that is, in all directions. The actual light reflected is the product of this value, the incident light, and the SurfaceColor Attribute. For physical reasonableness, Diffuse should have a value between 0 and 1; this is not checked.

Constructors

Diffuse (Last Double) 
Instances
Show Diffuse 
Instance details

Defined in Diagrams.ThreeD.Attributes

Semigroup Diffuse 
Instance details

Defined in Diagrams.ThreeD.Attributes

AttributeClass Diffuse 
Instance details

Defined in Diagrams.ThreeD.Attributes

newtype Ambient #

Ambient is an ad-hoc representation of indirect lighting. The product of Ambient and SurfaceColor is added to the light leaving an object due to diffuse and specular terms. Ambient can be set per-object, and can be loosely thought of as the product of indirect lighting incident on that object and the diffuse reflectance.

Constructors

Ambient (Last Double) 
Instances
Show Ambient 
Instance details

Defined in Diagrams.ThreeD.Attributes

Semigroup Ambient 
Instance details

Defined in Diagrams.ThreeD.Attributes

AttributeClass Ambient 
Instance details

Defined in Diagrams.ThreeD.Attributes

data Specular #

A specular highlight has two terms, the intensity, between 0 and 1, and the size. The highlight size is assumed to be the exponent in a Phong shading model (though Backends are free to use a different shading model). In this model, reasonable values are between 1 and 50 or so, with higher values for shinier objects. Physically, the intensity and the value of Diffuse must add up to less than 1; this is not enforced.

Instances
Show Specular 
Instance details

Defined in Diagrams.ThreeD.Attributes

clearValue :: QDiagram b v n m -> QDiagram b v n Any #

Set all the query values of a diagram to False.

resetValue :: (Eq m, Monoid m) => QDiagram b v n m -> QDiagram b v n Any #

Reset the query values of a diagram to True/False: any values equal to mempty are set to False; any other values are set to True.

value :: Monoid m => m -> QDiagram b v n Any -> QDiagram b v n m #

Set the query value for True points in a diagram (i.e. points "inquire" the diagram); False points will be set to mempty.

sample :: HasQuery t m => t -> Point (V t) (N t) -> m #

Sample a diagram's query function at a given point.

sample :: QDiagram b v n m -> Point v n -> m
sample :: Query v n m      -> Point v n -> m
sample :: BoundingBox v n  -> Point v n -> Any
sample :: Path V2 Double   -> Point v n -> Crossings

inquire :: HasQuery t Any => t -> Point (V t) (N t) -> Bool #

Test if a point is not equal to mempty.

inquire :: QDiagram b v n Any -> Point v n -> Bool
inquire :: Query v n Any      -> Point v n -> Bool
inquire :: BoundingBox v n  -> Point v n -> Bool

class HasQuery t m | t -> m where #

Types which can answer a Query about points inside the geometric object.

If t and m are both a Semigroups, getQuery should satisfy

getQuery (t1 <> t2) = getQuery t1 <> getQuery t2

Methods

getQuery :: t -> Query (V t) (N t) m #

Extract the query of an object.

Instances
RealFloat n => HasQuery (Clip n) All

A point inside a clip if the point is in All invididual clipping paths.

Instance details

Defined in Diagrams.TwoD.Path

Methods

getQuery :: Clip n -> Query (V (Clip n)) (N (Clip n)) All #

(Num n, Ord n) => HasQuery (Ellipsoid n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Ellipsoid n -> Query (V (Ellipsoid n)) (N (Ellipsoid n)) Any #

(Num n, Ord n) => HasQuery (Box n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Box n -> Query (V (Box n)) (N (Box n)) Any #

OrderedField n => HasQuery (Frustum n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: Frustum n -> Query (V (Frustum n)) (N (Frustum n)) Any #

(Floating n, Ord n) => HasQuery (CSG n) Any 
Instance details

Defined in Diagrams.ThreeD.Shapes

Methods

getQuery :: CSG n -> Query (V (CSG n)) (N (CSG n)) Any #

(Additive v, Foldable v, Ord n) => HasQuery (BoundingBox v n) Any 
Instance details

Defined in Diagrams.BoundingBox

Methods

getQuery :: BoundingBox v n -> Query (V (BoundingBox v n)) (N (BoundingBox v n)) Any #

RealFloat n => HasQuery (DImage n a) Any 
Instance details

Defined in Diagrams.TwoD.Image

Methods

getQuery :: DImage n a -> Query (V (DImage n a)) (N (DImage n a)) Any #

HasQuery (Query v n m) m 
Instance details

Defined in Diagrams.Query

Methods

getQuery :: Query v n m -> Query (V (Query v n m)) (N (Query v n m)) m #

Monoid m => HasQuery (QDiagram b v n m) m 
Instance details

Defined in Diagrams.Query

Methods

getQuery :: QDiagram b v n m -> Query (V (QDiagram b v n m)) (N (QDiagram b v n m)) m #

dirBetween :: (Additive v, Num n) => Point v n -> Point v n -> Direction v n #

dirBetween p q returns the direction from p to q.

angleBetweenDirs :: (Metric v, Floating n, Ord n) => Direction v n -> Direction v n -> Angle n #

compute the positive angle between the two directions in their common plane

fromDir :: (Metric v, Floating n) => Direction v n -> v n #

Synonym for fromDirection.

fromDirection :: (Metric v, Floating n) => Direction v n -> v n #

fromDirection d is the unit vector in the direction d.

direction :: v n -> Direction v n #

direction v is the direction in which v points. Returns an unspecified value when given the zero vector as input.

_Dir :: Iso' (Direction v n) (v n) #

_Dir is provided to allow efficient implementations of functions in particular vector-spaces, but should be used with care as it exposes too much information.

data Direction (v :: Type -> Type) n #

A vector is described by a Direction and a magnitude. So we can think of a Direction as a vector that has forgotten its magnitude. Directions can be used with fromDirection and the lenses provided by its instances.

Instances
Functor v => Functor (Direction v) 
Instance details

Defined in Diagrams.Direction

Methods

fmap :: (a -> b) -> Direction v a -> Direction v b #

(<$) :: a -> Direction v b -> Direction v a #

HasTheta v => HasTheta (Direction v) 
Instance details

Defined in Diagrams.Direction

Methods

_theta :: RealFloat n => Lens' (Direction v n) (Angle n) #

HasPhi v => HasPhi (Direction v) 
Instance details

Defined in Diagrams.Direction

Methods

_phi :: RealFloat n => Lens' (Direction v n) (Angle n) #

Eq (v n) => Eq (Direction v n) 
Instance details

Defined in Diagrams.Direction

Methods

(==) :: Direction v n -> Direction v n -> Bool #

(/=) :: Direction v n -> Direction v n -> Bool #

Ord (v n) => Ord (Direction v n) 
Instance details

Defined in Diagrams.Direction

Methods

compare :: Direction v n -> Direction v n -> Ordering #

(<) :: Direction v n -> Direction v n -> Bool #

(<=) :: Direction v n -> Direction v n -> Bool #

(>) :: Direction v n -> Direction v n -> Bool #

(>=) :: Direction v n -> Direction v n -> Bool #

max :: Direction v n -> Direction v n -> Direction v n #

min :: Direction v n -> Direction v n -> Direction v n #

Read (v n) => Read (Direction v n) 
Instance details

Defined in Diagrams.Direction

Show (v n) => Show (Direction v n) 
Instance details

Defined in Diagrams.Direction

Methods

showsPrec :: Int -> Direction v n -> ShowS #

show :: Direction v n -> String #

showList :: [Direction v n] -> ShowS #

(V (v n) ~ v, N (v n) ~ n, Transformable (v n)) => Transformable (Direction v n) 
Instance details

Defined in Diagrams.Direction

Methods

transform :: Transformation (V (Direction v n)) (N (Direction v n)) -> Direction v n -> Direction v n #

type V (Direction v n) 
Instance details

Defined in Diagrams.Direction

type V (Direction v n) = v
type N (Direction v n) 
Instance details

Defined in Diagrams.Direction

type N (Direction v n) = n

rotate :: (InSpace V2 n t, Transformable t, Floating n) => Angle n -> t -> t #

Rotate about the local origin by the given angle. Positive angles correspond to counterclockwise rotation, negative to clockwise. The angle can be expressed using any of the Isos on Angle. For example, rotate (1/4 @@ turn), rotate (tau/4 @@ rad), and rotate (90 @@ deg) all represent the same transformation, namely, a counterclockwise rotation by a right angle. To rotate about some point other than the local origin, see rotateAbout.

Note that writing rotate (1/4), with no Angle constructor, will yield an error since GHC cannot figure out which sort of angle you want to use. In this common situation you can use rotateBy, which interprets its argument as a number of turns.

rotation :: Floating n => Angle n -> Transformation V2 n #

Create a transformation which performs a rotation about the local origin by the given angle. See also rotate.

normalizeAngle :: (Floating n, Real n) => Angle n -> Angle n #

Normalize an angle so that it lies in the [0,tau) range.

angleBetween :: (Metric v, Floating n, Ord n) => v n -> v n -> Angle n #

Compute the positive angle between the two vectors in their common plane in the [0,pi] range. For a signed angle see signedAngleBetween.

Returns NaN if either of the vectors are zero.

(@@) :: b -> AReview a b -> a infixl 5 #

30 @@ deg is an Angle of the given measure and units.

>>> pi @@ rad
3.141592653589793 @@ rad
>>> 1 @@ turn
6.283185307179586 @@ rad
>>> 30 @@ deg
0.5235987755982988 @@ rad

For Iso's, (@@) reverses the Iso' on its right, and applies the Iso' to the value on the left. Angles are the motivating example where this order improves readability.

This is the same as a flipped review.

(@@) :: a -> Iso'      s a -> s
(@@) :: a -> Prism'    s a -> s
(@@) :: a -> Review    s a -> s
(@@) :: a -> Equality' s a -> s

atan2A' :: OrderedField n => n -> n -> Angle n #

Similar to atan2A but without the RealFloat constraint. This means it doesn't handle negative zero cases. However, for most geometric purposes, the outcome will be the same.

atan2A :: RealFloat n => n -> n -> Angle n #

atan2A y x is the angle between the positive x-axis and the vector given by the coordinates (x, y). The Angle returned is in the [-pi,pi] range.

atanA :: Floating n => n -> Angle n #

The Angle with the given tangent.

acosA :: Floating n => n -> Angle n #

The Angle with the given cosine.

asinA :: Floating n => n -> Angle n #

The Angle with the given sine.

tanA :: Floating n => Angle n -> n #

The tangent function of the given Angle.

cosA :: Floating n => Angle n -> n #

The cosine of the given Angle.

sinA :: Floating n => Angle n -> n #

The sine of the given Angle.

angleRatio :: Floating n => Angle n -> Angle n -> n #

Calculate ratio between two angles.

quarterTurn :: Floating v => Angle v #

An angle representing a quarter turn.

halfTurn :: Floating v => Angle v #

An angle representing a half turn.

fullTurn :: Floating v => Angle v #

An angle representing one full turn.

deg :: Floating n => Iso' (Angle n) n #

The degree measure of an Angle a can be accessed as a ^. deg. A new Angle can be defined in degrees as 180 @@ deg.

turn :: Floating n => Iso' (Angle n) n #

The measure of an Angle a in full circles can be accessed as a ^. turn. A new Angle of one-half circle can be defined in as 1/2 @@ turn.

rad :: Iso' (Angle n) n #

The radian measure of an Angle a can be accessed as a ^. rad. A new Angle can be defined in radians as pi @@ rad.

data Angle n #

Angles can be expressed in a variety of units. Internally, they are represented in radians.

Instances
Functor Angle 
Instance details

Defined in Diagrams.Angle

Methods

fmap :: (a -> b) -> Angle a -> Angle b #

(<$) :: a -> Angle b -> Angle a #

Applicative Angle 
Instance details

Defined in Diagrams.Angle

Methods

pure :: a -> Angle a #

(<*>) :: Angle (a -> b) -> Angle a -> Angle b #

liftA2 :: (a -> b -> c) -> Angle a -> Angle b -> Angle c #

(*>) :: Angle a -> Angle b -> Angle b #

(<*) :: Angle a -> Angle b -> Angle a #

Additive Angle 
Instance details

Defined in Diagrams.Angle

Methods

zero :: Num a => Angle a #

(^+^) :: Num a => Angle a -> Angle a -> Angle a #

(^-^) :: Num a => Angle a -> Angle a -> Angle a #

lerp :: Num a => a -> Angle a -> Angle a -> Angle a #

liftU2 :: (a -> a -> a) -> Angle a -> Angle a -> Angle a #

liftI2 :: (a -> b -> c) -> Angle a -> Angle b -> Angle c #

Enum n => Enum (Angle n) 
Instance details

Defined in Diagrams.Angle

Methods

succ :: Angle n -> Angle n #

pred :: Angle n -> Angle n #

toEnum :: Int -> Angle n #

fromEnum :: Angle n -> Int #

enumFrom :: Angle n -> [Angle n] #

enumFromThen :: Angle n -> Angle n -> [Angle n] #

enumFromTo :: Angle n -> Angle n -> [Angle n] #

enumFromThenTo :: Angle n -> Angle n -> Angle n -> [Angle n] #

Eq n => Eq (Angle n) 
Instance details

Defined in Diagrams.Angle

Methods

(==) :: Angle n -> Angle n -> Bool #

(/=) :: Angle n -> Angle n -> Bool #

Ord n => Ord (Angle n) 
Instance details

Defined in Diagrams.Angle

Methods

compare :: Angle n -> Angle n -> Ordering #

(<) :: Angle n -> Angle n -> Bool #

(<=) :: Angle n -> Angle n -> Bool #

(>) :: Angle n -> Angle n -> Bool #

(>=) :: Angle n -> Angle n -> Bool #

max :: Angle n -> Angle n -> Angle n #

min :: Angle n -> Angle n -> Angle n #

Read n => Read (Angle n) 
Instance details

Defined in Diagrams.Angle

Show n => Show (Angle n) 
Instance details

Defined in Diagrams.Angle

Methods

showsPrec :: Int -> Angle n -> ShowS #

show :: Angle n -> String #

showList :: [Angle n] -> ShowS #

Num n => Semigroup (Angle n) 
Instance details

Defined in Diagrams.Angle

Methods

(<>) :: Angle n -> Angle n -> Angle n #

sconcat :: NonEmpty (Angle n) -> Angle n #

stimes :: Integral b => b -> Angle n -> Angle n #

Num n => Monoid (Angle n) 
Instance details

Defined in Diagrams.Angle

Methods

mempty :: Angle n #

mappend :: Angle n -> Angle n -> Angle n #

mconcat :: [Angle n] -> Angle n #

(V t ~ V2, N t ~ n, Transformable t, Floating n) => Action (Angle n) t

Angles act on other things by rotation.

Instance details

Defined in Diagrams.Angle

Methods

act :: Angle n -> t -> t #

type N (Angle n) 
Instance details

Defined in Diagrams.Angle

type N (Angle n) = n

class HasTheta (t :: Type -> Type) where #

The class of types with at least one angle coordinate, called _theta.

Methods

_theta :: RealFloat n => Lens' (t n) (Angle n) #

Instances
HasTheta v => HasTheta (Point v) 
Instance details

Defined in Diagrams.Angle

Methods

_theta :: RealFloat n => Lens' (Point v n) (Angle n) #

HasTheta v => HasTheta (Direction v) 
Instance details

Defined in Diagrams.Direction

Methods

_theta :: RealFloat n => Lens' (Direction v n) (Angle n) #

class HasTheta t => HasPhi (t :: Type -> Type) where #

The class of types with at least two angle coordinates, the second called _phi. _phi is the positive angle measured from the z axis.

Methods

_phi :: RealFloat n => Lens' (t n) (Angle n) #

Instances
HasPhi v => HasPhi (Point v) 
Instance details

Defined in Diagrams.Angle

Methods

_phi :: RealFloat n => Lens' (Point v n) (Angle n) #

HasPhi v => HasPhi (Direction v) 
Instance details

Defined in Diagrams.Direction

Methods

_phi :: RealFloat n => Lens' (Direction v n) (Angle n) #

class Coordinates c where #

Types which are instances of the Coordinates class can be constructed using ^& (for example, a three-dimensional vector could be constructed by 1 ^& 6 ^& 3), and deconstructed using coords. A common pattern is to use coords in conjunction with the ViewPatterns extension, like so:

foo :: Vector3 -> ...
foo (coords -> x :& y :& z) = ...

Minimal complete definition

(^&), coords

Associated Types

type FinalCoord c :: Type #

The type of the final coordinate.

type PrevDim c :: Type #

The type of everything other than the final coordinate.

type Decomposition c :: Type #

Decomposition of c into applications of :&.

Methods

(^&) :: PrevDim c -> FinalCoord c -> c infixl 7 #

Construct a value of type c by providing something of one less dimension (which is perhaps itself recursively constructed using (^&)) and a final coordinate. For example,

2 ^& 3 :: P2
3 ^& 5 ^& 6 :: V3

Note that ^& is left-associative.

pr :: PrevDim c -> FinalCoord c -> c #

Prefix synonym for ^&. pr stands for pair of PrevDim, FinalCoord

coords :: c -> Decomposition c #

Decompose a value of type c into its constituent coordinates, stored in a nested (:&) structure.

Instances
Coordinates (V2 n) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (V2 n) :: Type #

type PrevDim (V2 n) :: Type #

type Decomposition (V2 n) :: Type #

Methods

(^&) :: PrevDim (V2 n) -> FinalCoord (V2 n) -> V2 n #

pr :: PrevDim (V2 n) -> FinalCoord (V2 n) -> V2 n #

coords :: V2 n -> Decomposition (V2 n) #

Coordinates (V3 n) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (V3 n) :: Type #

type PrevDim (V3 n) :: Type #

type Decomposition (V3 n) :: Type #

Methods

(^&) :: PrevDim (V3 n) -> FinalCoord (V3 n) -> V3 n #

pr :: PrevDim (V3 n) -> FinalCoord (V3 n) -> V3 n #

coords :: V3 n -> Decomposition (V3 n) #

Coordinates (V4 n) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (V4 n) :: Type #

type PrevDim (V4 n) :: Type #

type Decomposition (V4 n) :: Type #

Methods

(^&) :: PrevDim (V4 n) -> FinalCoord (V4 n) -> V4 n #

pr :: PrevDim (V4 n) -> FinalCoord (V4 n) -> V4 n #

coords :: V4 n -> Decomposition (V4 n) #

Coordinates (a, b) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (a, b) :: Type #

type PrevDim (a, b) :: Type #

type Decomposition (a, b) :: Type #

Methods

(^&) :: PrevDim (a, b) -> FinalCoord (a, b) -> (a, b) #

pr :: PrevDim (a, b) -> FinalCoord (a, b) -> (a, b) #

coords :: (a, b) -> Decomposition (a, b) #

Coordinates (v n) => Coordinates (Point v n) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (Point v n) :: Type #

type PrevDim (Point v n) :: Type #

type Decomposition (Point v n) :: Type #

Methods

(^&) :: PrevDim (Point v n) -> FinalCoord (Point v n) -> Point v n #

pr :: PrevDim (Point v n) -> FinalCoord (Point v n) -> Point v n #

coords :: Point v n -> Decomposition (Point v n) #

Coordinates (a :& b) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (a :& b) :: Type #

type PrevDim (a :& b) :: Type #

type Decomposition (a :& b) :: Type #

Methods

(^&) :: PrevDim (a :& b) -> FinalCoord (a :& b) -> a :& b #

pr :: PrevDim (a :& b) -> FinalCoord (a :& b) -> a :& b #

coords :: (a :& b) -> Decomposition (a :& b) #

Coordinates (a, b, c) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (a, b, c) :: Type #

type PrevDim (a, b, c) :: Type #

type Decomposition (a, b, c) :: Type #

Methods

(^&) :: PrevDim (a, b, c) -> FinalCoord (a, b, c) -> (a, b, c) #

pr :: PrevDim (a, b, c) -> FinalCoord (a, b, c) -> (a, b, c) #

coords :: (a, b, c) -> Decomposition (a, b, c) #

Coordinates (a, b, c, d) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (a, b, c, d) :: Type #

type PrevDim (a, b, c, d) :: Type #

type Decomposition (a, b, c, d) :: Type #

Methods

(^&) :: PrevDim (a, b, c, d) -> FinalCoord (a, b, c, d) -> (a, b, c, d) #

pr :: PrevDim (a, b, c, d) -> FinalCoord (a, b, c, d) -> (a, b, c, d) #

coords :: (a, b, c, d) -> Decomposition (a, b, c, d) #

data a :& b infixl 7 #

A pair of values, with a convenient infix (left-associative) data constructor.

Constructors

a :& b infixl 7 
Instances
(Eq a, Eq b) => Eq (a :& b) 
Instance details

Defined in Diagrams.Coordinates

Methods

(==) :: (a :& b) -> (a :& b) -> Bool #

(/=) :: (a :& b) -> (a :& b) -> Bool #

(Ord a, Ord b) => Ord (a :& b) 
Instance details

Defined in Diagrams.Coordinates

Methods

compare :: (a :& b) -> (a :& b) -> Ordering #

(<) :: (a :& b) -> (a :& b) -> Bool #

(<=) :: (a :& b) -> (a :& b) -> Bool #

(>) :: (a :& b) -> (a :& b) -> Bool #

(>=) :: (a :& b) -> (a :& b) -> Bool #

max :: (a :& b) -> (a :& b) -> a :& b #

min :: (a :& b) -> (a :& b) -> a :& b #

(Show a, Show b) => Show (a :& b) 
Instance details

Defined in Diagrams.Coordinates

Methods

showsPrec :: Int -> (a :& b) -> ShowS #

show :: (a :& b) -> String #

showList :: [a :& b] -> ShowS #

Coordinates (a :& b) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (a :& b) :: Type #

type PrevDim (a :& b) :: Type #

type Decomposition (a :& b) :: Type #

Methods

(^&) :: PrevDim (a :& b) -> FinalCoord (a :& b) -> a :& b #

pr :: PrevDim (a :& b) -> FinalCoord (a :& b) -> a :& b #

coords :: (a :& b) -> Decomposition (a :& b) #

type Decomposition (a :& b) 
Instance details

Defined in Diagrams.Coordinates

type Decomposition (a :& b) = a :& b
type PrevDim (a :& b) 
Instance details

Defined in Diagrams.Coordinates

type PrevDim (a :& b) = a
type FinalCoord (a :& b) 
Instance details

Defined in Diagrams.Coordinates

type FinalCoord (a :& b) = b

centroid :: (Additive v, Fractional n) => [Point v n] -> Point v n #

The centroid of a set of n points is their sum divided by n. Returns the origin for an empty list of points.

adjust :: (N t ~ n, Sectionable t, HasArcLength t, Fractional n) => t -> AdjustOpts n -> t #

Adjust the length of a parametric object such as a segment or trail. The second parameter is an option record which controls how the adjustment should be performed; see AdjustOpts.

adjSide :: Lens' (AdjustOpts n) AdjustSide #

Which end(s) of the object should be adjusted?

adjMethod :: Lens' (AdjustOpts n) (AdjustMethod n) #

Which method should be used for adjusting?

adjEps :: Lens' (AdjustOpts n) n #

Tolerance to use when doing adjustment.

data AdjustMethod n #

What method should be used for adjusting a segment, trail, or path?

Constructors

ByParam n

Extend by the given parameter value (use a negative parameter to shrink)

ByAbsolute n

Extend by the given arc length (use a negative length to shrink)

ToAbsolute n

Extend or shrink to the given arc length

Instances
Fractional n => Default (AdjustMethod n) 
Instance details

Defined in Diagrams.Parametric.Adjust

Methods

def :: AdjustMethod n #

data AdjustSide #

Which side of a segment, trail, or path should be adjusted?

Constructors

Start

Adjust only the beginning

End

Adjust only the end

Both

Adjust both sides equally

Instances
Bounded AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Enum AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Eq AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Ord AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Read AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Show AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Default AdjustSide 
Instance details

Defined in Diagrams.Parametric.Adjust

Methods

def :: AdjustSide #

data AdjustOpts n #

How should a segment, trail, or path be adjusted?

Instances
Fractional n => Default (AdjustOpts n) 
Instance details

Defined in Diagrams.Parametric.Adjust

Methods

def :: AdjustOpts n #

stdTolerance :: Fractional a => a #

The standard tolerance used by std... functions (like stdArcLength and stdArcLengthToParam, currently set at 1e-6.

domainBounds :: DomainBounds p => p -> (N p, N p) #

Return the lower and upper bounds of a parametric domain together as a pair.

type family Codomain p :: Type -> Type #

Codomain of parametric classes. This is usually either (V p), for relative vector results, or (Point (V p)), for functions with absolute coordinates.

Instances
type Codomain (GetSegment t) 
Instance details

Defined in Diagrams.Trail

type Codomain (Tangent t) 
Instance details

Defined in Diagrams.Tangent

type Codomain (Tangent t) = V t
type Codomain (Located a) 
Instance details

Defined in Diagrams.Located

type Codomain (BernsteinPoly n) 
Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

type Codomain (SegTree v n) 
Instance details

Defined in Diagrams.Trail

type Codomain (SegTree v n) = v
type Codomain (Trail v n) 
Instance details

Defined in Diagrams.Trail

type Codomain (Trail v n) = v
type Codomain (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

type Codomain (FixedSegment v n) = Point v
type Codomain (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

type Codomain (Trail' l v n) = v
type Codomain (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

type Codomain (Segment Closed v n) = v

class Parametric p where #

Type class for parametric functions.

Methods

atParam :: p -> N p -> Codomain p (N p) #

atParam yields a parameterized view of an object as a continuous function. It is designed to be used infix, like path `atParam` 0.5.

Instances
(Metric v, OrderedField n) => Parametric (GetSegment (Trail' Line v n))

Parameters less than 0 yield the first segment; parameters greater than 1 yield the last. A parameter exactly at the junction of two segments yields the second segment (i.e. the one with higher parameter values).

Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail' Loop v n))

The parameterization for loops wraps around, i.e. parameters are first reduced "mod 1".

Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => Parametric (GetSegment (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: GetSegment (Trail v n) -> N (GetSegment (Trail v n)) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

(Parametric (GetSegment (Trail' c v n)), Additive v, Num n) => Parametric (Tangent (Trail' c v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Tangent (Trail' c v n) -> N (Tangent (Trail' c v n)) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

(Metric v, OrderedField n, Real n) => Parametric (Tangent (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Tangent (Trail v n) -> N (Tangent (Trail v n)) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

(Additive v, Num n) => Parametric (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

(Additive v, Num n) => Parametric (Tangent (FixedSegment v n)) 
Instance details

Defined in Diagrams.Tangent

Parametric (Tangent t) => Parametric (Tangent (Located t)) 
Instance details

Defined in Diagrams.Tangent

Methods

atParam :: Tangent (Located t) -> N (Tangent (Located t)) -> Codomain (Tangent (Located t)) (N (Tangent (Located t))) #

(InSpace v n a, Parametric a, Codomain a ~ v) => Parametric (Located a) 
Instance details

Defined in Diagrams.Located

Methods

atParam :: Located a -> N (Located a) -> Codomain (Located a) (N (Located a)) #

Fractional n => Parametric (BernsteinPoly n) 
Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

(Metric v, OrderedField n, Real n) => Parametric (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: SegTree v n -> N (SegTree v n) -> Codomain (SegTree v n) (N (SegTree v n)) #

(Metric v, OrderedField n, Real n) => Parametric (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Trail v n -> N (Trail v n) -> Codomain (Trail v n) (N (Trail v n)) #

(Additive v, Num n) => Parametric (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Methods

atParam :: FixedSegment v n -> N (FixedSegment v n) -> Codomain (FixedSegment v n) (N (FixedSegment v n)) #

(Metric v, OrderedField n, Real n) => Parametric (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

atParam :: Trail' l v n -> N (Trail' l v n) -> Codomain (Trail' l v n) (N (Trail' l v n)) #

(Additive v, Num n) => Parametric (Segment Closed v n)

atParam yields a parametrized view of segments as continuous functions [0,1] -> v, which give the offset from the start of the segment for each value of the parameter between 0 and 1. It is designed to be used infix, like seg `atParam` 0.5.

Instance details

Defined in Diagrams.Segment

Methods

atParam :: Segment Closed v n -> N (Segment Closed v n) -> Codomain (Segment Closed v n) (N (Segment Closed v n)) #

class DomainBounds p where #

Type class for parametric functions with a bounded domain. The default bounds are [0,1].

Note that this domain indicates the main "interesting" portion of the function. It must be defined within this range, but for some instances may still have sensible values outside.

Minimal complete definition

Nothing

Methods

domainLower :: p -> N p #

domainLower defaults to being constantly 0 (for vector spaces with numeric scalars).

domainUpper :: p -> N p #

domainUpper defaults to being constantly 1 (for vector spaces with numeric scalars).

Instances
DomainBounds t => DomainBounds (GetSegment t) 
Instance details

Defined in Diagrams.Trail

DomainBounds t => DomainBounds (Tangent t) 
Instance details

Defined in Diagrams.Tangent

Methods

domainLower :: Tangent t -> N (Tangent t) #

domainUpper :: Tangent t -> N (Tangent t) #

DomainBounds a => DomainBounds (Located a) 
Instance details

Defined in Diagrams.Located

Methods

domainLower :: Located a -> N (Located a) #

domainUpper :: Located a -> N (Located a) #

Num n => DomainBounds (BernsteinPoly n) 
Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

Num n => DomainBounds (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

domainLower :: SegTree v n -> N (SegTree v n) #

domainUpper :: SegTree v n -> N (SegTree v n) #

Num n => DomainBounds (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

domainLower :: Trail v n -> N (Trail v n) #

domainUpper :: Trail v n -> N (Trail v n) #

Num n => DomainBounds (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

Num n => DomainBounds (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

domainLower :: Trail' l v n -> N (Trail' l v n) #

domainUpper :: Trail' l v n -> N (Trail' l v n) #

Num n => DomainBounds (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

class (Parametric p, DomainBounds p) => EndValues p where #

Type class for querying the values of a parametric object at the ends of its domain.

Minimal complete definition

Nothing

Methods

atStart :: p -> Codomain p (N p) #

atStart is the value at the start of the domain. That is,

atStart x = x `atParam` domainLower x

This is the default implementation, but some representations will have a more efficient and/or precise implementation.

atEnd :: p -> Codomain p (N p) #

atEnd is the value at the end of the domain. That is,

atEnd x = x `atParam` domainUpper x

This is the default implementation, but some representations will have a more efficient and/or precise implementation.

Instances
(Metric v, OrderedField n) => EndValues (GetSegment (Trail' Line v n)) 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail' Loop v n)) 
Instance details

Defined in Diagrams.Trail

(Metric v, OrderedField n, Real n) => EndValues (GetSegment (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

atEnd :: GetSegment (Trail v n) -> Codomain (GetSegment (Trail v n)) (N (GetSegment (Trail v n))) #

(Parametric (GetSegment (Trail' c v n)), EndValues (GetSegment (Trail' c v n)), Additive v, Num n) => EndValues (Tangent (Trail' c v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

atEnd :: Tangent (Trail' c v n) -> Codomain (Tangent (Trail' c v n)) (N (Tangent (Trail' c v n))) #

(Metric v, OrderedField n, Real n) => EndValues (Tangent (Trail v n)) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

atEnd :: Tangent (Trail v n) -> Codomain (Tangent (Trail v n)) (N (Tangent (Trail v n))) #

(Additive v, Num n) => EndValues (Tangent (Segment Closed v n)) 
Instance details

Defined in Diagrams.Tangent

(Additive v, Num n) => EndValues (Tangent (FixedSegment v n)) 
Instance details

Defined in Diagrams.Tangent

(DomainBounds t, EndValues (Tangent t)) => EndValues (Tangent (Located t)) 
Instance details

Defined in Diagrams.Tangent

(InSpace v n a, EndValues a, Codomain a ~ v) => EndValues (Located a) 
Instance details

Defined in Diagrams.Located

Methods

atStart :: Located a -> Codomain (Located a) (N (Located a)) #

atEnd :: Located a -> Codomain (Located a) (N (Located a)) #

Fractional n => EndValues (BernsteinPoly n) 
Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

(Metric v, OrderedField n, Real n) => EndValues (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: SegTree v n -> Codomain (SegTree v n) (N (SegTree v n)) #

atEnd :: SegTree v n -> Codomain (SegTree v n) (N (SegTree v n)) #

(Metric v, OrderedField n, Real n) => EndValues (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Trail v n -> Codomain (Trail v n) (N (Trail v n)) #

atEnd :: Trail v n -> Codomain (Trail v n) (N (Trail v n)) #

(Additive v, Num n) => EndValues (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n, Real n) => EndValues (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

atStart :: Trail' l v n -> Codomain (Trail' l v n) (N (Trail' l v n)) #

atEnd :: Trail' l v n -> Codomain (Trail' l v n) (N (Trail' l v n)) #

(Additive v, Num n) => EndValues (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

class DomainBounds p => Sectionable p where #

Type class for parametric objects which can be split into subobjects.

Minimal definition: Either splitAtParam or section, plus reverseDomain.

Minimal complete definition

reverseDomain

Methods

splitAtParam :: p -> N p -> (p, p) #

splitAtParam splits an object p into two new objects (l,r) at the parameter t, where l corresponds to the portion of p for parameter values from 0 to t and r for to that from t to 1. The following property should hold:

  prop_splitAtParam f t u =
    | u < t     = atParam f u == atParam l (u / t)
    | otherwise = atParam f u == atParam f t ??? atParam l ((u - t) / (domainUpper f - t))
    where (l,r) = splitAtParam f t

where (???) = (^+^) if the codomain is a vector type, or const flip if the codomain is a point type. Stated more intuitively, all this is to say that the parameterization scales linearly with splitting.

splitAtParam can also be used with parameters outside the range of the domain. For example, using the parameter 2 with a path (where the domain is the default [0,1]) gives two result paths where the first is the original path extended to the parameter 2, and the second result path travels backwards from the end of the first to the end of the original path.

section :: p -> N p -> N p -> p #

Extract a particular section of the domain, linearly reparameterized to the same domain as the original. Should satisfy the property:

prop_section x l u t =
  let s = section x l u
  in     domainBounds x == domainBounds x
      && (x `atParam` lerp l u t) == (s `atParam` t)

That is, the section should have the same domain as the original, and the reparameterization should be linear.

reverseDomain :: p -> p #

Flip the parameterization on the domain.

Instances
(InSpace v n a, Fractional n, Parametric a, Sectionable a, Codomain a ~ v) => Sectionable (Located a) 
Instance details

Defined in Diagrams.Located

Methods

splitAtParam :: Located a -> N (Located a) -> (Located a, Located a) #

section :: Located a -> N (Located a) -> N (Located a) -> Located a #

reverseDomain :: Located a -> Located a #

Fractional n => Sectionable (BernsteinPoly n) 
Instance details

Defined in Diagrams.TwoD.Segment.Bernstein

(Metric v, OrderedField n, Real n) => Sectionable (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

splitAtParam :: SegTree v n -> N (SegTree v n) -> (SegTree v n, SegTree v n) #

section :: SegTree v n -> N (SegTree v n) -> N (SegTree v n) -> SegTree v n #

reverseDomain :: SegTree v n -> SegTree v n #

(Metric v, OrderedField n, Real n) => Sectionable (Trail v n)

Note that there is no Sectionable instance for Trail' Loop, because it does not make sense (splitting a loop at a parameter results in a single line, not two loops). However, it's convenient to have a Sectionable instance for Trail; if the Trail contains a loop the loop will first be cut and then splitAtParam called on the resulting line. This is semantically a bit silly, so please don't rely on it. (*E.g.* if this is really the behavior you want, consider first calling cutLoop yourself.)

Instance details

Defined in Diagrams.Trail

Methods

splitAtParam :: Trail v n -> N (Trail v n) -> (Trail v n, Trail v n) #

section :: Trail v n -> N (Trail v n) -> N (Trail v n) -> Trail v n #

reverseDomain :: Trail v n -> Trail v n #

(Additive v, Fractional n) => Sectionable (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n, Real n) => Sectionable (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

splitAtParam :: Trail' Line v n -> N (Trail' Line v n) -> (Trail' Line v n, Trail' Line v n) #

section :: Trail' Line v n -> N (Trail' Line v n) -> N (Trail' Line v n) -> Trail' Line v n #

reverseDomain :: Trail' Line v n -> Trail' Line v n #

(Additive v, Fractional n) => Sectionable (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

class Parametric p => HasArcLength p where #

Type class for parametric things with a notion of arc length.

Minimal complete definition

arcLengthBounded, arcLengthToParam

Methods

arcLengthBounded :: N p -> p -> Interval (N p) #

arcLengthBounded eps x approximates the arc length of x. The true arc length is guaranteed to lie within the interval returned, which will have a size of at most eps.

arcLength :: N p -> p -> N p #

arcLength eps s approximates the arc length of x up to the accuracy eps (plus or minus).

stdArcLength :: p -> N p #

Approximate the arc length up to a standard accuracy of stdTolerance (1e-6).

arcLengthToParam :: N p -> p -> N p -> N p #

arcLengthToParam eps s l converts the absolute arc length l, measured from the start of the domain, to a parameter on the object s. The true arc length at the parameter returned is guaranteed to be within eps of the requested arc length.

This should work for any arc length, and may return any parameter value (not just parameters in the domain).

stdArcLengthToParam :: p -> N p -> N p #

A simple interface to convert arc length to a parameter, guaranteed to be accurate within stdTolerance, or 1e-6.

Instances
(InSpace v n a, Fractional n, HasArcLength a, Codomain a ~ v) => HasArcLength (Located a) 
Instance details

Defined in Diagrams.Located

Methods

arcLengthBounded :: N (Located a) -> Located a -> Interval (N (Located a)) #

arcLength :: N (Located a) -> Located a -> N (Located a) #

stdArcLength :: Located a -> N (Located a) #

arcLengthToParam :: N (Located a) -> Located a -> N (Located a) -> N (Located a) #

stdArcLengthToParam :: Located a -> N (Located a) -> N (Located a) #

(Metric v, OrderedField n, Real n) => HasArcLength (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (SegTree v n) -> SegTree v n -> Interval (N (SegTree v n)) #

arcLength :: N (SegTree v n) -> SegTree v n -> N (SegTree v n) #

stdArcLength :: SegTree v n -> N (SegTree v n) #

arcLengthToParam :: N (SegTree v n) -> SegTree v n -> N (SegTree v n) -> N (SegTree v n) #

stdArcLengthToParam :: SegTree v n -> N (SegTree v n) -> N (SegTree v n) #

(Metric v, OrderedField n, Real n) => HasArcLength (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (Trail v n) -> Trail v n -> Interval (N (Trail v n)) #

arcLength :: N (Trail v n) -> Trail v n -> N (Trail v n) #

stdArcLength :: Trail v n -> N (Trail v n) #

arcLengthToParam :: N (Trail v n) -> Trail v n -> N (Trail v n) -> N (Trail v n) #

stdArcLengthToParam :: Trail v n -> N (Trail v n) -> N (Trail v n) #

(Metric v, OrderedField n) => HasArcLength (FixedSegment v n) 
Instance details

Defined in Diagrams.Segment

(Metric v, OrderedField n, Real n) => HasArcLength (Trail' l v n) 
Instance details

Defined in Diagrams.Trail

Methods

arcLengthBounded :: N (Trail' l v n) -> Trail' l v n -> Interval (N (Trail' l v n)) #

arcLength :: N (Trail' l v n) -> Trail' l v n -> N (Trail' l v n) #

stdArcLength :: Trail' l v n -> N (Trail' l v n) #

arcLengthToParam :: N (Trail' l v n) -> Trail' l v n -> N (Trail' l v n) -> N (Trail' l v n) #

stdArcLengthToParam :: Trail' l v n -> N (Trail' l v n) -> N (Trail' l v n) #

(Metric v, OrderedField n) => HasArcLength (Segment Closed v n) 
Instance details

Defined in Diagrams.Segment

namePoint :: (IsName nm, Metric v, OrderedField n, Semigroup m) => (QDiagram b v n m -> Point v n) -> nm -> QDiagram b v n m -> QDiagram b v n m #

Attach an atomic name to a certain point (which may be computed from the given diagram), treated as a subdiagram with no content and a point envelope.

named :: (IsName nm, Metric v, OrderedField n, Semigroup m) => nm -> QDiagram b v n m -> QDiagram b v n m #

Attach an atomic name to a diagram.

committed :: Iso (Recommend a) (Recommend b) a b #

Commit a value for any Recommend. This is *not* a valid Iso because the resulting Recommend b is always a Commit. This is useful because it means any Recommend styles set with a lens will not be accidentally overridden. If you want a valid lens onto a recommend value use _recommend.

Other lenses that use this are labeled with a warning.

isCommitted :: Lens' (Recommend a) Bool #

Lens onto whether something is committed or not.

_recommend :: Lens (Recommend a) (Recommend b) a b #

Lens onto the value inside either a Recommend or Commit. Unlike committed, this is a valid lens.

_Commit :: Prism' (Recommend a) a #

Prism onto a Commit.

_Recommend :: Prism' (Recommend a) a #

Prism onto a Recommend.

_lineMiterLimit :: Lens' (Style v n) Double #

Lens onto the line miter limit in a style.

lineMiterLimitA :: HasStyle a => LineMiterLimit -> a -> a #

Apply a LineMiterLimit attribute.

lineMiterLimit :: HasStyle a => Double -> a -> a #

Set the miter limit for joins with LineJoinMiter.

_lineJoin :: Lens' (Style v n) LineJoin #

Lens onto the line join type in a style.

lineJoin :: HasStyle a => LineJoin -> a -> a #

Set the segment join style.

_lineCap :: Lens' (Style v n) LineCap #

Lens onto the line cap in a style.

lineCap :: HasStyle a => LineCap -> a -> a #

Set the line end cap attribute.

_strokeOpacity :: Lens' (Style v n) Double #

Lens onto the stroke opacity in a style.

strokeOpacity :: HasStyle a => Double -> a -> a #

Multiply the stroke opacity (see StrokeOpacity) by the given value. For example, strokeOpacity 0.8 means "decrease this diagram's stroke opacity to 80% of its previous value".

_fillOpacity :: Lens' (Style v n) Double #

Lens onto the fill opacity in a style.

fillOpacity :: HasStyle a => Double -> a -> a #

Multiply the fill opacity (see FillOpacity) by the given value. For example, fillOpacity 0.8 means "decrease this diagram's fill opacity to 80% of its previous value".

_opacity :: Lens' (Style v n) Double #

Lens onto the opacity in a style.

opacity :: HasStyle a => Double -> a -> a #

Multiply the opacity (see Opacity) by the given value. For example, opacity 0.8 means "decrease this diagram's opacity to 80% of its previous opacity".

colorToRGBA :: Color c => c -> (Double, Double, Double, Double) #

Convert to sRGBA.

colorToSRGBA :: Color c => c -> (Double, Double, Double, Double) #

Convert to sRGBA.

_dashingU :: Typeable n => Lens' (Style v n) (Maybe (Dashing n)) #

Lens onto the unmeasured Dashing attribute. This is useful for backends to use on styles once they have been unmeasured. Using on a diagram style could lead to unexpected results.

_dashing :: Typeable n => Lens' (Style v n) (Maybe (Measured n (Dashing n))) #

Lens onto a measured dashing attribute in a style.

dashingL :: (N a ~ n, HasStyle a, Typeable n, Num n) => [n] -> n -> a -> a #

A convenient sysnonym for 'dashing (local w)'.

dashingO :: (N a ~ n, HasStyle a, Typeable n) => [n] -> n -> a -> a #

A convenient synonym for 'dashing (output w)'.

dashingN :: (N a ~ n, HasStyle a, Typeable n, Num n) => [n] -> n -> a -> a #

A convenient synonym for 'dashing (normalized w)'.

dashingG :: (N a ~ n, HasStyle a, Typeable n, Num n) => [n] -> n -> a -> a #

A convenient synonym for 'dashing (global w)'.

dashing #

Arguments

:: (N a ~ n, HasStyle a, Typeable n) 
=> [Measure n]

A list specifying alternate lengths of on and off portions of the stroke. The empty list indicates no dashing.

-> Measure n

An offset into the dash pattern at which the stroke should start.

-> a 
-> a 

Set the line dashing style.

_lineWidthU :: Typeable n => Lens' (Style v n) (Maybe n) #

Lens onto the unmeasured linewith attribute. This is useful for backends to use on styles once they have been unmeasured. Using on a diagram style could lead to unexpected results.

_lw :: (Typeable n, OrderedField n) => Lens' (Style v n) (Measure n) #

Lens onto a measured line width in a style.

_lineWidth :: (Typeable n, OrderedField n) => Lens' (Style v n) (Measure n) #

Lens onto a measured line width in a style.

lwL :: (N a ~ n, HasStyle a, Typeable n, Num n) => n -> a -> a #

A convenient sysnonym for 'lineWidth (local w)'.

lwO :: (N a ~ n, HasStyle a, Typeable n) => n -> a -> a #

A convenient synonym for 'lineWidth (output w)'.

lwN :: (N a ~ n, HasStyle a, Typeable n, Num n) => n -> a -> a #

A convenient synonym for 'lineWidth (normalized w)'.

lwG :: (N a ~ n, HasStyle a, Typeable n, Num n) => n -> a -> a #

A convenient synonym for 'lineWidth (global w)'.

lw :: (N a ~ n, HasStyle a, Typeable n) => Measure n -> a -> a #

Default for lineWidth.

lineWidthM :: (N a ~ n, HasStyle a, Typeable n) => LineWidthM n -> a -> a #

Apply a LineWidth attribute.

lineWidth :: (N a ~ n, HasStyle a, Typeable n) => Measure n -> a -> a #

Set the line (stroke) width.

_LineWidthM :: Iso' (LineWidthM n) (Measure n) #

data LineWidth n #

Line widths specified on child nodes always override line widths specified at parent nodes.

Instances
Semigroup (LineWidth n) 
Instance details

Defined in Diagrams.Attributes

Methods

(<>) :: LineWidth n -> LineWidth n -> LineWidth n #

sconcat :: NonEmpty (LineWidth n) -> LineWidth n #

stimes :: Integral b => b -> LineWidth n -> LineWidth n #

OrderedField n => Default (LineWidthM n) 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineWidthM n #

Typeable n => AttributeClass (LineWidth n) 
Instance details

Defined in Diagrams.Attributes

data Dashing n #

Create lines that are dashing... er, dashed.

Constructors

Dashing [n] n 
Instances
Functor Dashing 
Instance details

Defined in Diagrams.Attributes

Methods

fmap :: (a -> b) -> Dashing a -> Dashing b #

(<$) :: a -> Dashing b -> Dashing a #

Eq n => Eq (Dashing n) 
Instance details

Defined in Diagrams.Attributes

Methods

(==) :: Dashing n -> Dashing n -> Bool #

(/=) :: Dashing n -> Dashing n -> Bool #

Semigroup (Dashing n) 
Instance details

Defined in Diagrams.Attributes

Methods

(<>) :: Dashing n -> Dashing n -> Dashing n #

sconcat :: NonEmpty (Dashing n) -> Dashing n #

stimes :: Integral b => b -> Dashing n -> Dashing n #

Typeable n => AttributeClass (Dashing n) 
Instance details

Defined in Diagrams.Attributes

class Color c where #

The Color type class encompasses color representations which can be used by the Diagrams library. Instances are provided for both the Colour and AlphaColour types from the Data.Colour library.

Methods

toAlphaColour :: c -> AlphaColour Double #

Convert a color to its standard representation, AlphaColour.

fromAlphaColour :: AlphaColour Double -> c #

Convert from an AlphaColour Double. Note that this direction may lose some information. For example, the instance for Colour drops the alpha channel.

data SomeColor where #

An existential wrapper for instances of the Color class.

Constructors

SomeColor :: forall c. Color c => c -> SomeColor 

data Opacity #

Although the individual colors in a diagram can have transparency, the opacity/transparency of a diagram as a whole can be specified with the Opacity attribute. The opacity is a value between 1 (completely opaque, the default) and 0 (completely transparent). Opacity is multiplicative, that is, opacity o1 . opacity o2 === opacity (o1 * o2). In other words, for example, opacity 0.8 means "decrease this diagram's opacity to 80% of its previous opacity".

Instances
Semigroup Opacity 
Instance details

Defined in Diagrams.Attributes

AttributeClass Opacity 
Instance details

Defined in Diagrams.Attributes

data FillOpacity #

Like Opacity, but set the opacity only for fills (as opposed to strokes). As with Opacity, the fill opacity is a value between 1 (completely opaque, the default) and 0 (completely transparent), and is multiplicative.

data StrokeOpacity #

Like Opacity, but set the opacity only for strokes (as opposed to fills). As with Opacity, the fill opacity is a value between 1 (completely opaque, the default) and 0 (completely transparent), and is multiplicative.

data LineCap #

What sort of shape should be placed at the endpoints of lines?

Constructors

LineCapButt

Lines end precisely at their endpoints.

LineCapRound

Lines are capped with semicircles centered on endpoints.

LineCapSquare

Lines are capped with a squares centered on endpoints.

Instances
Eq LineCap 
Instance details

Defined in Diagrams.Attributes

Methods

(==) :: LineCap -> LineCap -> Bool #

(/=) :: LineCap -> LineCap -> Bool #

Ord LineCap 
Instance details

Defined in Diagrams.Attributes

Show LineCap 
Instance details

Defined in Diagrams.Attributes

Semigroup LineCap

Last semigroup structure.

Instance details

Defined in Diagrams.Attributes

Default LineCap 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineCap #

AttributeClass LineCap 
Instance details

Defined in Diagrams.Attributes

data LineJoin #

How should the join points between line segments be drawn?

Constructors

LineJoinMiter

Use a "miter" shape (whatever that is).

LineJoinRound

Use rounded join points.

LineJoinBevel

Use a "bevel" shape (whatever that is). Are these... carpentry terms?

Instances
Eq LineJoin 
Instance details

Defined in Diagrams.Attributes

Ord LineJoin 
Instance details

Defined in Diagrams.Attributes

Show LineJoin 
Instance details

Defined in Diagrams.Attributes

Semigroup LineJoin

Last semigroup structure.

Instance details

Defined in Diagrams.Attributes

Default LineJoin 
Instance details

Defined in Diagrams.Attributes

Methods

def :: LineJoin #

AttributeClass LineJoin 
Instance details

Defined in Diagrams.Attributes

project :: (Metric v, Fractional a) => v a -> v a -> v a #

project u v computes the projection of v onto u.

class R1 (t :: Type -> Type) where #

A space that has at least 1 basis vector _x.

Methods

_x :: Lens' (t a) a #

>>> V1 2 ^._x
2
>>> V1 2 & _x .~ 3
V1 3
Instances
R1 Identity 
Instance details

Defined in Linear.V1

Methods

_x :: Lens' (Identity a) a #

R1 V2 
Instance details

Defined in Linear.V2

Methods

_x :: Lens' (V2 a) a #

R1 V3 
Instance details

Defined in Linear.V3

Methods

_x :: Lens' (V3 a) a #

R1 V4 
Instance details

Defined in Linear.V4

Methods

_x :: Lens' (V4 a) a #

R1 V1 
Instance details

Defined in Linear.V1

Methods

_x :: Lens' (V1 a) a #

R1 f => R1 (Point f) 
Instance details

Defined in Linear.Affine

Methods

_x :: Lens' (Point f a) a #

class R1 t => R2 (t :: Type -> Type) where #

A space that distinguishes 2 orthogonal basis vectors _x and _y, but may have more.

Minimal complete definition

_xy

Methods

_y :: Lens' (t a) a #

>>> V2 1 2 ^._y
2
>>> V2 1 2 & _y .~ 3
V2 1 3

_xy :: Lens' (t a) (V2 a) #

Instances
R2 V2 
Instance details

Defined in Linear.V2

Methods

_y :: Lens' (V2 a) a #

_xy :: Lens' (V2 a) (V2 a) #

R2 V3 
Instance details

Defined in Linear.V3

Methods

_y :: Lens' (V3 a) a #

_xy :: Lens' (V3 a) (V2 a) #

R2 V4 
Instance details

Defined in Linear.V4

Methods

_y :: Lens' (V4 a) a #

_xy :: Lens' (V4 a) (V2 a) #

R2 f => R2 (Point f) 
Instance details

Defined in Linear.Affine

Methods

_y :: Lens' (Point f a) a #

_xy :: Lens' (Point f a) (V2 a) #

data V2 a #

A 2-dimensional vector

>>> pure 1 :: V2 Int
V2 1 1
>>> V2 1 2 + V2 3 4
V2 4 6
>>> V2 1 2 * V2 3 4
V2 3 8
>>> sum (V2 1 2)
3

Constructors

V2 !a !a 
Instances
Monad V2 
Instance details

Defined in Linear.V2

Methods

(>>=) :: V2 a -> (a -> V2 b) -> V2 b #

(>>) :: V2 a -> V2 b -> V2 b #

return :: a -> V2 a #

fail :: String -> V2 a #

Functor V2 
Instance details

Defined in Linear.V2

Methods

fmap :: (a -> b) -> V2 a -> V2 b #

(<$) :: a -> V2 b -> V2 a #

MonadFix V2 
Instance details

Defined in Linear.V2

Methods

mfix :: (a -> V2 a) -> V2 a #

Applicative V2 
Instance details

Defined in Linear.V2

Methods

pure :: a -> V2 a #

(<*>) :: V2 (a -> b) -> V2 a -> V2 b #

liftA2 :: (a -> b -> c) -> V2 a -> V2 b -> V2 c #

(*>) :: V2 a -> V2 b -> V2 b #

(<*) :: V2 a -> V2 b -> V2 a #

Foldable V2 
Instance details

Defined in Linear.V2

Methods

fold :: Monoid m => V2 m -> m #

foldMap :: Monoid m => (a -> m) -> V2 a -> m #

foldr :: (a -> b -> b) -> b -> V2 a -> b #

foldr' :: (a -> b -> b) -> b -> V2 a -> b #

foldl :: (b -> a -> b) -> b -> V2 a -> b #

foldl' :: (b -> a -> b) -> b -> V2 a -> b #

foldr1 :: (a -> a -> a) -> V2 a -> a #

foldl1 :: (a -> a -> a) -> V2 a -> a #

toList :: V2 a -> [a] #

null :: V2 a -> Bool #

length :: V2 a -> Int #

elem :: Eq a => a -> V2 a -> Bool #

maximum :: Ord a => V2 a -> a #

minimum :: Ord a => V2 a -> a #

sum :: Num a => V2 a -> a #

product :: Num a => V2 a -> a #

Traversable V2 
Instance details

Defined in Linear.V2

Methods

traverse :: Applicative f => (a -> f b) -> V2 a -> f (V2 b) #

sequenceA :: Applicative f => V2 (f a) -> f (V2 a) #

mapM :: Monad m => (a -> m b) -> V2 a -> m (V2 b) #

sequence :: Monad m => V2 (m a) -> m (V2 a) #

Apply V2 
Instance details

Defined in Linear.V2

Methods

(<.>) :: V2 (a -> b) -> V2 a -> V2 b #

(.>) :: V2 a -> V2 b -> V2 b #

(<.) :: V2 a -> V2 b -> V2 a #

liftF2 :: (a -> b -> c) -> V2 a -> V2 b -> V2 c #

Distributive V2 
Instance details

Defined in Linear.V2

Methods

distribute :: Functor f => f (V2 a) -> V2 (f a) #

collect :: Functor f => (a -> V2 b) -> f a -> V2 (f b) #

distributeM :: Monad m => m (V2 a) -> V2 (m a) #

collectM :: Monad m => (a -> V2 b) -> m a -> V2 (m b) #

Representable V2 
Instance details

Defined in Linear.V2

Associated Types

type Rep V2 :: Type #

Methods

tabulate :: (Rep V2 -> a) -> V2 a #

index :: V2 a -> Rep V2 -> a #

Eq1 V2 
Instance details

Defined in Linear.V2

Methods

liftEq :: (a -> b -> Bool) -> V2 a -> V2 b -> Bool #

Ord1 V2 
Instance details

Defined in Linear.V2

Methods

liftCompare :: (a -> b -> Ordering) -> V2 a -> V2 b -> Ordering #

Read1 V2 
Instance details

Defined in Linear.V2

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (V2 a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [V2 a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (V2 a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [V2 a] #

Show1 V2 
Instance details

Defined in Linear.V2

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> V2 a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [V2 a] -> ShowS #

MonadZip V2 
Instance details

Defined in Linear.V2

Methods

mzip :: V2 a -> V2 b -> V2 (a, b) #

mzipWith :: (a -> b -> c) -> V2 a -> V2 b -> V2 c #

munzip :: V2 (a, b) -> (V2 a, V2 b) #

Serial1 V2 
Instance details

Defined in Linear.V2

Methods

serializeWith :: MonadPut m => (a -> m ()) -> V2 a -> m () #

deserializeWith :: MonadGet m => m a -> m (V2 a) #

Additive V2 
Instance details

Defined in Linear.V2

Methods

zero :: Num a => V2 a #

(^+^) :: Num a => V2 a -> V2 a -> V2 a #

(^-^) :: Num a => V2 a -> V2 a -> V2 a #

lerp :: Num a => a -> V2 a -> V2 a -> V2 a #

liftU2 :: (a -> a -> a) -> V2 a -> V2 a -> V2 a #

liftI2 :: (a -> b -> c) -> V2 a -> V2 b -> V2 c #

Metric V2 
Instance details

Defined in Linear.V2

Methods

dot :: Num a => V2 a -> V2 a -> a #

quadrance :: Num a => V2 a -> a #

qd :: Num a => V2 a -> V2 a -> a #

distance :: Floating a => V2 a -> V2 a -> a #

norm :: Floating a => V2 a -> a #

signorm :: Floating a => V2 a -> V2 a #

Affine V2 
Instance details

Defined in Linear.Affine

Associated Types

type Diff V2 :: Type -> Type #

Methods

(.-.) :: Num a => V2 a -> V2 a -> Diff V2 a #

(.+^) :: Num a => V2 a -> Diff V2 a -> V2 a #

(.-^) :: Num a => V2 a -> Diff V2 a -> V2 a #

HasR V2 
Instance details

Defined in Diagrams.TwoD.Types

Methods

_r :: RealFloat n => Lens' (V2 n) n #

R1 V2 
Instance details

Defined in Linear.V2

Methods

_x :: Lens' (V2 a) a #

R2 V2 
Instance details

Defined in Linear.V2

Methods

_y :: Lens' (V2 a) a #

_xy :: Lens' (V2 a) (V2 a) #

Traversable1 V2 
Instance details

Defined in Linear.V2

Methods

traverse1 :: Apply f => (a -> f b) -> V2 a -> f (V2 b) #

sequence1 :: Apply f => V2 (f b) -> f (V2 b) #

Hashable1 V2 
Instance details

Defined in Linear.V2

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> V2 a -> Int #

Finite V2 
Instance details

Defined in Linear.V2

Associated Types

type Size V2 :: Nat #

Methods

toV :: V2 a -> V (Size V2) a #

fromV :: V (Size V2) a -> V2 a #

Foldable1 V2 
Instance details

Defined in Linear.V2

Methods

fold1 :: Semigroup m => V2 m -> m #

foldMap1 :: Semigroup m => (a -> m) -> V2 a -> m #

toNonEmpty :: V2 a -> NonEmpty a #

Bind V2 
Instance details

Defined in Linear.V2

Methods

(>>-) :: V2 a -> (a -> V2 b) -> V2 b #

join :: V2 (V2 a) -> V2 a #

SVGFloat n => Backend SVG V2 n 
Instance details

Defined in Diagrams.Backend.SVG

Associated Types

data Render SVG V2 n :: Type #

type Result SVG V2 n :: Type #

data Options SVG V2 n :: Type #

Unbox a => Vector Vector (V2 a) 
Instance details

Defined in Linear.V2

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V2 a) -> m (Vector (V2 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V2 a) -> m (Mutable Vector (PrimState m) (V2 a)) #

basicLength :: Vector (V2 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V2 a) -> Vector (V2 a) #

basicUnsafeIndexM :: Monad m => Vector (V2 a) -> Int -> m (V2 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V2 a) -> Vector (V2 a) -> m () #

elemseq :: Vector (V2 a) -> V2 a -> b -> b #

Unbox a => MVector MVector (V2 a) 
Instance details

Defined in Linear.V2

Methods

basicLength :: MVector s (V2 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V2 a) -> MVector s (V2 a) #

basicOverlaps :: MVector s (V2 a) -> MVector s (V2 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V2 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V2 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V2 a -> m (MVector (PrimState m) (V2 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> m (V2 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> V2 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V2 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V2 a) -> V2 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V2 a) -> MVector (PrimState m) (V2 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V2 a) -> MVector (PrimState m) (V2 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> m (MVector (PrimState m) (V2 a)) #

Bounded a => Bounded (V2 a) 
Instance details

Defined in Linear.V2

Methods

minBound :: V2 a #

maxBound :: V2 a #

Eq a => Eq (V2 a) 
Instance details

Defined in Linear.V2

Methods

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

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

Floating a => Floating (V2 a) 
Instance details

Defined in Linear.V2

Methods

pi :: V2 a #

exp :: V2 a -> V2 a #

log :: V2 a -> V2 a #

sqrt :: V2 a -> V2 a #

(**) :: V2 a -> V2 a -> V2 a #

logBase :: V2 a -> V2 a -> V2 a #

sin :: V2 a -> V2 a #

cos :: V2 a -> V2 a #

tan :: V2 a -> V2 a #

asin :: V2 a -> V2 a #

acos :: V2 a -> V2 a #

atan :: V2 a -> V2 a #

sinh :: V2 a -> V2 a #

cosh :: V2 a -> V2 a #

tanh :: V2 a -> V2 a #

asinh :: V2 a -> V2 a #

acosh :: V2 a -> V2 a #

atanh :: V2 a -> V2 a #

log1p :: V2 a -> V2 a #

expm1 :: V2 a -> V2 a #

log1pexp :: V2 a -> V2 a #

log1mexp :: V2 a -> V2 a #

Fractional a => Fractional (V2 a) 
Instance details

Defined in Linear.V2

Methods

(/) :: V2 a -> V2 a -> V2 a #

recip :: V2 a -> V2 a #

fromRational :: Rational -> V2 a #

Data a => Data (V2 a) 
Instance details

Defined in Linear.V2

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V2 a -> c (V2 a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V2 a) #

toConstr :: V2 a -> Constr #

dataTypeOf :: V2 a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V2 a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V2 a)) #

gmapT :: (forall b. Data b => b -> b) -> V2 a -> V2 a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V2 a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V2 a -> r #

gmapQ :: (forall d. Data d => d -> u) -> V2 a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> V2 a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) #

Num a => Num (V2 a) 
Instance details

Defined in Linear.V2

Methods

(+) :: V2 a -> V2 a -> V2 a #

(-) :: V2 a -> V2 a -> V2 a #

(*) :: V2 a -> V2 a -> V2 a #

negate :: V2 a -> V2 a #

abs :: V2 a -> V2 a #

signum :: V2 a -> V2 a #

fromInteger :: Integer -> V2 a #

Ord a => Ord (V2 a) 
Instance details

Defined in Linear.V2

Methods

compare :: V2 a -> V2 a -> Ordering #

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

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

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

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

max :: V2 a -> V2 a -> V2 a #

min :: V2 a -> V2 a -> V2 a #

Read a => Read (V2 a) 
Instance details

Defined in Linear.V2

Show a => Show (V2 a) 
Instance details

Defined in Linear.V2

Methods

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

show :: V2 a -> String #

showList :: [V2 a] -> ShowS #

Ix a => Ix (V2 a) 
Instance details

Defined in Linear.V2

Methods

range :: (V2 a, V2 a) -> [V2 a] #

index :: (V2 a, V2 a) -> V2 a -> Int #

unsafeIndex :: (V2 a, V2 a) -> V2 a -> Int

inRange :: (V2 a, V2 a) -> V2 a -> Bool #

rangeSize :: (V2 a, V2 a) -> Int #

unsafeRangeSize :: (V2 a, V2 a) -> Int

Generic (V2 a) 
Instance details

Defined in Linear.V2

Associated Types

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

Methods

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

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

Lift a => Lift (V2 a) 
Instance details

Defined in Linear.V2

Methods

lift :: V2 a -> Q Exp #

Hashable a => Hashable (V2 a) 
Instance details

Defined in Linear.V2

Methods

hashWithSalt :: Int -> V2 a -> Int #

hash :: V2 a -> Int #

Storable a => Storable (V2 a) 
Instance details

Defined in Linear.V2

Methods

sizeOf :: V2 a -> Int #

alignment :: V2 a -> Int #

peekElemOff :: Ptr (V2 a) -> Int -> IO (V2 a) #

pokeElemOff :: Ptr (V2 a) -> Int -> V2 a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (V2 a) #

pokeByteOff :: Ptr b -> Int -> V2 a -> IO () #

peek :: Ptr (V2 a) -> IO (V2 a) #

poke :: Ptr (V2 a) -> V2 a -> IO () #

Binary a => Binary (V2 a) 
Instance details

Defined in Linear.V2

Methods

put :: V2 a -> Put #

get :: Get (V2 a) #

putList :: [V2 a] -> Put #

Serial a => Serial (V2 a) 
Instance details

Defined in Linear.V2

Methods

serialize :: MonadPut m => V2 a -> m () #

deserialize :: MonadGet m => m (V2 a) #

Serialize a => Serialize (V2 a) 
Instance details

Defined in Linear.V2

Methods

put :: Putter (V2 a) #

get :: Get (V2 a) #

NFData a => NFData (V2 a) 
Instance details

Defined in Linear.V2

Methods

rnf :: V2 a -> () #

Coordinates (V2 n) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (V2 n) :: Type #

type PrevDim (V2 n) :: Type #

type Decomposition (V2 n) :: Type #

Methods

(^&) :: PrevDim (V2 n) -> FinalCoord (V2 n) -> V2 n #

pr :: PrevDim (V2 n) -> FinalCoord (V2 n) -> V2 n #

coords :: V2 n -> Decomposition (V2 n) #

Ixed (V2 a) 
Instance details

Defined in Linear.V2

Methods

ix :: Index (V2 a) -> Traversal' (V2 a) (IxValue (V2 a)) #

Unbox a => Unbox (V2 a) 
Instance details

Defined in Linear.V2

Epsilon a => Epsilon (V2 a) 
Instance details

Defined in Linear.V2

Methods

nearZero :: V2 a -> Bool #

Generic1 V2 
Instance details

Defined in Linear.V2

Associated Types

type Rep1 V2 :: k -> Type #

Methods

from1 :: V2 a -> Rep1 V2 a #

to1 :: Rep1 V2 a -> V2 a #

TraversableWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

itraverse :: Applicative f => (E V2 -> a -> f b) -> V2 a -> f (V2 b) #

itraversed :: IndexedTraversal (E V2) (V2 a) (V2 b) a b #

FoldableWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

ifoldMap :: Monoid m => (E V2 -> a -> m) -> V2 a -> m #

ifolded :: IndexedFold (E V2) (V2 a) a #

ifoldr :: (E V2 -> a -> b -> b) -> b -> V2 a -> b #

ifoldl :: (E V2 -> b -> a -> b) -> b -> V2 a -> b #

ifoldr' :: (E V2 -> a -> b -> b) -> b -> V2 a -> b #

ifoldl' :: (E V2 -> b -> a -> b) -> b -> V2 a -> b #

FunctorWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

imap :: (E V2 -> a -> b) -> V2 a -> V2 b #

imapped :: IndexedSetter (E V2) (V2 a) (V2 b) a b #

Field2 (V2 a) (V2 a) a a 
Instance details

Defined in Linear.V2

Methods

_2 :: Lens (V2 a) (V2 a) a a #

Field1 (V2 a) (V2 a) a a 
Instance details

Defined in Linear.V2

Methods

_1 :: Lens (V2 a) (V2 a) a a #

Each (V2 a) (V2 b) a b 
Instance details

Defined in Linear.V2

Methods

each :: Traversal (V2 a) (V2 b) a b #

RealFloat n => Traced (BoundingBox V2 n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getTrace :: BoundingBox V2 n -> Trace (V (BoundingBox V2 n)) (N (BoundingBox V2 n)) #

SVGFloat n => Renderable (Path V2 n) SVG 
Instance details

Defined in Diagrams.Backend.SVG

Methods

render :: SVG -> Path V2 n -> Render SVG (V (Path V2 n)) (N (Path V2 n)) #

Semigroup (Render SVG V2 n) 
Instance details

Defined in Diagrams.Backend.SVG

Methods

(<>) :: Render SVG V2 n -> Render SVG V2 n -> Render SVG V2 n #

sconcat :: NonEmpty (Render SVG V2 n) -> Render SVG V2 n #

stimes :: Integral b => b -> Render SVG V2 n -> Render SVG V2 n #

Monoid (Render SVG V2 n) 
Instance details

Defined in Diagrams.Backend.SVG

Methods

mempty :: Render SVG V2 n #

mappend :: Render SVG V2 n -> Render SVG V2 n -> Render SVG V2 n #

mconcat :: [Render SVG V2 n] -> Render SVG V2 n #

Hashable n => Hashable (Options SVG V2 n) 
Instance details

Defined in Diagrams.Backend.SVG

Methods

hashWithSalt :: Int -> Options SVG V2 n -> Int #

hash :: Options SVG V2 n -> Int #

type Rep V2 
Instance details

Defined in Linear.V2

type Rep V2 = E V2
type Diff V2 
Instance details

Defined in Linear.Affine

type Diff V2 = V2
type Size V2 
Instance details

Defined in Linear.V2

type Size V2 = 2
data Options SVG V2 n 
Instance details

Defined in Diagrams.Backend.SVG

newtype Render SVG V2 n 
Instance details

Defined in Diagrams.Backend.SVG

newtype Render SVG V2 n = R (SvgRenderM n)
type Result SVG V2 n 
Instance details

Defined in Diagrams.Backend.SVG

type Result SVG V2 n = Element
data MVector s (V2 a) 
Instance details

Defined in Linear.V2

data MVector s (V2 a) = MV_V2 !Int !(MVector s a)
type Rep (V2 a) 
Instance details

Defined in Linear.V2

type V (V2 n) 
Instance details

Defined in Diagrams.TwoD.Types

type V (V2 n) = V2
type N (V2 n) 
Instance details

Defined in Diagrams.TwoD.Types

type N (V2 n) = n
data Vector (V2 a) 
Instance details

Defined in Linear.V2

data Vector (V2 a) = V_V2 !Int !(Vector a)
type Decomposition (V2 n) 
Instance details

Defined in Diagrams.Coordinates

type Decomposition (V2 n) = n :& n
type PrevDim (V2 n) 
Instance details

Defined in Diagrams.Coordinates

type PrevDim (V2 n) = n
type FinalCoord (V2 n) 
Instance details

Defined in Diagrams.Coordinates

type FinalCoord (V2 n) = n
type IxValue (V2 a) 
Instance details

Defined in Linear.V2

type IxValue (V2 a) = a
type Index (V2 a) 
Instance details

Defined in Linear.V2

type Index (V2 a) = E V2
type Rep1 V2 
Instance details

Defined in Linear.V2

perp :: Num a => V2 a -> V2 a #

the counter-clockwise perpendicular vector

>>> perp $ V2 10 20
V2 (-20) 10

class R2 t => R3 (t :: Type -> Type) where #

A space that distinguishes 3 orthogonal basis vectors: _x, _y, and _z. (It may have more)

Methods

_z :: Lens' (t a) a #

>>> V3 1 2 3 ^. _z
3

_xyz :: Lens' (t a) (V3 a) #

Instances
R3 V3 
Instance details

Defined in Linear.V3

Methods

_z :: Lens' (V3 a) a #

_xyz :: Lens' (V3 a) (V3 a) #

R3 V4 
Instance details

Defined in Linear.V4

Methods

_z :: Lens' (V4 a) a #

_xyz :: Lens' (V4 a) (V3 a) #

R3 f => R3 (Point f) 
Instance details

Defined in Linear.Affine

Methods

_z :: Lens' (Point f a) a #

_xyz :: Lens' (Point f a) (V3 a) #

data V3 a #

A 3-dimensional vector

Constructors

V3 !a !a !a 
Instances
Monad V3 
Instance details

Defined in Linear.V3

Methods

(>>=) :: V3 a -> (a -> V3 b) -> V3 b #

(>>) :: V3 a -> V3 b -> V3 b #

return :: a -> V3 a #

fail :: String -> V3 a #

Functor V3 
Instance details

Defined in Linear.V3

Methods

fmap :: (a -> b) -> V3 a -> V3 b #

(<$) :: a -> V3 b -> V3 a #

MonadFix V3 
Instance details

Defined in Linear.V3

Methods

mfix :: (a -> V3 a) -> V3 a #

Applicative V3 
Instance details

Defined in Linear.V3

Methods

pure :: a -> V3 a #

(<*>) :: V3 (a -> b) -> V3 a -> V3 b #

liftA2 :: (a -> b -> c) -> V3 a -> V3 b -> V3 c #

(*>) :: V3 a -> V3 b -> V3 b #

(<*) :: V3 a -> V3 b -> V3 a #

Foldable V3 
Instance details

Defined in Linear.V3

Methods

fold :: Monoid m => V3 m -> m #

foldMap :: Monoid m => (a -> m) -> V3 a -> m #

foldr :: (a -> b -> b) -> b -> V3 a -> b #

foldr' :: (a -> b -> b) -> b -> V3 a -> b #

foldl :: (b -> a -> b) -> b -> V3 a -> b #

foldl' :: (b -> a -> b) -> b -> V3 a -> b #

foldr1 :: (a -> a -> a) -> V3 a -> a #

foldl1 :: (a -> a -> a) -> V3 a -> a #

toList :: V3 a -> [a] #

null :: V3 a -> Bool #

length :: V3 a -> Int #

elem :: Eq a => a -> V3 a -> Bool #

maximum :: Ord a => V3 a -> a #

minimum :: Ord a => V3 a -> a #

sum :: Num a => V3 a -> a #

product :: Num a => V3 a -> a #

Traversable V3 
Instance details

Defined in Linear.V3

Methods

traverse :: Applicative f => (a -> f b) -> V3 a -> f (V3 b) #

sequenceA :: Applicative f => V3 (f a) -> f (V3 a) #

mapM :: Monad m => (a -> m b) -> V3 a -> m (V3 b) #

sequence :: Monad m => V3 (m a) -> m (V3 a) #

Apply V3 
Instance details

Defined in Linear.V3

Methods

(<.>) :: V3 (a -> b) -> V3 a -> V3 b #

(.>) :: V3 a -> V3 b -> V3 b #

(<.) :: V3 a -> V3 b -> V3 a #

liftF2 :: (a -> b -> c) -> V3 a -> V3 b -> V3 c #

Distributive V3 
Instance details

Defined in Linear.V3

Methods

distribute :: Functor f => f (V3 a) -> V3 (f a) #

collect :: Functor f => (a -> V3 b) -> f a -> V3 (f b) #

distributeM :: Monad m => m (V3 a) -> V3 (m a) #

collectM :: Monad m => (a -> V3 b) -> m a -> V3 (m b) #

Representable V3 
Instance details

Defined in Linear.V3

Associated Types

type Rep V3 :: Type #

Methods

tabulate :: (Rep V3 -> a) -> V3 a #

index :: V3 a -> Rep V3 -> a #

Eq1 V3 
Instance details

Defined in Linear.V3

Methods

liftEq :: (a -> b -> Bool) -> V3 a -> V3 b -> Bool #

Ord1 V3 
Instance details

Defined in Linear.V3

Methods

liftCompare :: (a -> b -> Ordering) -> V3 a -> V3 b -> Ordering #

Read1 V3 
Instance details

Defined in Linear.V3

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (V3 a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [V3 a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (V3 a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [V3 a] #

Show1 V3 
Instance details

Defined in Linear.V3

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> V3 a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [V3 a] -> ShowS #

MonadZip V3 
Instance details

Defined in Linear.V3

Methods

mzip :: V3 a -> V3 b -> V3 (a, b) #

mzipWith :: (a -> b -> c) -> V3 a -> V3 b -> V3 c #

munzip :: V3 (a, b) -> (V3 a, V3 b) #

Serial1 V3 
Instance details

Defined in Linear.V3

Methods

serializeWith :: MonadPut m => (a -> m ()) -> V3 a -> m () #

deserializeWith :: MonadGet m => m a -> m (V3 a) #

Additive V3 
Instance details

Defined in Linear.V3

Methods

zero :: Num a => V3 a #

(^+^) :: Num a => V3 a -> V3 a -> V3 a #

(^-^) :: Num a => V3 a -> V3 a -> V3 a #

lerp :: Num a => a -> V3 a -> V3 a -> V3 a #

liftU2 :: (a -> a -> a) -> V3 a -> V3 a -> V3 a #

liftI2 :: (a -> b -> c) -> V3 a -> V3 b -> V3 c #

Metric V3 
Instance details

Defined in Linear.V3

Methods

dot :: Num a => V3 a -> V3 a -> a #

quadrance :: Num a => V3 a -> a #

qd :: Num a => V3 a -> V3 a -> a #

distance :: Floating a => V3 a -> V3 a -> a #

norm :: Floating a => V3 a -> a #

signorm :: Floating a => V3 a -> V3 a #

Affine V3 
Instance details

Defined in Linear.Affine

Associated Types

type Diff V3 :: Type -> Type #

Methods

(.-.) :: Num a => V3 a -> V3 a -> Diff V3 a #

(.+^) :: Num a => V3 a -> Diff V3 a -> V3 a #

(.-^) :: Num a => V3 a -> Diff V3 a -> V3 a #

R1 V3 
Instance details

Defined in Linear.V3

Methods

_x :: Lens' (V3 a) a #

R2 V3 
Instance details

Defined in Linear.V3

Methods

_y :: Lens' (V3 a) a #

_xy :: Lens' (V3 a) (V2 a) #

R3 V3 
Instance details

Defined in Linear.V3

Methods

_z :: Lens' (V3 a) a #

_xyz :: Lens' (V3 a) (V3 a) #

Traversable1 V3 
Instance details

Defined in Linear.V3

Methods

traverse1 :: Apply f => (a -> f b) -> V3 a -> f (V3 b) #

sequence1 :: Apply f => V3 (f b) -> f (V3 b) #

Hashable1 V3 
Instance details

Defined in Linear.V3

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> V3 a -> Int #

Finite V3 
Instance details

Defined in Linear.V3

Associated Types

type Size V3 :: Nat #

Methods

toV :: V3 a -> V (Size V3) a #

fromV :: V (Size V3) a -> V3 a #

Foldable1 V3 
Instance details

Defined in Linear.V3

Methods

fold1 :: Semigroup m => V3 m -> m #

foldMap1 :: Semigroup m => (a -> m) -> V3 a -> m #

toNonEmpty :: V3 a -> NonEmpty a #

Bind V3 
Instance details

Defined in Linear.V3

Methods

(>>-) :: V3 a -> (a -> V3 b) -> V3 b #

join :: V3 (V3 a) -> V3 a #

Unbox a => Vector Vector (V3 a) 
Instance details

Defined in Linear.V3

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> m (Vector (V3 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (V3 a) -> m (Mutable Vector (PrimState m) (V3 a)) #

basicLength :: Vector (V3 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (V3 a) -> Vector (V3 a) #

basicUnsafeIndexM :: Monad m => Vector (V3 a) -> Int -> m (V3 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V3 a) -> Vector (V3 a) -> m () #

elemseq :: Vector (V3 a) -> V3 a -> b -> b #

Unbox a => MVector MVector (V3 a) 
Instance details

Defined in Linear.V3

Methods

basicLength :: MVector s (V3 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (V3 a) -> MVector s (V3 a) #

basicOverlaps :: MVector s (V3 a) -> MVector s (V3 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V3 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> V3 a -> m (MVector (PrimState m) (V3 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (V3 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> V3 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (V3 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (V3 a) -> V3 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V3 a) -> MVector (PrimState m) (V3 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V3 a) -> Int -> m (MVector (PrimState m) (V3 a)) #

Bounded a => Bounded (V3 a) 
Instance details

Defined in Linear.V3

Methods

minBound :: V3 a #

maxBound :: V3 a #

Eq a => Eq (V3 a) 
Instance details

Defined in Linear.V3

Methods

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

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

Floating a => Floating (V3 a) 
Instance details

Defined in Linear.V3

Methods

pi :: V3 a #

exp :: V3 a -> V3 a #

log :: V3 a -> V3 a #

sqrt :: V3 a -> V3 a #

(**) :: V3 a -> V3 a -> V3 a #

logBase :: V3 a -> V3 a -> V3 a #

sin :: V3 a -> V3 a #

cos :: V3 a -> V3 a #

tan :: V3 a -> V3 a #

asin :: V3 a -> V3 a #

acos :: V3 a -> V3 a #

atan :: V3 a -> V3 a #

sinh :: V3 a -> V3 a #

cosh :: V3 a -> V3 a #

tanh :: V3 a -> V3 a #

asinh :: V3 a -> V3 a #

acosh :: V3 a -> V3 a #

atanh :: V3 a -> V3 a #

log1p :: V3 a -> V3 a #

expm1 :: V3 a -> V3 a #

log1pexp :: V3 a -> V3 a #

log1mexp :: V3 a -> V3 a #

Fractional a => Fractional (V3 a) 
Instance details

Defined in Linear.V3

Methods

(/) :: V3 a -> V3 a -> V3 a #

recip :: V3 a -> V3 a #

fromRational :: Rational -> V3 a #

Data a => Data (V3 a) 
Instance details

Defined in Linear.V3

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V3 a -> c (V3 a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V3 a) #

toConstr :: V3 a -> Constr #

dataTypeOf :: V3 a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V3 a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V3 a)) #

gmapT :: (forall b. Data b => b -> b) -> V3 a -> V3 a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V3 a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V3 a -> r #

gmapQ :: (forall d. Data d => d -> u) -> V3 a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> V3 a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V3 a -> m (V3 a) #

Num a => Num (V3 a) 
Instance details

Defined in Linear.V3

Methods

(+) :: V3 a -> V3 a -> V3 a #

(-) :: V3 a -> V3 a -> V3 a #

(*) :: V3 a -> V3 a -> V3 a #

negate :: V3 a -> V3 a #

abs :: V3 a -> V3 a #

signum :: V3 a -> V3 a #

fromInteger :: Integer -> V3 a #

Ord a => Ord (V3 a) 
Instance details

Defined in Linear.V3

Methods

compare :: V3 a -> V3 a -> Ordering #

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

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

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

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

max :: V3 a -> V3 a -> V3 a #

min :: V3 a -> V3 a -> V3 a #

Read a => Read (V3 a) 
Instance details

Defined in Linear.V3

Show a => Show (V3 a) 
Instance details

Defined in Linear.V3

Methods

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

show :: V3 a -> String #

showList :: [V3 a] -> ShowS #

Ix a => Ix (V3 a) 
Instance details

Defined in Linear.V3

Methods

range :: (V3 a, V3 a) -> [V3 a] #

index :: (V3 a, V3 a) -> V3 a -> Int #

unsafeIndex :: (V3 a, V3 a) -> V3 a -> Int

inRange :: (V3 a, V3 a) -> V3 a -> Bool #

rangeSize :: (V3 a, V3 a) -> Int #

unsafeRangeSize :: (V3 a, V3 a) -> Int

Generic (V3 a) 
Instance details

Defined in Linear.V3

Associated Types

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

Methods

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

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

Lift a => Lift (V3 a) 
Instance details

Defined in Linear.V3

Methods

lift :: V3 a -> Q Exp #

Hashable a => Hashable (V3 a) 
Instance details

Defined in Linear.V3

Methods

hashWithSalt :: Int -> V3 a -> Int #

hash :: V3 a -> Int #

Storable a => Storable (V3 a) 
Instance details

Defined in Linear.V3

Methods

sizeOf :: V3 a -> Int #

alignment :: V3 a -> Int #

peekElemOff :: Ptr (V3 a) -> Int -> IO (V3 a) #

pokeElemOff :: Ptr (V3 a) -> Int -> V3 a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (V3 a) #

pokeByteOff :: Ptr b -> Int -> V3 a -> IO () #

peek :: Ptr (V3 a) -> IO (V3 a) #

poke :: Ptr (V3 a) -> V3 a -> IO () #

Binary a => Binary (V3 a) 
Instance details

Defined in Linear.V3

Methods

put :: V3 a -> Put #

get :: Get (V3 a) #

putList :: [V3 a] -> Put #

Serial a => Serial (V3 a) 
Instance details

Defined in Linear.V3

Methods

serialize :: MonadPut m => V3 a -> m () #

deserialize :: MonadGet m => m (V3 a) #

Serialize a => Serialize (V3 a) 
Instance details

Defined in Linear.V3

Methods

put :: Putter (V3 a) #

get :: Get (V3 a) #

NFData a => NFData (V3 a) 
Instance details

Defined in Linear.V3

Methods

rnf :: V3 a -> () #

Coordinates (V3 n) 
Instance details

Defined in Diagrams.Coordinates

Associated Types

type FinalCoord (V3 n) :: Type #

type PrevDim (V3 n) :: Type #

type Decomposition (V3 n) :: Type #

Methods

(^&) :: PrevDim (V3 n) -> FinalCoord (V3 n) -> V3 n #

pr :: PrevDim (V3 n) -> FinalCoord (V3 n) -> V3 n #

coords :: V3 n -> Decomposition (V3 n) #

Ixed (V3 a) 
Instance details

Defined in Linear.V3

Methods

ix :: Index (V3 a) -> Traversal' (V3 a) (IxValue (V3 a)) #

Unbox a => Unbox (V3 a) 
Instance details

Defined in Linear.V3

Epsilon a => Epsilon (V3 a) 
Instance details

Defined in Linear.V3

Methods

nearZero :: V3 a -> Bool #

Generic1 V3 
Instance details

Defined in Linear.V3

Associated Types

type Rep1 V3 :: k -> Type #

Methods

from1 :: V3 a -> Rep1 V3 a #

to1 :: Rep1 V3 a -> V3 a #

TraversableWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

itraverse :: Applicative f => (E V3 -> a -> f b) -> V3 a -> f (V3 b) #

itraversed :: IndexedTraversal (E V3) (V3 a) (V3 b) a b #

FoldableWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

ifoldMap :: Monoid m => (E V3 -> a -> m) -> V3 a -> m #

ifolded :: IndexedFold (E V3) (V3 a) a #

ifoldr :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #

ifoldl :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #

ifoldr' :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #

ifoldl' :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #

FunctorWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

imap :: (E V3 -> a -> b) -> V3 a -> V3 b #

imapped :: IndexedSetter (E V3) (V3 a) (V3 b) a b #

Field3 (V3 a) (V3 a) a a 
Instance details

Defined in Linear.V3

Methods

_3 :: Lens (V3 a) (V3 a) a a #

Field2 (V3 a) (V3 a) a a 
Instance details

Defined in Linear.V3

Methods

_2 :: Lens (V3 a) (V3 a) a a #

Field1 (V3 a) (V3 a) a a 
Instance details

Defined in Linear.V3

Methods

_1 :: Lens (V3 a) (V3 a) a a #

Each (V3 a) (V3 b) a b 
Instance details

Defined in Linear.V3

Methods

each :: Traversal (V3 a) (V3 b) a b #

TypeableFloat n => Traced (BoundingBox V3 n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

getTrace :: BoundingBox V3 n -> Trace (V (BoundingBox V3 n)) (N (BoundingBox V3 n)) #

type Rep V3 
Instance details

Defined in Linear.V3

type Rep V3 = E V3
type Diff V3 
Instance details

Defined in Linear.Affine

type Diff V3 = V3
type Size V3 
Instance details

Defined in Linear.V3

type Size V3 = 3
data MVector s (V3 a) 
Instance details

Defined in Linear.V3

data MVector s (V3 a) = MV_V3 !Int !(MVector s a)
type Rep (V3 a) 
Instance details

Defined in Linear.V3

type V (V3 n) 
Instance details

Defined in Diagrams.ThreeD.Types

type V (V3 n) = V3
type N (V3 n) 
Instance details

Defined in Diagrams.ThreeD.Types

type N (V3 n) = n
data Vector (V3 a) 
Instance details

Defined in Linear.V3

data Vector (V3 a) = V_V3 !Int !(Vector a)
type Decomposition (V3 n) 
Instance details

Defined in Diagrams.Coordinates

type Decomposition (V3 n) = (n :& n) :& n
type PrevDim (V3 n) 
Instance details

Defined in Diagrams.Coordinates

type PrevDim (V3 n) = V2 n
type FinalCoord (V3 n) 
Instance details

Defined in Diagrams.Coordinates

type FinalCoord (V3 n) = n
type IxValue (V3 a) 
Instance details

Defined in Linear.V3

type IxValue (V3 a) = a
type Index (V3 a) 
Instance details

Defined in Linear.V3

type Index (V3 a) = E V3
type Rep1 V3 
Instance details

Defined in Linear.V3

lensP :: Lens' (Point g a) (g a) #

class Profunctor p => Choice (p :: Type -> Type -> Type) where #

The generalization of Costar of Functor that is strong with respect to Either.

Note: This is also a notion of strength, except with regards to another monoidal structure that we can choose to equip Hask with: the cocartesian coproduct.

Minimal complete definition

left' | right'

Methods

left' :: p a b -> p (Either a c) (Either b c) #

Laws:

left'dimap swapE swapE . right' where
  swapE :: Either a b -> Either b a
  swapE = either Right Left
rmap Leftlmap Left . left'
lmap (right f) . left'rmap (right f) . left'
left' . left'dimap assocE unassocE . left' where
  assocE :: Either (Either a b) c -> Either a (Either b c)
  assocE (Left (Left a)) = Left a
  assocE (Left (Right b)) = Right (Left b)
  assocE (Right c) = Right (Right c)
  unassocE :: Either a (Either b c) -> Either (Either a b) c
  unassocE (Left a) = Left (Left a)
  unassocE (Right (Left b) = Left (Right b)
  unassocE (Right (Right c)) = Right c)

right' :: p a b -> p (Either c a) (Either c b) #

Laws:

right'dimap swapE swapE . left' where
  swapE :: Either a b -> Either b a
  swapE = either Right Left
rmap Rightlmap Right . right'
lmap (left f) . right'rmap (left f) . right'
right' . right'dimap unassocE assocE . right' where
  assocE :: Either (Either a b) c -> Either a (Either b c)
  assocE (Left (Left a)) = Left a
  assocE (Left (Right b)) = Right (Left b)
  assocE (Right c) = Right (Right c)
  unassocE :: Either a (Either b c) -> Either (Either a b) c
  unassocE (Left a) = Left (Left a)
  unassocE (Right (Left b) = Left (Right b)
  unassocE (Right (Right c)) = Right c)
Instances
Choice ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

left' :: ReifiedFold a b -> ReifiedFold (Either a c) (Either b c) #

right' :: ReifiedFold a b -> ReifiedFold (Either c a) (Either c b) #

Choice ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

left' :: ReifiedGetter a b -> ReifiedGetter (Either a c) (Either b c) #

right' :: ReifiedGetter a b -> ReifiedGetter (Either c a) (Either c b) #

Monad m => Choice (Kleisli m) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Kleisli m a b -> Kleisli m (Either a c) (Either b c) #

right' :: Kleisli m a b -> Kleisli m (Either c a) (Either c b) #

Choice (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

left' :: Indexed i a b -> Indexed i (Either a c) (Either b c) #

right' :: Indexed i a b -> Indexed i (Either c a) (Either c b) #

Profunctor p => Choice (TambaraSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: TambaraSum p a b -> TambaraSum p (Either a c) (Either b c) #

right' :: TambaraSum p a b -> TambaraSum p (Either c a) (Either c b) #

Choice (PastroSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: PastroSum p a b -> PastroSum p (Either a c) (Either b c) #

right' :: PastroSum p a b -> PastroSum p (Either c a) (Either c b) #

Choice p => Choice (Tambara p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Tambara p a b -> Tambara p (Either a c) (Either b c) #

right' :: Tambara p a b -> Tambara p (Either c a) (Either c b) #

Applicative f => Choice (Star f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Star f a b -> Star f (Either a c) (Either b c) #

right' :: Star f a b -> Star f (Either c a) (Either c b) #

Traversable w => Choice (Costar w) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Costar w a b -> Costar w (Either a c) (Either b c) #

right' :: Costar w a b -> Costar w (Either c a) (Either c b) #

ArrowChoice p => Choice (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: WrappedArrow p a b -> WrappedArrow p (Either a c) (Either b c) #

right' :: WrappedArrow p a b -> WrappedArrow p (Either c a) (Either c b) #

Monoid r => Choice (Forget r) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Forget r a b -> Forget r (Either a c) (Either b c) #

right' :: Forget r a b -> Forget r (Either c a) (Either c b) #

Choice (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Tagged a b -> Tagged (Either a c) (Either b c) #

right' :: Tagged a b -> Tagged (Either c a) (Either c b) #

Choice ((->) :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: (a -> b) -> Either a c -> Either b c #

right' :: (a -> b) -> Either c a -> Either c b #

Comonad w => Choice (Cokleisli w)

extract approximates costrength

Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Cokleisli w a b -> Cokleisli w (Either a c) (Either b c) #

right' :: Cokleisli w a b -> Cokleisli w (Either c a) (Either c b) #

(Choice p, Choice q) => Choice (Procompose p q) 
Instance details

Defined in Data.Profunctor.Composition

Methods

left' :: Procompose p q a b -> Procompose p q (Either a c) (Either b c) #

right' :: Procompose p q a b -> Procompose p q (Either c a) (Either c b) #

Functor f => Choice (Joker f :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Joker f a b -> Joker f (Either a c) (Either b c) #

right' :: Joker f a b -> Joker f (Either c a) (Either c b) #

(Choice p, Choice q) => Choice (Product p q) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Product p q a b -> Product p q (Either a c) (Either b c) #

right' :: Product p q a b -> Product p q (Either c a) (Either c b) #

(Functor f, Choice p) => Choice (Tannen f p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

left' :: Tannen f p a b -> Tannen f p (Either a c) (Either b c) #

right' :: Tannen f p a b -> Tannen f p (Either c a) (Either c b) #

sequenceBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> t (f a) -> f (t a) #

Sequence a container using its Traversable instance using explicitly provided Applicative operations. This is like sequence where the Applicative instance can be manually specified.

traverseBy :: Traversable t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> t a -> f (t b) #

Traverse a container using its Traversable instance using explicitly provided Applicative operations. This is like traverse where the Applicative instance can be manually specified.

foldMapBy :: Foldable t => (r -> r -> r) -> r -> (a -> r) -> t a -> r #

Fold a value using its Foldable instance using explicitly provided Monoid operations. This is like foldMap where the Monoid instance can be manually specified.

foldMapBy mappend memptyfoldMap
>>> foldMapBy (+) 0 length ["hello","world"]
10

foldBy :: Foldable t => (a -> a -> a) -> a -> t a -> a #

Fold a value using its Foldable instance using explicitly provided Monoid operations. This is like fold where the Monoid instance can be manually specified.

foldBy mappend memptyfold
>>> foldBy (++) [] ["hello","world"]
"helloworld"

class (Foldable1 t, Traversable t) => Traversable1 (t :: Type -> Type) where #

Minimal complete definition

traverse1 | sequence1

Methods

traverse1 :: Apply f => (a -> f b) -> t a -> f (t b) #

Instances
Traversable1 Par1 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Par1 a -> f (Par1 b) #

sequence1 :: Apply f => Par1 (f b) -> f (Par1 b) #

Traversable1 Identity 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Identity a -> f (Identity b) #

sequence1 :: Apply f => Identity (f b) -> f (Identity b) #

Traversable1 Complex 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Complex a -> f (Complex b) #

sequence1 :: Apply f => Complex (f b) -> f (Complex b) #

Traversable1 Min 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Min a -> f (Min b) #

sequence1 :: Apply f => Min (f b) -> f (Min b) #

Traversable1 Max 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Max a -> f (Max b) #

sequence1 :: Apply f => Max (f b) -> f (Max b) #

Traversable1 First 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> First a -> f (First b) #

sequence1 :: Apply f => First (f b) -> f (First b) #

Traversable1 Last 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Last a -> f (Last b) #

sequence1 :: Apply f => Last (f b) -> f (Last b) #

Traversable1 Dual 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Dual a -> f (Dual b) #

sequence1 :: Apply f => Dual (f b) -> f (Dual b) #

Traversable1 Sum 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Sum a -> f (Sum b) #

sequence1 :: Apply f => Sum (f b) -> f (Sum b) #

Traversable1 Product 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Product a -> f (Product b) #

sequence1 :: Apply f => Product (f b) -> f (Product b) #

Traversable1 NonEmpty 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #

sequence1 :: Apply f => NonEmpty (f b) -> f (NonEmpty b) #

Traversable1 Tree 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Tree a -> f (Tree b) #

sequence1 :: Apply f => Tree (f b) -> f (Tree b) #

Traversable1 V2 
Instance details

Defined in Linear.V2

Methods

traverse1 :: Apply f => (a -> f b) -> V2 a -> f (V2 b) #

sequence1 :: Apply f => V2 (f b) -> f (V2 b) #

Traversable1 V3 
Instance details

Defined in Linear.V3

Methods

traverse1 :: Apply f => (a -> f b) -> V3 a -> f (V3 b) #

sequence1 :: Apply f => V3 (f b) -> f (V3 b) #

Traversable1 Plucker 
Instance details

Defined in Linear.Plucker

Methods

traverse1 :: Apply f => (a -> f b) -> Plucker a -> f (Plucker b) #

sequence1 :: Apply f => Plucker (f b) -> f (Plucker b) #

Traversable1 V4 
Instance details

Defined in Linear.V4

Methods

traverse1 :: Apply f => (a -> f b) -> V4 a -> f (V4 b) #

sequence1 :: Apply f => V4 (f b) -> f (V4 b) #

Traversable1 V1 
Instance details

Defined in Linear.V1

Methods

traverse1 :: Apply f => (a -> f b) -> V1 a -> f (V1 b) #

sequence1 :: Apply f => V1 (f b) -> f (V1 b) #

Traversable1 (V1 :: Type -> Type) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> V1 a -> f (V1 b) #

sequence1 :: Apply f => V1 (f b) -> f (V1 b) #

Traversable1 ((,) a) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a0 -> f b) -> (a, a0) -> f (a, b) #

sequence1 :: Apply f => (a, f b) -> f (a, b) #

Traversable1 f => Traversable1 (Cofree f) 
Instance details

Defined in Control.Comonad.Cofree

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Cofree f a -> f0 (Cofree f b) #

sequence1 :: Apply f0 => Cofree f (f0 b) -> f0 (Cofree f b) #

Traversable1 f => Traversable1 (Free f) 
Instance details

Defined in Control.Monad.Free

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Free f a -> f0 (Free f b) #

sequence1 :: Apply f0 => Free f (f0 b) -> f0 (Free f b) #

Traversable1 f => Traversable1 (Yoneda f) 
Instance details

Defined in Data.Functor.Yoneda

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Yoneda f a -> f0 (Yoneda f b) #

sequence1 :: Apply f0 => Yoneda f (f0 b) -> f0 (Yoneda f b) #

Traversable1 f => Traversable1 (Lift f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Lift f a -> f0 (Lift f b) #

sequence1 :: Apply f0 => Lift f (f0 b) -> f0 (Lift f b) #

Traversable1 f => Traversable1 (Rec1 f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) #

sequence1 :: Apply f0 => Rec1 f (f0 b) -> f0 (Rec1 f b) #

Traversable1 f => Traversable1 (IdentityT f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> IdentityT f a -> f0 (IdentityT f b) #

sequence1 :: Apply f0 => IdentityT f (f0 b) -> f0 (IdentityT f b) #

Traversable1 f => Traversable1 (Alt f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Alt f a -> f0 (Alt f b) #

sequence1 :: Apply f0 => Alt f (f0 b) -> f0 (Alt f b) #

Bitraversable1 p => Traversable1 (Join p) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> Join p a -> f (Join p b) #

sequence1 :: Apply f => Join p (f b) -> f (Join p b) #

Traversable1 f => Traversable1 (Backwards f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Backwards f a -> f0 (Backwards f b) #

sequence1 :: Apply f0 => Backwards f (f0 b) -> f0 (Backwards f b) #

Traversable1 f => Traversable1 (AlongsideLeft f b) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

traverse1 :: Apply f0 => (a -> f0 b0) -> AlongsideLeft f b a -> f0 (AlongsideLeft f b b0) #

sequence1 :: Apply f0 => AlongsideLeft f b (f0 b0) -> f0 (AlongsideLeft f b b0) #

Traversable1 f => Traversable1 (AlongsideRight f a) 
Instance details

Defined in Control.Lens.Internal.Getter

Methods

traverse1 :: Apply f0 => (a0 -> f0 b) -> AlongsideRight f a a0 -> f0 (AlongsideRight f a b) #

sequence1 :: Apply f0 => AlongsideRight f a (f0 b) -> f0 (AlongsideRight f a b) #

Traversable1 (Tagged a) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a0 -> f b) -> Tagged a a0 -> f (Tagged a b) #

sequence1 :: Apply f => Tagged a (f b) -> f (Tagged a b) #

Traversable1 f => Traversable1 (Reverse f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Reverse f a -> f0 (Reverse f b) #

sequence1 :: Apply f0 => Reverse f (f0 b) -> f0 (Reverse f b) #

(Traversable1 f, Traversable1 g) => Traversable1 (f :+: g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #

sequence1 :: Apply f0 => (f :+: g) (f0 b) -> f0 ((f :+: g) b) #

(Traversable1 f, Traversable1 g) => Traversable1 (f :*: g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

sequence1 :: Apply f0 => (f :*: g) (f0 b) -> f0 ((f :*: g) b) #

(Traversable1 f, Traversable1 g) => Traversable1 (Product f g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) #

sequence1 :: Apply f0 => Product f g (f0 b) -> f0 (Product f g b) #

(Traversable1 f, Traversable1 g) => Traversable1 (Sum f g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Sum f g a -> f0 (Sum f g b) #

sequence1 :: Apply f0 => Sum f g (f0 b) -> f0 (Sum f g b) #

Traversable1 f => Traversable1 (M1 i c f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) #

sequence1 :: Apply f0 => M1 i c f (f0 b) -> f0 (M1 i c f b) #

(Traversable1 f, Traversable1 g) => Traversable1 (f :.: g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) #

sequence1 :: Apply f0 => (f :.: g) (f0 b) -> f0 ((f :.: g) b) #

(Traversable1 f, Traversable1 g) => Traversable1 (Compose f g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) #

sequence1 :: Apply f0 => Compose f g (f0 b) -> f0 (Compose f g b) #

Traversable1 g => Traversable1 (Joker g a) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a0 -> f b) -> Joker g a a0 -> f (Joker g a b) #

sequence1 :: Apply f => Joker g a (f b) -> f (Joker g a b) #

data Rightmost a #

Used for lastOf.

Instances
Semigroup (Rightmost a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Rightmost a -> Rightmost a -> Rightmost a #

sconcat :: NonEmpty (Rightmost a) -> Rightmost a #

stimes :: Integral b => b -> Rightmost a -> Rightmost a #

Monoid (Rightmost a) 
Instance details

Defined in Control.Lens.Internal.Fold

data Leftmost a #

Used for firstOf.

Instances
Semigroup (Leftmost a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Leftmost a -> Leftmost a -> Leftmost a #

sconcat :: NonEmpty (Leftmost a) -> Leftmost a #

stimes :: Integral b => b -> Leftmost a -> Leftmost a #

Monoid (Leftmost a) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

mempty :: Leftmost a #

mappend :: Leftmost a -> Leftmost a -> Leftmost a #

mconcat :: [Leftmost a] -> Leftmost a #

data Sequenced a (m :: Type -> Type) #

Used internally by mapM_ and the like.

The argument a of the result should not be used!

See 4.16 Changelog entry for the explanation of "why not Apply f =>"?

Instances
Monad m => Semigroup (Sequenced a m) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Sequenced a m -> Sequenced a m -> Sequenced a m #

sconcat :: NonEmpty (Sequenced a m) -> Sequenced a m #

stimes :: Integral b => b -> Sequenced a m -> Sequenced a m #

Monad m => Monoid (Sequenced a m) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

mempty :: Sequenced a m #

mappend :: Sequenced a m -> Sequenced a m -> Sequenced a m #

mconcat :: [Sequenced a m] -> Sequenced a m #

data Traversed a (f :: Type -> Type) #

Used internally by traverseOf_ and the like.

The argument a of the result should not be used!

Instances
Applicative f => Semigroup (Traversed a f) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

(<>) :: Traversed a f -> Traversed a f -> Traversed a f #

sconcat :: NonEmpty (Traversed a f) -> Traversed a f #

stimes :: Integral b => b -> Traversed a f -> Traversed a f #

Applicative f => Monoid (Traversed a f) 
Instance details

Defined in Control.Lens.Internal.Fold

Methods

mempty :: Traversed a f #

mappend :: Traversed a f -> Traversed a f -> Traversed a f #

mconcat :: [Traversed a f] -> Traversed a f #

newtype Indexed i a b #

A function with access to a index. This constructor may be useful when you need to store an Indexable in a container to avoid ImpredicativeTypes.

index :: Indexed i a b -> i -> a -> b

Constructors

Indexed 

Fields

Instances
i ~ j => Indexable i (Indexed j) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

indexed :: Indexed j a b -> i -> a -> b #

Arrow (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

arr :: (b -> c) -> Indexed i b c #

first :: Indexed i b c -> Indexed i (b, d) (c, d) #

second :: Indexed i b c -> Indexed i (d, b) (d, c) #

(***) :: Indexed i b c -> Indexed i b' c' -> Indexed i (b, b') (c, c') #

(&&&) :: Indexed i b c -> Indexed i b c' -> Indexed i b (c, c') #

ArrowChoice (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

left :: Indexed i b c -> Indexed i (Either b d) (Either c d) #

right :: Indexed i b c -> Indexed i (Either d b) (Either d c) #

(+++) :: Indexed i b c -> Indexed i b' c' -> Indexed i (Either b b') (Either c c') #

(|||) :: Indexed i b d -> Indexed i c d -> Indexed i (Either b c) d #

ArrowApply (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

app :: Indexed i (Indexed i b c, b) c #

ArrowLoop (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

loop :: Indexed i (b, d) (c, d) -> Indexed i b c #

Choice (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

left' :: Indexed i a b -> Indexed i (Either a c) (Either b c) #

right' :: Indexed i a b -> Indexed i (Either c a) (Either c b) #

Conjoined (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

distrib :: Functor f => Indexed i a b -> Indexed i (f a) (f b) #

conjoined :: ((Indexed i ~ (->)) -> q (a -> b) r) -> q (Indexed i a b) r -> q (Indexed i a b) r #

Profunctor (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

dimap :: (a -> b) -> (c -> d) -> Indexed i b c -> Indexed i a d #

lmap :: (a -> b) -> Indexed i b c -> Indexed i a c #

rmap :: (b -> c) -> Indexed i a b -> Indexed i a c #

(#.) :: Coercible c b => q b c -> Indexed i a b -> Indexed i a c #

(.#) :: Coercible b a => Indexed i b c -> q a b -> Indexed i a c #

Representable (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Associated Types

type Rep (Indexed i) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Indexed i) c) -> Indexed i d c #

Corepresentable (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Associated Types

type Corep (Indexed i) :: Type -> Type #

Methods

cotabulate :: (Corep (Indexed i) d -> c) -> Indexed i d c #

Closed (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

closed :: Indexed i a b -> Indexed i (x -> a) (x -> b) #

Strong (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

first' :: Indexed i a b -> Indexed i (a, c) (b, c) #

second' :: Indexed i a b -> Indexed i (c, a) (c, b) #

Costrong (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

unfirst :: Indexed i (a, d) (b, d) -> Indexed i a b #

unsecond :: Indexed i (d, a) (d, b) -> Indexed i a b #

Bizarre (Indexed Int) Mafic 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

bazaar :: Applicative f => Indexed Int a (f b) -> Mafic a b t -> f t #

Category (Indexed i :: Type -> Type -> Type) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

id :: Indexed i a a #

(.) :: Indexed i b c -> Indexed i a b -> Indexed i a c #

Bizarre (Indexed i) (Molten i) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

bazaar :: Applicative f => Indexed i a (f b) -> Molten i a b t -> f t #

Sellable (Indexed i) (Molten i) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

sell :: Indexed i a (Molten i a b b) #

Cosieve (Indexed i) ((,) i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

cosieve :: Indexed i a b -> (i, a) -> b #

Sieve (Indexed i) ((->) i :: Type -> Type) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

sieve :: Indexed i a b -> a -> i -> b #

Monad (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

(>>=) :: Indexed i a a0 -> (a0 -> Indexed i a b) -> Indexed i a b #

(>>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b #

return :: a0 -> Indexed i a a0 #

fail :: String -> Indexed i a a0 #

Functor (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

fmap :: (a0 -> b) -> Indexed i a a0 -> Indexed i a b #

(<$) :: a0 -> Indexed i a b -> Indexed i a a0 #

MonadFix (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

mfix :: (a0 -> Indexed i a a0) -> Indexed i a a0 #

Applicative (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: a0 -> Indexed i a a0 #

(<*>) :: Indexed i a (a0 -> b) -> Indexed i a a0 -> Indexed i a b #

liftA2 :: (a0 -> b -> c) -> Indexed i a a0 -> Indexed i a b -> Indexed i a c #

(*>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b #

(<*) :: Indexed i a a0 -> Indexed i a b -> Indexed i a a0 #

Apply (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

(<.>) :: Indexed i a (a0 -> b) -> Indexed i a a0 -> Indexed i a b #

(.>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b #

(<.) :: Indexed i a a0 -> Indexed i a b -> Indexed i a a0 #

liftF2 :: (a0 -> b -> c) -> Indexed i a a0 -> Indexed i a b -> Indexed i a c #

Bind (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

(>>-) :: Indexed i a a0 -> (a0 -> Indexed i a b) -> Indexed i a b #

join :: Indexed i a (Indexed i a a0) -> Indexed i a a0 #

type Rep (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

type Rep (Indexed i) = ((->) i :: Type -> Type)
type Corep (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

type Corep (Indexed i) = (,) i

class Conjoined p => Indexable i (p :: Type -> Type -> Type) #

This class permits overloading of function application for things that also admit a notion of a key or index.

Minimal complete definition

indexed

Instances
i ~ j => Indexable i (Indexed j) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

indexed :: Indexed j a b -> i -> a -> b #

Indexable i ((->) :: Type -> Type -> Type) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

indexed :: (a -> b) -> i -> a -> b #

class (Choice p, Corepresentable p, Comonad (Corep p), Traversable (Corep p), Strong p, Representable p, Monad (Rep p), MonadFix (Rep p), Distributive (Rep p), Costrong p, ArrowLoop p, ArrowApply p, ArrowChoice p, Closed p) => Conjoined (p :: Type -> Type -> Type) where #

This is a Profunctor that is both Corepresentable by f and Representable by g such that f is left adjoint to g. From this you can derive a lot of structure due to the preservation of limits and colimits.

Minimal complete definition

Nothing

Methods

distrib :: Functor f => p a b -> p (f a) (f b) #

Conjoined is strong enough to let us distribute every Conjoined Profunctor over every Haskell Functor. This is effectively a generalization of fmap.

conjoined :: ((p ~ ((->) :: Type -> Type -> Type)) -> q (a -> b) r) -> q (p a b) r -> q (p a b) r #

This permits us to make a decision at an outermost point about whether or not we use an index.

Ideally any use of this function should be done in such a way so that you compute the same answer, but this cannot be enforced at the type level.

Instances
Conjoined ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) #

conjoined :: ((ReifiedGetter ~ (->)) -> q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r #

Conjoined (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

distrib :: Functor f => Indexed i a b -> Indexed i (f a) (f b) #

conjoined :: ((Indexed i ~ (->)) -> q (a -> b) r) -> q (Indexed i a b) r -> q (Indexed i a b) r #

Conjoined ((->) :: Type -> Type -> Type) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

distrib :: Functor f => (a -> b) -> f a -> f b #

conjoined :: (((->) ~ (->)) -> q (a -> b) r) -> q (a -> b) r -> q (a -> b) r #

indexing :: Indexable Int p => ((a -> Indexing f b) -> s -> Indexing f t) -> p a (f b) -> s -> f t #

Transform a Traversal into an IndexedTraversal or a Fold into an IndexedFold, etc.

indexing :: Traversal s t a b -> IndexedTraversal Int s t a b
indexing :: Prism s t a b     -> IndexedTraversal Int s t a b
indexing :: Lens s t a b      -> IndexedLens Int  s t a b
indexing :: Iso s t a b       -> IndexedLens Int s t a b
indexing :: Fold s a          -> IndexedFold Int s a
indexing :: Getter s a        -> IndexedGetter Int s a
indexing :: Indexable Int p => LensLike (Indexing f) s t a b -> Over p f s t a b

indexing64 :: Indexable Int64 p => ((a -> Indexing64 f b) -> s -> Indexing64 f t) -> p a (f b) -> s -> f t #

Transform a Traversal into an IndexedTraversal or a Fold into an IndexedFold, etc.

This combinator is like indexing except that it handles large traversals and folds gracefully.

indexing64 :: Traversal s t a b -> IndexedTraversal Int64 s t a b
indexing64 :: Prism s t a b     -> IndexedTraversal Int64 s t a b
indexing64 :: Lens s t a b      -> IndexedLens Int64 s t a b
indexing64 :: Iso s t a b       -> IndexedLens Int64 s t a b
indexing64 :: Fold s a          -> IndexedFold Int64 s a
indexing64 :: Getter s a        -> IndexedGetter Int64 s a
indexing64 :: Indexable Int64 p => LensLike (Indexing64 f) s t a b -> Over p f s t a b

withIndex :: (Indexable i p, Functor f) => p (i, s) (f (j, t)) -> Indexed i s (f t) #

Fold a container with indices returning both the indices and the values.

The result is only valid to compose in a Traversal, if you don't edit the index as edits to the index have no effect.

>>> [10, 20, 30] ^.. ifolded . withIndex
[(0,10),(1,20),(2,30)]
>>> [10, 20, 30] ^.. ifolded . withIndex . alongside negated (re _Show)
[(0,"10"),(-1,"20"),(-2,"30")]

asIndex :: (Indexable i p, Contravariant f, Functor f) => p i (f i) -> Indexed i s (f s) #

When composed with an IndexedFold or IndexedTraversal this yields an (Indexed) Fold of the indices.

type Context' a = Context a a #

type Context' a s = Context a a s

data Context a b t #

The indexed store can be used to characterize a Lens and is used by cloneLens.

Context a b t is isomorphic to newtype Context a b t = Context { runContext :: forall f. Functor f => (a -> f b) -> f t }, and to exists s. (s, Lens s t a b).

A Context is like a Lens that has already been applied to a some structure.

Constructors

Context (b -> t) a 
Instances
IndexedFunctor Context 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ifmap :: (s -> t) -> Context a b s -> Context a b t #

IndexedComonad Context 
Instance details

Defined in Control.Lens.Internal.Context

Methods

iextract :: Context a a t -> t #

iduplicate :: Context a c t -> Context a b (Context b c t) #

iextend :: (Context b c t -> r) -> Context a c t -> Context a b r #

IndexedComonadStore Context 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ipos :: Context a c t -> a #

ipeek :: c -> Context a c t -> t #

ipeeks :: (a -> c) -> Context a c t -> t #

iseek :: b -> Context a c t -> Context b c t #

iseeks :: (a -> b) -> Context a c t -> Context b c t #

iexperiment :: Functor f => (b -> f c) -> Context b c t -> f t #

context :: Context a b t -> Context a b t #

a ~ b => ComonadStore a (Context a b) 
Instance details

Defined in Control.Lens.Internal.Context

Methods

pos :: Context a b a0 -> a #

peek :: a -> Context a b a0 -> a0 #

peeks :: (a -> a) -> Context a b a0 -> a0 #

seek :: a -> Context a b a0 -> Context a b a0 #

seeks :: (a -> a) -> Context a b a0 -> Context a b a0 #

experiment :: Functor f => (a -> f a) -> Context a b a0 -> f a0 #

Functor (Context a b) 
Instance details

Defined in Control.Lens.Internal.Context

Methods

fmap :: (a0 -> b0) -> Context a b a0 -> Context a b b0 #

(<$) :: a0 -> Context a b b0 -> Context a b a0 #

a ~ b => Comonad (Context a b) 
Instance details

Defined in Control.Lens.Internal.Context

Methods

extract :: Context a b a0 -> a0 #

duplicate :: Context a b a0 -> Context a b (Context a b a0) #

extend :: (Context a b a0 -> b0) -> Context a b a0 -> Context a b b0 #

Sellable ((->) :: Type -> Type -> Type) Context 
Instance details

Defined in Control.Lens.Internal.Context

Methods

sell :: a -> Context a b b #

type Bazaar1' (p :: Type -> Type -> Type) a = Bazaar1 p a a #

This alias is helpful when it comes to reducing repetition in type signatures.

type Bazaar1' p a t = Bazaar1 p a a t

newtype Bazaar1 (p :: Type -> Type -> Type) a b t #

This is used to characterize a Traversal.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList.

http://twanvl.nl/blog/haskell/non-regular1

A Bazaar1 is like a Traversal that has already been applied to some structure.

Where a Context a b t holds an a and a function from b to t, a Bazaar1 a b t holds N as and a function from N bs to t, (where N might be infinite).

Mnemonically, a Bazaar1 holds many stores and you can easily add more.

This is a final encoding of Bazaar1.

Constructors

Bazaar1 

Fields

Instances
Profunctor p => Bizarre1 p (Bazaar1 p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

bazaar1 :: Apply f => p a (f b) -> Bazaar1 p a b t -> f t #

Corepresentable p => Sellable p (Bazaar1 p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

sell :: p a (Bazaar1 p a b b) #

IndexedFunctor (Bazaar1 p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

ifmap :: (s -> t) -> Bazaar1 p a b s -> Bazaar1 p a b t #

Conjoined p => IndexedComonad (Bazaar1 p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

iextract :: Bazaar1 p a a t -> t #

iduplicate :: Bazaar1 p a c t -> Bazaar1 p a b (Bazaar1 p b c t) #

iextend :: (Bazaar1 p b c t -> r) -> Bazaar1 p a c t -> Bazaar1 p a b r #

Functor (Bazaar1 p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

fmap :: (a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 #

(<$) :: a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b a0 #

Apply (Bazaar1 p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

(<.>) :: Bazaar1 p a b (a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 #

(.>) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b b0 #

(<.) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b a0 #

liftF2 :: (a0 -> b0 -> c) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b c #

(a ~ b, Conjoined p) => Comonad (Bazaar1 p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

extract :: Bazaar1 p a b a0 -> a0 #

duplicate :: Bazaar1 p a b a0 -> Bazaar1 p a b (Bazaar1 p a b a0) #

extend :: (Bazaar1 p a b a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 #

(a ~ b, Conjoined p) => ComonadApply (Bazaar1 p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

(<@>) :: Bazaar1 p a b (a0 -> b0) -> Bazaar1 p a b a0 -> Bazaar1 p a b b0 #

(@>) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b b0 #

(<@) :: Bazaar1 p a b a0 -> Bazaar1 p a b b0 -> Bazaar1 p a b a0 #

type Bazaar' (p :: Type -> Type -> Type) a = Bazaar p a a #

This alias is helpful when it comes to reducing repetition in type signatures.

type Bazaar' p a t = Bazaar p a a t

newtype Bazaar (p :: Type -> Type -> Type) a b t #

This is used to characterize a Traversal.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList.

http://twanvl.nl/blog/haskell/non-regular1

A Bazaar is like a Traversal that has already been applied to some structure.

Where a Context a b t holds an a and a function from b to t, a Bazaar a b t holds N as and a function from N bs to t, (where N might be infinite).

Mnemonically, a Bazaar holds many stores and you can easily add more.

This is a final encoding of Bazaar.

Constructors

Bazaar 

Fields

Instances
Profunctor p => Bizarre p (Bazaar p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

bazaar :: Applicative f => p a (f b) -> Bazaar p a b t -> f t #

Corepresentable p => Sellable p (Bazaar p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

sell :: p a (Bazaar p a b b) #

IndexedFunctor (Bazaar p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

ifmap :: (s -> t) -> Bazaar p a b s -> Bazaar p a b t #

Conjoined p => IndexedComonad (Bazaar p) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

iextract :: Bazaar p a a t -> t #

iduplicate :: Bazaar p a c t -> Bazaar p a b (Bazaar p b c t) #

iextend :: (Bazaar p b c t -> r) -> Bazaar p a c t -> Bazaar p a b r #

Functor (Bazaar p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

fmap :: (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 #

(<$) :: a0 -> Bazaar p a b b0 -> Bazaar p a b a0 #

Applicative (Bazaar p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: a0 -> Bazaar p a b a0 #

(<*>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 #

liftA2 :: (a0 -> b0 -> c) -> Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b c #

(*>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 #

(<*) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 #

Apply (Bazaar p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

(<.>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 #

(.>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 #

(<.) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 #

liftF2 :: (a0 -> b0 -> c) -> Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b c #

(a ~ b, Conjoined p) => Comonad (Bazaar p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

extract :: Bazaar p a b a0 -> a0 #

duplicate :: Bazaar p a b a0 -> Bazaar p a b (Bazaar p a b a0) #

extend :: (Bazaar p a b a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 #

(a ~ b, Conjoined p) => ComonadApply (Bazaar p a b) 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

(<@>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 #

(@>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 #

(<@) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 #

class Reversing t where #

This class provides a generalized notion of list reversal extended to other containers.

Methods

reversing :: t -> t #

Instances
Reversing ByteString 
Instance details

Defined in Control.Lens.Internal.Iso

Reversing ByteString 
Instance details

Defined in Control.Lens.Internal.Iso

Reversing Text 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Text -> Text #

Reversing Text 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Text -> Text #

Reversing [a] 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: [a] -> [a] #

Storable a => Reversing (Vector a) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Vector a -> Vector a #

Reversing (NonEmpty a) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: NonEmpty a -> NonEmpty a #

Reversing (Vector a) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Vector a -> Vector a #

Reversing (Seq a) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Seq a -> Seq a #

Unbox a => Reversing (Vector a) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Vector a -> Vector a #

(Metric v, OrderedField n) => Reversing (Located (Trail' l v n))

Same as reverseLocLine or reverseLocLoop.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Located (Trail' l v n) -> Located (Trail' l v n) #

(Metric v, OrderedField n) => Reversing (Located (Trail v n))

Same as reverseLocTrail.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Located (Trail v n) -> Located (Trail v n) #

Prim a => Reversing (Vector a) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

reversing :: Vector a -> Vector a #

(Metric v, OrderedField n) => Reversing (Path v n)

Same as reversePath.

Instance details

Defined in Diagrams.Path

Methods

reversing :: Path v n -> Path v n #

(Metric v, OrderedField n) => Reversing (Trail v n)

Same as reverseTrail.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Trail v n -> Trail v n #

Reversing (FixedSegment v n)

Reverses the control points.

Instance details

Defined in Diagrams.Segment

Methods

reversing :: FixedSegment v n -> FixedSegment v n #

(Metric v, OrderedField n) => Reversing (Trail' l v n)

Same as reverseLine or reverseLoop.

Instance details

Defined in Diagrams.Trail

Methods

reversing :: Trail' l v n -> Trail' l v n #

(Additive v, Num n) => Reversing (Offset c v n)

Reverses the direction of closed offsets.

Instance details

Defined in Diagrams.Segment

Methods

reversing :: Offset c v n -> Offset c v n #

(Additive v, Num n) => Reversing (Segment Closed v n)

Reverse the direction of a segment.

Instance details

Defined in Diagrams.Segment

Methods

reversing :: Segment Closed v n -> Segment Closed v n #

data Level i a #

This data type represents a path-compressed copy of one level of a source data structure. We can safely use path-compression because we know the depth of the tree.

Path compression is performed by viewing a Level as a PATRICIA trie of the paths into the structure to leaves at a given depth, similar in many ways to a IntMap, but unlike a regular PATRICIA trie we do not need to store the mask bits merely the depth of the fork.

One invariant of this structure is that underneath a Two node you will not find any Zero nodes, so Zero can only occur at the root.

Instances
TraversableWithIndex i (Level i) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (i -> a -> f b) -> Level i a -> f (Level i b) #

itraversed :: IndexedTraversal i (Level i a) (Level i b) a b #

FoldableWithIndex i (Level i) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Level i a -> m #

ifolded :: IndexedFold i (Level i a) a #

ifoldr :: (i -> a -> b -> b) -> b -> Level i a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Level i a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Level i a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Level i a -> b #

FunctorWithIndex i (Level i) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b) -> Level i a -> Level i b #

imapped :: IndexedSetter i (Level i a) (Level i b) a b #

Functor (Level i) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

fmap :: (a -> b) -> Level i a -> Level i b #

(<$) :: a -> Level i b -> Level i a #

Foldable (Level i) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

fold :: Monoid m => Level i m -> m #

foldMap :: Monoid m => (a -> m) -> Level i a -> m #

foldr :: (a -> b -> b) -> b -> Level i a -> b #

foldr' :: (a -> b -> b) -> b -> Level i a -> b #

foldl :: (b -> a -> b) -> b -> Level i a -> b #

foldl' :: (b -> a -> b) -> b -> Level i a -> b #

foldr1 :: (a -> a -> a) -> Level i a -> a #

foldl1 :: (a -> a -> a) -> Level i a -> a #

toList :: Level i a -> [a] #

null :: Level i a -> Bool #

length :: Level i a -> Int #

elem :: Eq a => a -> Level i a -> Bool #

maximum :: Ord a => Level i a -> a #

minimum :: Ord a => Level i a -> a #

sum :: Num a => Level i a -> a #

product :: Num a => Level i a -> a #

Traversable (Level i) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

traverse :: Applicative f => (a -> f b) -> Level i a -> f (Level i b) #

sequenceA :: Applicative f => Level i (f a) -> f (Level i a) #

mapM :: Monad m => (a -> m b) -> Level i a -> m (Level i b) #

sequence :: Monad m => Level i (m a) -> m (Level i a) #

(Eq i, Eq a) => Eq (Level i a) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

(==) :: Level i a -> Level i a -> Bool #

(/=) :: Level i a -> Level i a -> Bool #

(Ord i, Ord a) => Ord (Level i a) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

compare :: Level i a -> Level i a -> Ordering #

(<) :: Level i a -> Level i a -> Bool #

(<=) :: Level i a -> Level i a -> Bool #

(>) :: Level i a -> Level i a -> Bool #

(>=) :: Level i a -> Level i a -> Bool #

max :: Level i a -> Level i a -> Level i a #

min :: Level i a -> Level i a -> Level i a #

(Read i, Read a) => Read (Level i a) 
Instance details

Defined in Control.Lens.Internal.Level

(Show i, Show a) => Show (Level i a) 
Instance details

Defined in Control.Lens.Internal.Level

Methods

showsPrec :: Int -> Level i a -> ShowS #

show :: Level i a -> String #

showList :: [Level i a] -> ShowS #

data Magma i t b a #

This provides a way to peek at the internal structure of a Traversal or IndexedTraversal

Instances
TraversableWithIndex i (Magma i t b) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (i -> a -> f b0) -> Magma i t b a -> f (Magma i t b b0) #

itraversed :: IndexedTraversal i (Magma i t b a) (Magma i t b b0) a b0 #

FoldableWithIndex i (Magma i t b) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Magma i t b a -> m #

ifolded :: IndexedFold i (Magma i t b a) a #

ifoldr :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldr' :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl' :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

FunctorWithIndex i (Magma i t b) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b0) -> Magma i t b a -> Magma i t b b0 #

imapped :: IndexedSetter i (Magma i t b a) (Magma i t b b0) a b0 #

Functor (Magma i t b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

fmap :: (a -> b0) -> Magma i t b a -> Magma i t b b0 #

(<$) :: a -> Magma i t b b0 -> Magma i t b a #

Foldable (Magma i t b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

fold :: Monoid m => Magma i t b m -> m #

foldMap :: Monoid m => (a -> m) -> Magma i t b a -> m #

foldr :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

foldr' :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

foldl :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

foldl' :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

foldr1 :: (a -> a -> a) -> Magma i t b a -> a #

foldl1 :: (a -> a -> a) -> Magma i t b a -> a #

toList :: Magma i t b a -> [a] #

null :: Magma i t b a -> Bool #

length :: Magma i t b a -> Int #

elem :: Eq a => a -> Magma i t b a -> Bool #

maximum :: Ord a => Magma i t b a -> a #

minimum :: Ord a => Magma i t b a -> a #

sum :: Num a => Magma i t b a -> a #

product :: Num a => Magma i t b a -> a #

Traversable (Magma i t b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

traverse :: Applicative f => (a -> f b0) -> Magma i t b a -> f (Magma i t b b0) #

sequenceA :: Applicative f => Magma i t b (f a) -> f (Magma i t b a) #

mapM :: Monad m => (a -> m b0) -> Magma i t b a -> m (Magma i t b b0) #

sequence :: Monad m => Magma i t b (m a) -> m (Magma i t b a) #

(Show i, Show a) => Show (Magma i t b a) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

showsPrec :: Int -> Magma i t b a -> ShowS #

show :: Magma i t b a -> String #

showList :: [Magma i t b a] -> ShowS #

class (Profunctor p, Bifunctor p) => Reviewable (p :: Type -> Type -> Type) #

This class is provided mostly for backwards compatibility with lens 3.8, but it can also shorten type signatures.

Instances
(Profunctor p, Bifunctor p) => Reviewable p 
Instance details

Defined in Control.Lens.Internal.Review

retagged :: (Profunctor p, Bifunctor p) => p a b -> p s b #

This is a profunctor used internally to implement Review

It plays a role similar to that of Accessor or Const do for Control.Lens.Getter

class (Applicative f, Distributive f, Traversable f) => Settable (f :: Type -> Type) #

Anything Settable must be isomorphic to the Identity Functor.

Minimal complete definition

untainted

Instances
Settable Identity

So you can pass our Setter into combinators from other lens libraries.

Instance details

Defined in Control.Lens.Internal.Setter

Methods

untainted :: Identity a -> a #

untaintedDot :: Profunctor p => p a (Identity b) -> p a b #

taintedDot :: Profunctor p => p a b -> p a (Identity b) #

Settable f => Settable (Backwards f)

backwards

Instance details

Defined in Control.Lens.Internal.Setter

Methods

untainted :: Backwards f a -> a #

untaintedDot :: Profunctor p => p a (Backwards f b) -> p a b #

taintedDot :: Profunctor p => p a b -> p a (Backwards f b) #

(Settable f, Settable g) => Settable (Compose f g) 
Instance details

Defined in Control.Lens.Internal.Setter

Methods

untainted :: Compose f g a -> a #

untaintedDot :: Profunctor p => p a (Compose f g b) -> p a b #

taintedDot :: Profunctor p => p a b -> p a (Compose f g b) #

type Over' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Over p f s s a a #

This is a convenient alias for use when you need to consume either indexed or non-indexed lens-likes based on context.

type Over' p f = Simple (Over p f)

type Over (p :: k -> Type -> Type) (f :: k1 -> Type) s (t :: k1) (a :: k) (b :: k1) = p a (f b) -> s -> f t #

This is a convenient alias for use when you need to consume either indexed or non-indexed lens-likes based on context.

type IndexedLensLike' i (f :: Type -> Type) s a = IndexedLensLike i f s s a a #

Convenient alias for constructing simple indexed lenses and their ilk.

type IndexedLensLike i (f :: k -> Type) s (t :: k) a (b :: k) = forall (p :: Type -> Type -> Type). Indexable i p => p a (f b) -> s -> f t #

Convenient alias for constructing indexed lenses and their ilk.

type LensLike' (f :: Type -> Type) s a = LensLike f s s a a #

type LensLike' f = Simple (LensLike f)

type LensLike (f :: k -> Type) s (t :: k) a (b :: k) = (a -> f b) -> s -> f t #

Many combinators that accept a Lens can also accept a Traversal in limited situations.

They do so by specializing the type of Functor that they require of the caller.

If a function accepts a LensLike f s t a b for some Functor f, then they may be passed a Lens.

Further, if f is an Applicative, they may also be passed a Traversal.

type Optical' (p :: k1 -> k -> Type) (q :: k1 -> k -> Type) (f :: k1 -> k) (s :: k1) (a :: k1) = Optical p q f s s a a #

type Optical' p q f s a = Simple (Optical p q f) s a

type Optical (p :: k2 -> k -> Type) (q :: k1 -> k -> Type) (f :: k3 -> k) (s :: k1) (t :: k3) (a :: k2) (b :: k3) = p a (f b) -> q s (f t) #

type LensLike f s t a b = Optical (->) (->) f s t a b
type Over p f s t a b = Optical p (->) f s t a b
type Optic p f s t a b = Optical p p f s t a b

type Optic' (p :: k1 -> k -> Type) (f :: k1 -> k) (s :: k1) (a :: k1) = Optic p f s s a a #

type Optic' p f s a = Simple (Optic p f) s a

type Optic (p :: k1 -> k -> Type) (f :: k2 -> k) (s :: k1) (t :: k2) (a :: k1) (b :: k2) = p a (f b) -> p s (f t) #

A valid Optic l should satisfy the laws:

l purepure
l (Procompose f g) = Procompose (l f) (l g)

This gives rise to the laws for Equality, Iso, Prism, Lens, Traversal, Traversal1, Setter, Fold, Fold1, and Getter as well along with their index-preserving variants.

type LensLike f s t a b = Optic (->) f s t a b

type Simple (f :: k -> k -> k1 -> k1 -> k2) (s :: k) (a :: k1) = f s s a a #

A Simple Lens, Simple Traversal, ... can be used instead of a Lens,Traversal, ... whenever the type variables don't change upon setting a value.

_imagPart :: Simple Lens (Complex a) a
traversed :: Simple (IndexedTraversal Int) [a] a

Note: To use this alias in your own code with LensLike f or Setter, you may have to turn on LiberalTypeSynonyms.

This is commonly abbreviated as a "prime" marker, e.g. Lens' = Simple Lens.

type IndexPreservingFold1 s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Apply f) => p a (f a) -> p s (f s) #

type IndexedFold1 i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Apply f) => p a (f a) -> s -> f s #

type Fold1 s a = forall (f :: Type -> Type). (Contravariant f, Apply f) => (a -> f a) -> s -> f s #

A relevant Fold (aka Fold1) has one or more targets.

type IndexPreservingFold s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Applicative f) => p a (f a) -> p s (f s) #

An IndexPreservingFold can be used as a Fold, but when composed with an IndexedTraversal, IndexedFold, or IndexedLens yields an IndexedFold respectively.

type IndexedFold i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Applicative f) => p a (f a) -> s -> f s #

Every IndexedFold is a valid Fold and can be used for Getting.

type Fold s a = forall (f :: Type -> Type). (Contravariant f, Applicative f) => (a -> f a) -> s -> f s #

A Fold describes how to retrieve multiple values in a way that can be composed with other LensLike constructions.

A Fold s a provides a structure with operations very similar to those of the Foldable typeclass, see foldMapOf and the other Fold combinators.

By convention, if there exists a foo method that expects a Foldable (f a), then there should be a fooOf method that takes a Fold s a and a value of type s.

A Getter is a legal Fold that just ignores the supplied Monoid.

Unlike a Traversal a Fold is read-only. Since a Fold cannot be used to write back there are no Lens laws that apply.

type IndexPreservingGetter s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Contravariant f, Functor f) => p a (f a) -> p s (f s) #

An IndexPreservingGetter can be used as a Getter, but when composed with an IndexedTraversal, IndexedFold, or IndexedLens yields an IndexedFold, IndexedFold or IndexedGetter respectively.

type IndexedGetter i s a = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Contravariant f, Functor f) => p a (f a) -> s -> f s #

Every IndexedGetter is a valid IndexedFold and can be used for Getting like a Getter.

type Getter s a = forall (f :: Type -> Type). (Contravariant f, Functor f) => (a -> f a) -> s -> f s #

A Getter describes how to retrieve a single value in a way that can be composed with other LensLike constructions.

Unlike a Lens a Getter is read-only. Since a Getter cannot be used to write back there are no Lens laws that can be applied to it. In fact, it is isomorphic to an arbitrary function from (s -> a).

Moreover, a Getter can be used directly as a Fold, since it just ignores the Applicative.

type As (a :: k2) = Equality' a a #

Composable asTypeOf. Useful for constraining excess polymorphism, foo . (id :: As Int) . bar.

type Equality' (s :: k2) (a :: k2) = Equality s s a a #

type Equality (s :: k1) (t :: k2) (a :: k1) (b :: k2) = forall k3 (p :: k1 -> k3 -> Type) (f :: k2 -> k3). p a (f b) -> p s (f t) #

A witness that (a ~ s, b ~ t).

Note: Composition with an Equality is index-preserving.

type Prism' s a = Prism s s a a #

type Prism s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Choice p, Applicative f) => p a (f b) -> p s (f t) #

A Prism l is a Traversal that can also be turned around with re to obtain a Getter in the opposite direction.

There are three laws that a Prism should satisfy:

First, if I re or review a value with a Prism and then preview or use (^?), I will get it back:

preview l (review l b) ≡ Just b

Second, if you can extract a value a using a Prism l from a value s, then the value s is completely described by l and a:

preview l s ≡ Just a ⟹ review l a ≡ s

Third, if you get non-match t, you can convert it result back to s:

matching l s ≡ Left t ⟹ matching l t ≡ Left s

The first two laws imply that the Traversal laws hold for every Prism and that we traverse at most 1 element:

lengthOf l x <= 1

It may help to think of this as a Iso that can be partial in one direction.

Every Prism is a valid Traversal.

Every Iso is a valid Prism.

For example, you might have a Prism' Integer Natural allows you to always go from a Natural to an Integer, and provide you with tools to check if an Integer is a Natural and/or to edit one if it is.

nat :: Prism' Integer Natural
nat = prism toInteger $ \ i ->
   if i < 0
   then Left i
   else Right (fromInteger i)

Now we can ask if an Integer is a Natural.

>>> 5^?nat
Just 5
>>> (-5)^?nat
Nothing

We can update the ones that are:

>>> (-3,4) & both.nat *~ 2
(-3,8)

And we can then convert from a Natural to an Integer.

>>> 5 ^. re nat -- :: Natural
5

Similarly we can use a Prism to traverse the Left half of an Either:

>>> Left "hello" & _Left %~ length
Left 5

or to construct an Either:

>>> 5^.re _Left
Left 5

such that if you query it with the Prism, you will get your original input back.

>>> 5^.re _Left ^? _Left
Just 5

Another interesting way to think of a Prism is as the categorical dual of a Lens -- a co-Lens, so to speak. This is what permits the construction of outside.

Note: Composition with a Prism is index-preserving.

type AReview t b = Optic' (Tagged :: Type -> Type -> Type) Identity t b #

If you see this in a signature for a function, the function is expecting a Review (in practice, this usually means a Prism).

type Review t b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Choice p, Bifunctor p, Settable f) => Optic' p f t b #

This is a limited form of a Prism that can only be used for re operations.

Like with a Getter, there are no laws to state for a Review.

You can generate a Review by using unto. You can also use any Prism or Iso directly as a Review.

type Iso' s a = Iso s s a a #

type Iso' = Simple Iso

type Iso s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Profunctor p, Functor f) => p a (f b) -> p s (f t) #

Isomorphism families can be composed with another Lens using (.) and id.

Since every Iso is both a valid Lens and a valid Prism, the laws for those types imply the following laws for an Iso f:

f . from f ≡ id
from f . f ≡ id

Note: Composition with an Iso is index- and measure- preserving.

type IndexPreservingSetter' s a = IndexPreservingSetter s s a a #

type IndexedPreservingSetter' i = Simple IndexedPreservingSetter

type IndexPreservingSetter s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Settable f) => p a (f b) -> p s (f t) #

An IndexPreservingSetter can be composed with a IndexedSetter, IndexedTraversal or IndexedLens and leaves the index intact, yielding an IndexedSetter.

type IndexedSetter' i s a = IndexedSetter i s s a a #

type IndexedSetter i s t a b = forall (f :: Type -> Type) (p :: Type -> Type -> Type). (Indexable i p, Settable f) => p a (f b) -> s -> f t #

Every IndexedSetter is a valid Setter.

The Setter laws are still required to hold.

type Setter' s a = Setter s s a a #

A Setter' is just a Setter that doesn't change the types.

These are particularly common when talking about monomorphic containers. e.g.

sets Data.Text.map :: Setter' Text Char
type Setter' = Simple Setter

type Setter s t a b = forall (f :: Type -> Type). Settable f => (a -> f b) -> s -> f t #

The only LensLike law that can apply to a Setter l is that

set l y (set l x a) ≡ set l y a

You can't view a Setter in general, so the other two laws are irrelevant.

However, two Functor laws apply to a Setter:

over l idid
over l f . over l g ≡ over l (f . g)

These can be stated more directly:

l purepure
l f . untainted . l g ≡ l (f . untainted . g)

You can compose a Setter with a Lens or a Traversal using (.) from the Prelude and the result is always only a Setter and nothing more.

>>> over traverse f [a,b,c,d]
[f a,f b,f c,f d]
>>> over _1 f (a,b)
(f a,b)
>>> over (traverse._1) f [(a,b),(c,d)]
[(f a,b),(f c,d)]
>>> over both f (a,b)
(f a,f b)
>>> over (traverse.both) f [(a,b),(c,d)]
[(f a,f b),(f c,f d)]

type IndexPreservingTraversal1 s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Apply f) => p a (f b) -> p s (f t) #

type IndexPreservingTraversal s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Applicative f) => p a (f b) -> p s (f t) #

An IndexPreservingLens leaves any index it is composed with alone.

type IndexedTraversal1' i s a = IndexedTraversal1 i s s a a #

type IndexedTraversal1 i s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Apply f) => p a (f b) -> s -> f t #

type IndexedTraversal i s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Indexable i p, Applicative f) => p a (f b) -> s -> f t #

Every IndexedTraversal is a valid Traversal or IndexedFold.

The Indexed constraint is used to allow an IndexedTraversal to be used directly as a Traversal.

The Traversal laws are still required to hold.

In addition, the index i should satisfy the requirement that it stays unchanged even when modifying the value a, otherwise traversals like indices break the Traversal laws.

type Traversal1' s a = Traversal1 s s a a #

type Traversal1 s t a b = forall (f :: Type -> Type). Apply f => (a -> f b) -> s -> f t #

type Traversal' s a = Traversal s s a a #

type Traversal s t a b = forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t #

A Traversal can be used directly as a Setter or a Fold (but not as a Lens) and provides the ability to both read and update multiple fields, subject to some relatively weak Traversal laws.

These have also been known as multilenses, but they have the signature and spirit of

traverse :: Traversable f => Traversal (f a) (f b) a b

and the more evocative name suggests their application.

Most of the time the Traversal you will want to use is just traverse, but you can also pass any Lens or Iso as a Traversal, and composition of a Traversal (or Lens or Iso) with a Traversal (or Lens or Iso) using (.) forms a valid Traversal.

The laws for a Traversal t follow from the laws for Traversable as stated in "The Essence of the Iterator Pattern".

t purepure
fmap (t f) . t g ≡ getCompose . t (Compose . fmap f . g)

One consequence of this requirement is that a Traversal needs to leave the same number of elements as a candidate for subsequent Traversal that it started with. Another testament to the strength of these laws is that the caveat expressed in section 5.5 of the "Essence of the Iterator Pattern" about exotic Traversable instances that traverse the same entry multiple times was actually already ruled out by the second law in that same paper!

type IndexPreservingLens s t a b = forall (p :: Type -> Type -> Type) (f :: Type -> Type). (Conjoined p, Functor f) => p a (f b) -> p s (f t) #

An IndexPreservingLens leaves any index it is composed with alone.

type IndexedLens' i s a = IndexedLens i s s a a #

type IndexedLens i s t a b = forall (f :: Type -> Type) (p :: Type -> Type -> Type). (Indexable i p, Functor f) => p a (f b) -> s -> f t #

Every IndexedLens is a valid Lens and a valid IndexedTraversal.

type Lens' s a = Lens s s a a #

type Lens' = Simple Lens

type Lens s t a b = forall (f :: Type -> Type). Functor f => (a -> f b) -> s -> f t #

A Lens is actually a lens family as described in http://comonad.com/reader/2012/mirrored-lenses/.

With great power comes great responsibility and a Lens is subject to the three common sense Lens laws:

1) You get back what you put in:

view l (set l v s)  ≡ v

2) Putting back what you got doesn't change anything:

set l (view l s) s  ≡ s

3) Setting twice is the same as setting once:

set l v' (set l v s) ≡ set l v' s

These laws are strong enough that the 4 type parameters of a Lens cannot vary fully independently. For more on how they interact, read the "Why is it a Lens Family?" section of http://comonad.com/reader/2012/mirrored-lenses/.

There are some emergent properties of these laws:

1) set l s must be injective for every s This is a consequence of law #1

2) set l must be surjective, because of law #2, which indicates that it is possible to obtain any v from some s such that set s v = s

3) Given just the first two laws you can prove a weaker form of law #3 where the values v that you are setting match:

set l v (set l v s) ≡ set l v s

Every Lens can be used directly as a Setter or Traversal.

You can also use a Lens for Getting as if it were a Fold or Getter.

Since every Lens is a valid Traversal, the Traversal laws are required of any Lens you create:

l purepure
fmap (l f) . l g ≡ getCompose . l (Compose . fmap f . g)
type Lens s t a b = forall f. Functor f => LensLike f s t a b

type Setting' (p :: Type -> Type -> Type) s a = Setting p s s a a #

This is a convenient alias when defining highly polymorphic code that takes both ASetter' and AnIndexedSetter' as appropriate. If a function takes this it is expecting one of those two things based on context.

type Setting (p :: Type -> Type -> Type) s t a b = p a (Identity b) -> s -> Identity t #

This is a convenient alias when defining highly polymorphic code that takes both ASetter and AnIndexedSetter as appropriate. If a function takes this it is expecting one of those two things based on context.

type AnIndexedSetter i s t a b = Indexed i a (Identity b) -> s -> Identity t #

Running an IndexedSetter instantiates it to a concrete type.

When consuming a setter directly to perform a mapping, you can use this type, but most user code will not need to use this type.

type ASetter' s a = ASetter s s a a #

This is a useful alias for use when consuming a Setter'.

Most user code will never have to use this type.

type ASetter' = Simple ASetter

type ASetter s t a b = (a -> Identity b) -> s -> Identity t #

Running a Setter instantiates it to a concrete type.

When consuming a setter directly to perform a mapping, you can use this type, but most user code will not need to use this type.

mapped :: Functor f => Setter (f a) (f b) a b #

This Setter can be used to map over all of the values in a Functor.

fmapover mapped
fmapDefaultover traverse
(<$) ≡ set mapped
>>> over mapped f [a,b,c]
[f a,f b,f c]
>>> over mapped (+1) [1,2,3]
[2,3,4]
>>> set mapped x [a,b,c]
[x,x,x]
>>> [[a,b],[c]] & mapped.mapped +~ x
[[a + x,b + x],[c + x]]
>>> over (mapped._2) length [("hello","world"),("leaders","!!!")]
[("hello",5),("leaders",3)]
mapped :: Functor f => Setter (f a) (f b) a b

If you want an IndexPreservingSetter use setting fmap.

lifted :: Monad m => Setter (m a) (m b) a b #

This setter can be used to modify all of the values in a Monad.

You sometimes have to use this rather than mapped -- due to temporary insanity Functor was not a superclass of Monad until GHC 7.10.

liftMover lifted
>>> over lifted f [a,b,c]
[f a,f b,f c]
>>> set lifted b (Just a)
Just b

If you want an IndexPreservingSetter use setting liftM.

contramapped :: Contravariant f => Setter (f b) (f a) a b #

This Setter can be used to map over all of the inputs to a Contravariant.

contramapover contramapped
>>> getPredicate (over contramapped (*2) (Predicate even)) 5
True
>>> getOp (over contramapped (*5) (Op show)) 100
"500"
>>> Prelude.map ($ 1) $ over (mapped . _Unwrapping' Op . contramapped) (*12) [(*2),(+1),(^3)]
[24,13,1728]

setting :: ((a -> b) -> s -> t) -> IndexPreservingSetter s t a b #

Build an index-preserving Setter from a map-like function.

Your supplied function f is required to satisfy:

f idid
f g . f h ≡ f (g . h)

Equational reasoning:

setting . overid
over . settingid

Another way to view sets is that it takes a "semantic editor combinator" and transforms it into a Setter.

setting :: ((a -> b) -> s -> t) -> Setter s t a b

sets :: (Profunctor p, Profunctor q, Settable f) => (p a b -> q s t) -> Optical p q f s t a b #

Build a Setter, IndexedSetter or IndexPreservingSetter depending on your choice of Profunctor.

sets :: ((a -> b) -> s -> t) -> Setter s t a b

cloneSetter :: ASetter s t a b -> Setter s t a b #

Restore ASetter to a full Setter.

over :: ASetter s t a b -> (a -> b) -> s -> t #

Modify the target of a Lens or all the targets of a Setter or Traversal with a function.

fmapover mapped
fmapDefaultover traverse
sets . overid
over . setsid

Given any valid Setter l, you can also rely on the law:

over l f . over l g = over l (f . g)

e.g.

>>> over mapped f (over mapped g [a,b,c]) == over mapped (f . g) [a,b,c]
True

Another way to view over is to say that it transforms a Setter into a "semantic editor combinator".

>>> over mapped f (Just a)
Just (f a)
>>> over mapped (*10) [1,2,3]
[10,20,30]
>>> over _1 f (a,b)
(f a,b)
>>> over _1 show (10,20)
("10",20)
over :: Setter s t a b -> (a -> b) -> s -> t
over :: ASetter s t a b -> (a -> b) -> s -> t

set :: ASetter s t a b -> b -> s -> t #

Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value.

(<$) ≡ set mapped
>>> set _2 "hello" (1,())
(1,"hello")
>>> set mapped () [1,2,3,4]
[(),(),(),()]

Note: Attempting to set a Fold or Getter will fail at compile time with an relatively nice error message.

set :: Setter s t a b    -> b -> s -> t
set :: Iso s t a b       -> b -> s -> t
set :: Lens s t a b      -> b -> s -> t
set :: Traversal s t a b -> b -> s -> t

set' :: ASetter' s a -> a -> s -> s #

Replace the target of a Lens or all of the targets of a Setter' or Traversal with a constant value, without changing its type.

This is a type restricted version of set, which retains the type of the original.

>>> set' mapped x [a,b,c,d]
[x,x,x,x]
>>> set' _2 "hello" (1,"world")
(1,"hello")
>>> set' mapped 0 [1,2,3,4]
[0,0,0,0]

Note: Attempting to adjust set' a Fold or Getter will fail at compile time with an relatively nice error message.

set' :: Setter' s a    -> a -> s -> s
set' :: Iso' s a       -> a -> s -> s
set' :: Lens' s a      -> a -> s -> s
set' :: Traversal' s a -> a -> s -> s

(%~) :: ASetter s t a b -> (a -> b) -> s -> t infixr 4 #

Modifies the target of a Lens or all of the targets of a Setter or Traversal with a user supplied function.

This is an infix version of over.

fmap f ≡ mapped %~ f
fmapDefault f ≡ traverse %~ f
>>> (a,b,c) & _3 %~ f
(a,b,f c)
>>> (a,b) & both %~ f
(f a,f b)
>>> _2 %~ length $ (1,"hello")
(1,5)
>>> traverse %~ f $ [a,b,c]
[f a,f b,f c]
>>> traverse %~ even $ [1,2,3]
[False,True,False]
>>> traverse.traverse %~ length $ [["hello","world"],["!!!"]]
[[5,5],[3]]
(%~) :: Setter s t a b    -> (a -> b) -> s -> t
(%~) :: Iso s t a b       -> (a -> b) -> s -> t
(%~) :: Lens s t a b      -> (a -> b) -> s -> t
(%~) :: Traversal s t a b -> (a -> b) -> s -> t

(.~) :: ASetter s t a b -> b -> s -> t infixr 4 #

Replace the target of a Lens or all of the targets of a Setter or Traversal with a constant value.

This is an infix version of set, provided for consistency with (.=).

f <$ a ≡ mapped .~ f $ a
>>> (a,b,c,d) & _4 .~ e
(a,b,c,e)
>>> (42,"world") & _1 .~ "hello"
("hello","world")
>>> (a,b) & both .~ c
(c,c)
(.~) :: Setter s t a b    -> b -> s -> t
(.~) :: Iso s t a b       -> b -> s -> t
(.~) :: Lens s t a b      -> b -> s -> t
(.~) :: Traversal s t a b -> b -> s -> t

(?~) :: ASetter s t a (Maybe b) -> b -> s -> t infixr 4 #

Set the target of a Lens, Traversal or Setter to Just a value.

l ?~ t ≡ set l (Just t)
>>> Nothing & id ?~ a
Just a
>>> Map.empty & at 3 ?~ x
fromList [(3,x)]

?~ can be used type-changily:

>>> ('a', ('b', 'c')) & _2.both ?~ 'x'
('a',(Just 'x',Just 'x'))
(?~) :: Setter s t a (Maybe b)    -> b -> s -> t
(?~) :: Iso s t a (Maybe b)       -> b -> s -> t
(?~) :: Lens s t a (Maybe b)      -> b -> s -> t
(?~) :: Traversal s t a (Maybe b) -> b -> s -> t

(<.~) :: ASetter s t a b -> b -> s -> (b, t) infixr 4 #

Set with pass-through.

This is mostly present for consistency, but may be useful for chaining assignments.

If you do not need a copy of the intermediate result, then using l .~ t directly is a good idea.

>>> (a,b) & _1 <.~ c
(c,(c,b))
>>> ("good","morning","vietnam") & _3 <.~ "world"
("world",("good","morning","world"))
>>> (42,Map.fromList [("goodnight","gracie")]) & _2.at "hello" <.~ Just "world"
(Just "world",(42,fromList [("goodnight","gracie"),("hello","world")]))
(<.~) :: Setter s t a b    -> b -> s -> (b, t)
(<.~) :: Iso s t a b       -> b -> s -> (b, t)
(<.~) :: Lens s t a b      -> b -> s -> (b, t)
(<.~) :: Traversal s t a b -> b -> s -> (b, t)

(<?~) :: ASetter s t a (Maybe b) -> b -> s -> (b, t) infixr 4 #

Set to Just a value with pass-through.

This is mostly present for consistency, but may be useful for for chaining assignments.

If you do not need a copy of the intermediate result, then using l ?~ d directly is a good idea.

>>> import Data.Map as Map
>>> _2.at "hello" <?~ "world" $ (42,Map.fromList [("goodnight","gracie")])
("world",(42,fromList [("goodnight","gracie"),("hello","world")]))
(<?~) :: Setter s t a (Maybe b)    -> b -> s -> (b, t)
(<?~) :: Iso s t a (Maybe b)       -> b -> s -> (b, t)
(<?~) :: Lens s t a (Maybe b)      -> b -> s -> (b, t)
(<?~) :: Traversal s t a (Maybe b) -> b -> s -> (b, t)

(+~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 #

Increment the target(s) of a numerically valued Lens, Setter or Traversal.

>>> (a,b) & _1 +~ c
(a + c,b)
>>> (a,b) & both +~ c
(a + c,b + c)
>>> (1,2) & _2 +~ 1
(1,3)
>>> [(a,b),(c,d)] & traverse.both +~ e
[(a + e,b + e),(c + e,d + e)]
(+~) :: Num a => Setter' s a    -> a -> s -> s
(+~) :: Num a => Iso' s a       -> a -> s -> s
(+~) :: Num a => Lens' s a      -> a -> s -> s
(+~) :: Num a => Traversal' s a -> a -> s -> s

(*~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 #

Multiply the target(s) of a numerically valued Lens, Iso, Setter or Traversal.

>>> (a,b) & _1 *~ c
(a * c,b)
>>> (a,b) & both *~ c
(a * c,b * c)
>>> (1,2) & _2 *~ 4
(1,8)
>>> Just 24 & mapped *~ 2
Just 48
(*~) :: Num a => Setter' s a    -> a -> s -> s
(*~) :: Num a => Iso' s a       -> a -> s -> s
(*~) :: Num a => Lens' s a      -> a -> s -> s
(*~) :: Num a => Traversal' s a -> a -> s -> s

(-~) :: Num a => ASetter s t a a -> a -> s -> t infixr 4 #

Decrement the target(s) of a numerically valued Lens, Iso, Setter or Traversal.

>>> (a,b) & _1 -~ c
(a - c,b)
>>> (a,b) & both -~ c
(a - c,b - c)
>>> _1 -~ 2 $ (1,2)
(-1,2)
>>> mapped.mapped -~ 1 $ [[4,5],[6,7]]
[[3,4],[5,6]]
(-~) :: Num a => Setter' s a    -> a -> s -> s
(-~) :: Num a => Iso' s a       -> a -> s -> s
(-~) :: Num a => Lens' s a      -> a -> s -> s
(-~) :: Num a => Traversal' s a -> a -> s -> s

(//~) :: Fractional a => ASetter s t a a -> a -> s -> t infixr 4 #

Divide the target(s) of a numerically valued Lens, Iso, Setter or Traversal.

>>> (a,b) & _1 //~ c
(a / c,b)
>>> (a,b) & both //~ c
(a / c,b / c)
>>> ("Hawaii",10) & _2 //~ 2
("Hawaii",5.0)
(//~) :: Fractional a => Setter' s a    -> a -> s -> s
(//~) :: Fractional a => Iso' s a       -> a -> s -> s
(//~) :: Fractional a => Lens' s a      -> a -> s -> s
(//~) :: Fractional a => Traversal' s a -> a -> s -> s

(^~) :: (Num a, Integral e) => ASetter s t a a -> e -> s -> t infixr 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to a non-negative integral power.

>>> (1,3) & _2 ^~ 2
(1,9)
(^~) :: (Num a, Integral e) => Setter' s a    -> e -> s -> s
(^~) :: (Num a, Integral e) => Iso' s a       -> e -> s -> s
(^~) :: (Num a, Integral e) => Lens' s a      -> e -> s -> s
(^~) :: (Num a, Integral e) => Traversal' s a -> e -> s -> s

(^^~) :: (Fractional a, Integral e) => ASetter s t a a -> e -> s -> t infixr 4 #

Raise the target(s) of a fractionally valued Lens, Setter or Traversal to an integral power.

>>> (1,2) & _2 ^^~ (-1)
(1,0.5)
(^^~) :: (Fractional a, Integral e) => Setter' s a    -> e -> s -> s
(^^~) :: (Fractional a, Integral e) => Iso' s a       -> e -> s -> s
(^^~) :: (Fractional a, Integral e) => Lens' s a      -> e -> s -> s
(^^~) :: (Fractional a, Integral e) => Traversal' s a -> e -> s -> s

(**~) :: Floating a => ASetter s t a a -> a -> s -> t infixr 4 #

Raise the target(s) of a floating-point valued Lens, Setter or Traversal to an arbitrary power.

>>> (a,b) & _1 **~ c
(a**c,b)
>>> (a,b) & both **~ c
(a**c,b**c)
>>> _2 **~ 10 $ (3,2)
(3,1024.0)
(**~) :: Floating a => Setter' s a    -> a -> s -> s
(**~) :: Floating a => Iso' s a       -> a -> s -> s
(**~) :: Floating a => Lens' s a      -> a -> s -> s
(**~) :: Floating a => Traversal' s a -> a -> s -> s

(||~) :: ASetter s t Bool Bool -> Bool -> s -> t infixr 4 #

Logically || the target(s) of a Bool-valued Lens or Setter.

>>> both ||~ True $ (False,True)
(True,True)
>>> both ||~ False $ (False,True)
(False,True)
(||~) :: Setter' s Bool    -> Bool -> s -> s
(||~) :: Iso' s Bool       -> Bool -> s -> s
(||~) :: Lens' s Bool      -> Bool -> s -> s
(||~) :: Traversal' s Bool -> Bool -> s -> s

(&&~) :: ASetter s t Bool Bool -> Bool -> s -> t infixr 4 #

Logically && the target(s) of a Bool-valued Lens or Setter.

>>> both &&~ True $ (False, True)
(False,True)
>>> both &&~ False $ (False, True)
(False,False)
(&&~) :: Setter' s Bool    -> Bool -> s -> s
(&&~) :: Iso' s Bool       -> Bool -> s -> s
(&&~) :: Lens' s Bool      -> Bool -> s -> s
(&&~) :: Traversal' s Bool -> Bool -> s -> s

assign :: MonadState s m => ASetter s s a b -> b -> m () #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old.

This is an alias for (.=).

>>> execState (do assign _1 c; assign _2 d) (a,b)
(c,d)
>>> execState (both .= c) (a,b)
(c,c)
assign :: MonadState s m => Iso' s a       -> a -> m ()
assign :: MonadState s m => Lens' s a      -> a -> m ()
assign :: MonadState s m => Traversal' s a -> a -> m ()
assign :: MonadState s m => Setter' s a    -> a -> m ()

(.=) :: MonadState s m => ASetter s s a b -> b -> m () infix 4 #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old.

This is an infix version of assign.

>>> execState (do _1 .= c; _2 .= d) (a,b)
(c,d)
>>> execState (both .= c) (a,b)
(c,c)
(.=) :: MonadState s m => Iso' s a       -> a -> m ()
(.=) :: MonadState s m => Lens' s a      -> a -> m ()
(.=) :: MonadState s m => Traversal' s a -> a -> m ()
(.=) :: MonadState s m => Setter' s a    -> a -> m ()

It puts the state in the monad or it gets the hose again.

(%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m () infix 4 #

Map over the target of a Lens or all of the targets of a Setter or Traversal in our monadic state.

>>> execState (do _1 %= f;_2 %= g) (a,b)
(f a,g b)
>>> execState (do both %= f) (a,b)
(f a,f b)
(%=) :: MonadState s m => Iso' s a       -> (a -> a) -> m ()
(%=) :: MonadState s m => Lens' s a      -> (a -> a) -> m ()
(%=) :: MonadState s m => Traversal' s a -> (a -> a) -> m ()
(%=) :: MonadState s m => Setter' s a    -> (a -> a) -> m ()
(%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m ()

modifying :: MonadState s m => ASetter s s a b -> (a -> b) -> m () #

This is an alias for (%=).

(?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m () infix 4 #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with Just a new value, irrespective of the old.

>>> execState (do at 1 ?= a; at 2 ?= b) Map.empty
fromList [(1,a),(2,b)]
>>> execState (do _1 ?= b; _2 ?= c) (Just a, Nothing)
(Just b,Just c)
(?=) :: MonadState s m => Iso' s (Maybe a)       -> a -> m ()
(?=) :: MonadState s m => Lens' s (Maybe a)      -> a -> m ()
(?=) :: MonadState s m => Traversal' s (Maybe a) -> a -> m ()
(?=) :: MonadState s m => Setter' s (Maybe a)    -> a -> m ()

(+=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by adding a value.

Example:

fresh :: MonadState Int m => m Int
fresh = do
  id += 1
  use id
>>> execState (do _1 += c; _2 += d) (a,b)
(a + c,b + d)
>>> execState (do _1.at 1.non 0 += 10) (Map.fromList [(2,100)],"hello")
(fromList [(1,10),(2,100)],"hello")
(+=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
(+=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
(+=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
(+=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(-=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by subtracting a value.

>>> execState (do _1 -= c; _2 -= d) (a,b)
(a - c,b - d)
(-=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
(-=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
(-=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
(-=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(*=) :: (MonadState s m, Num a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by multiplying by value.

>>> execState (do _1 *= c; _2 *= d) (a,b)
(a * c,b * d)
(*=) :: (MonadState s m, Num a) => Setter' s a    -> a -> m ()
(*=) :: (MonadState s m, Num a) => Iso' s a       -> a -> m ()
(*=) :: (MonadState s m, Num a) => Lens' s a      -> a -> m ()
(*=) :: (MonadState s m, Num a) => Traversal' s a -> a -> m ()

(//=) :: (MonadState s m, Fractional a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by dividing by a value.

>>> execState (do _1 //= c; _2 //= d) (a,b)
(a / c,b / d)
(//=) :: (MonadState s m, Fractional a) => Setter' s a    -> a -> m ()
(//=) :: (MonadState s m, Fractional a) => Iso' s a       -> a -> m ()
(//=) :: (MonadState s m, Fractional a) => Lens' s a      -> a -> m ()
(//=) :: (MonadState s m, Fractional a) => Traversal' s a -> a -> m ()

(^=) :: (MonadState s m, Num a, Integral e) => ASetter' s a -> e -> m () infix 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to a non-negative integral power.

(^=) ::  (MonadState s m, Num a, Integral e) => Setter' s a    -> e -> m ()
(^=) ::  (MonadState s m, Num a, Integral e) => Iso' s a       -> e -> m ()
(^=) ::  (MonadState s m, Num a, Integral e) => Lens' s a      -> e -> m ()
(^=) ::  (MonadState s m, Num a, Integral e) => Traversal' s a -> e -> m ()

(^^=) :: (MonadState s m, Fractional a, Integral e) => ASetter' s a -> e -> m () infix 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to an integral power.

(^^=) ::  (MonadState s m, Fractional a, Integral e) => Setter' s a    -> e -> m ()
(^^=) ::  (MonadState s m, Fractional a, Integral e) => Iso' s a       -> e -> m ()
(^^=) ::  (MonadState s m, Fractional a, Integral e) => Lens' s a      -> e -> m ()
(^^=) ::  (MonadState s m, Fractional a, Integral e) => Traversal' s a -> e -> m ()

(**=) :: (MonadState s m, Floating a) => ASetter' s a -> a -> m () infix 4 #

Raise the target(s) of a numerically valued Lens, Setter or Traversal to an arbitrary power

>>> execState (do _1 **= c; _2 **= d) (a,b)
(a**c,b**d)
(**=) ::  (MonadState s m, Floating a) => Setter' s a    -> a -> m ()
(**=) ::  (MonadState s m, Floating a) => Iso' s a       -> a -> m ()
(**=) ::  (MonadState s m, Floating a) => Lens' s a      -> a -> m ()
(**=) ::  (MonadState s m, Floating a) => Traversal' s a -> a -> m ()

(&&=) :: MonadState s m => ASetter' s Bool -> Bool -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by taking their logical && with a value.

>>> execState (do _1 &&= True; _2 &&= False; _3 &&= True; _4 &&= False) (True,True,False,False)
(True,False,False,False)
(&&=) :: MonadState s m => Setter' s Bool    -> Bool -> m ()
(&&=) :: MonadState s m => Iso' s Bool       -> Bool -> m ()
(&&=) :: MonadState s m => Lens' s Bool      -> Bool -> m ()
(&&=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()

(||=) :: MonadState s m => ASetter' s Bool -> Bool -> m () infix 4 #

Modify the target(s) of a Lens', 'Iso, Setter or Traversal by taking their logical || with a value.

>>> execState (do _1 ||= True; _2 ||= False; _3 ||= True; _4 ||= False) (True,True,False,False)
(True,True,True,False)
(||=) :: MonadState s m => Setter' s Bool    -> Bool -> m ()
(||=) :: MonadState s m => Iso' s Bool       -> Bool -> m ()
(||=) :: MonadState s m => Lens' s Bool      -> Bool -> m ()
(||=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()

(<~) :: MonadState s m => ASetter s s a b -> m b -> m () infixr 2 #

Run a monadic action, and set all of the targets of a Lens, Setter or Traversal to its result.

(<~) :: MonadState s m => Iso s s a b       -> m b -> m ()
(<~) :: MonadState s m => Lens s s a b      -> m b -> m ()
(<~) :: MonadState s m => Traversal s s a b -> m b -> m ()
(<~) :: MonadState s m => Setter s s a b    -> m b -> m ()

As a reasonable mnemonic, this lets you store the result of a monadic action in a Lens rather than in a local variable.

do foo <- bar
   ...

will store the result in a variable, while

do foo <~ bar
   ...

will store the result in a Lens, Setter, or Traversal.

(<.=) :: MonadState s m => ASetter s s a b -> b -> m b infix 4 #

Set with pass-through

This is useful for chaining assignment without round-tripping through your Monad stack.

do x <- _2 <.= ninety_nine_bottles_of_beer_on_the_wall

If you do not need a copy of the intermediate result, then using l .= d will avoid unused binding warnings.

(<.=) :: MonadState s m => Setter s s a b    -> b -> m b
(<.=) :: MonadState s m => Iso s s a b       -> b -> m b
(<.=) :: MonadState s m => Lens s s a b      -> b -> m b
(<.=) :: MonadState s m => Traversal s s a b -> b -> m b

(<?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m b infix 4 #

Set Just a value with pass-through

This is useful for chaining assignment without round-tripping through your Monad stack.

do x <- at "foo" <?= ninety_nine_bottles_of_beer_on_the_wall

If you do not need a copy of the intermediate result, then using l ?= d will avoid unused binding warnings.

(<?=) :: MonadState s m => Setter s s a (Maybe b)    -> b -> m b
(<?=) :: MonadState s m => Iso s s a (Maybe b)       -> b -> m b
(<?=) :: MonadState s m => Lens s s a (Maybe b)      -> b -> m b
(<?=) :: MonadState s m => Traversal s s a (Maybe b) -> b -> m b

(<>~) :: Monoid a => ASetter s t a a -> a -> s -> t infixr 4 #

Modify the target of a monoidally valued by mappending another value.

>>> (Sum a,b) & _1 <>~ Sum c
(Sum {getSum = a + c},b)
>>> (Sum a,Sum b) & both <>~ Sum c
(Sum {getSum = a + c},Sum {getSum = b + c})
>>> both <>~ "!!!" $ ("hello","world")
("hello!!!","world!!!")
(<>~) :: Monoid a => Setter s t a a    -> a -> s -> t
(<>~) :: Monoid a => Iso s t a a       -> a -> s -> t
(<>~) :: Monoid a => Lens s t a a      -> a -> s -> t
(<>~) :: Monoid a => Traversal s t a a -> a -> s -> t

(<>=) :: (MonadState s m, Monoid a) => ASetter' s a -> a -> m () infix 4 #

Modify the target(s) of a Lens', Iso, Setter or Traversal by mappending a value.

>>> execState (do _1 <>= Sum c; _2 <>= Product d) (Sum a,Product b)
(Sum {getSum = a + c},Product {getProduct = b * d})
>>> execState (both <>= "!!!") ("hello","world")
("hello!!!","world!!!")
(<>=) :: (MonadState s m, Monoid a) => Setter' s a -> a -> m ()
(<>=) :: (MonadState s m, Monoid a) => Iso' s a -> a -> m ()
(<>=) :: (MonadState s m, Monoid a) => Lens' s a -> a -> m ()
(<>=) :: (MonadState s m, Monoid a) => Traversal' s a -> a -> m ()

scribe :: (MonadWriter t m, Monoid s) => ASetter s t a b -> b -> m () #

Write to a fragment of a larger Writer format.

passing :: MonadWriter w m => Setter w w u v -> m (a, u -> v) -> m a #

This is a generalization of pass that allows you to modify just a portion of the resulting MonadWriter.

ipassing :: MonadWriter w m => IndexedSetter i w w u v -> m (a, i -> u -> v) -> m a #

This is a generalization of pass that allows you to modify just a portion of the resulting MonadWriter with access to the index of an IndexedSetter.

censoring :: MonadWriter w m => Setter w w u v -> (u -> v) -> m a -> m a #

This is a generalization of censor that allows you to censor just a portion of the resulting MonadWriter.

icensoring :: MonadWriter w m => IndexedSetter i w w u v -> (i -> u -> v) -> m a -> m a #

This is a generalization of censor that allows you to censor just a portion of the resulting MonadWriter, with access to the index of an IndexedSetter.

locally :: MonadReader s m => ASetter s s a b -> (a -> b) -> m r -> m r #

Modify the value of the Reader environment associated with the target of a Setter, Lens, or Traversal.

locally l id a ≡ a
locally l f . locally l g ≡ locally l (f . g)
>>> (1,1) & locally _1 (+1) (uncurry (+))
3
>>> "," & locally ($) ("Hello" <>) (<> " world!")
"Hello, world!"
locally :: MonadReader s m => Iso s s a b       -> (a -> b) -> m r -> m r
locally :: MonadReader s m => Lens s s a b      -> (a -> b) -> m r -> m r
locally :: MonadReader s m => Traversal s s a b -> (a -> b) -> m r -> m r
locally :: MonadReader s m => Setter s s a b    -> (a -> b) -> m r -> m r

ilocally :: MonadReader s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m r -> m r #

This is a generalization of locally that allows one to make indexed local changes to a Reader environment associated with the target of a Setter, Lens, or Traversal.

locally l f ≡ ilocally l f . const
ilocally l f ≡ locally l f . Indexed
ilocally :: MonadReader s m => IndexedLens s s a b      -> (i -> a -> b) -> m r -> m r
ilocally :: MonadReader s m => IndexedTraversal s s a b -> (i -> a -> b) -> m r -> m r
ilocally :: MonadReader s m => IndexedSetter s s a b    -> (i -> a -> b) -> m r -> m r

iover :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t #

Map with index. This is an alias for imapOf.

When you do not need access to the index, then over is more liberal in what it can accept.

over l ≡ iover l . const
iover l ≡ over l . Indexed
iover :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
iover :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
iover :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

iset :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t #

Set with index. Equivalent to iover with the current value ignored.

When you do not need access to the index, then set is more liberal in what it can accept.

set l ≡ iset l . const
iset :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
iset :: IndexedLens i s t a b      -> (i -> b) -> s -> t
iset :: IndexedTraversal i s t a b -> (i -> b) -> s -> t

isets :: ((i -> a -> b) -> s -> t) -> IndexedSetter i s t a b #

Build an IndexedSetter from an imap-like function.

Your supplied function f is required to satisfy:

f idid
f g . f h ≡ f (g . h)

Equational reasoning:

isets . ioverid
iover . isetsid

Another way to view isets is that it takes a "semantic editor combinator" which has been modified to carry an index and transforms it into a IndexedSetter.

(%@~) :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t infixr 4 #

Adjust every target of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

(%@~) ≡ iover

When you do not need access to the index then (%~) is more liberal in what it can accept.

l %~ f ≡ l %@~ const f
(%@~) :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
(%@~) :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
(%@~) :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

(.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t infixr 4 #

Replace every target of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

(.@~) ≡ iset

When you do not need access to the index then (.~) is more liberal in what it can accept.

l .~ b ≡ l .@~ const b
(.@~) :: IndexedSetter i s t a b    -> (i -> b) -> s -> t
(.@~) :: IndexedLens i s t a b      -> (i -> b) -> s -> t
(.@~) :: IndexedTraversal i s t a b -> (i -> b) -> s -> t

(%@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m () infix 4 #

Adjust every target in the current state of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

When you do not need access to the index then (%=) is more liberal in what it can accept.

l %= f ≡ l %@= const f
(%@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> a -> b) -> m ()
(%@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> a -> b) -> m ()
(%@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> a -> b) -> m ()

imodifying :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m () #

This is an alias for (%@=).

(.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m () infix 4 #

Replace every target in the current state of an IndexedSetter, IndexedLens or IndexedTraversal with access to the index.

When you do not need access to the index then (.=) is more liberal in what it can accept.

l .= b ≡ l .@= const b
(.@=) :: MonadState s m => IndexedSetter i s s a b    -> (i -> b) -> m ()
(.@=) :: MonadState s m => IndexedLens i s s a b      -> (i -> b) -> m ()
(.@=) :: MonadState s m => IndexedTraversal i s t a b -> (i -> b) -> m ()

assignA :: Arrow p => ASetter s t a b -> p s b -> p s t #

Run an arrow command and use the output to set all the targets of a Lens, Setter or Traversal to the result.

assignA can be used very similarly to (<~), except that the type of the object being modified can change; for example:

runKleisli action ((), (), ()) where
  action =      assignA _1 (Kleisli (const getVal1))
           >>> assignA _2 (Kleisli (const getVal2))
           >>> assignA _3 (Kleisli (const getVal3))
  getVal1 :: Either String Int
  getVal1 = ...
  getVal2 :: Either String Bool
  getVal2 = ...
  getVal3 :: Either String Char
  getVal3 = ...

has the type Either String (Int, Bool, Char)

assignA :: Arrow p => Iso s t a b       -> p s b -> p s t
assignA :: Arrow p => Lens s t a b      -> p s b -> p s t
assignA :: Arrow p => Traversal s t a b -> p s b -> p s t
assignA :: Arrow p => Setter s t a b    -> p s b -> p s t

mapOf :: ASetter s t a b -> (a -> b) -> s -> t #

mapOf is a deprecated alias for over.

imapOf :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t #

Map with index. (Deprecated alias for iover).

When you do not need access to the index, then mapOf is more liberal in what it can accept.

mapOf l ≡ imapOf l . const
imapOf :: IndexedSetter i s t a b    -> (i -> a -> b) -> s -> t
imapOf :: IndexedLens i s t a b      -> (i -> a -> b) -> s -> t
imapOf :: IndexedTraversal i s t a b -> (i -> a -> b) -> s -> t

type AnIndexedLens i s t a b = Optical (Indexed i) ((->) :: Type -> Type -> Type) (Pretext (Indexed i) a b) s t a b #

When you see this as an argument to a function, it expects an IndexedLens

type ALens' s a = ALens s s a a #

type ALens s t a b = LensLike (Pretext ((->) :: Type -> Type -> Type) a b) s t a b #

When you see this as an argument to a function, it expects a Lens.

This type can also be used when you need to store a Lens in a container, since it is rank-1. You can turn them back into a Lens with cloneLens, or use it directly with combinators like storing and (^#).

lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b #

Build a Lens from a getter and a setter.

lens :: Functor f => (s -> a) -> (s -> b -> t) -> (a -> f b) -> s -> f t
>>> s ^. lens getter setter
getter s
>>> s & lens getter setter .~ b
setter s b
>>> s & lens getter setter %~ f
setter s (f (getter s))
lens :: (s -> a) -> (s -> a -> s) -> Lens' s a

iplens :: (s -> a) -> (s -> b -> t) -> IndexPreservingLens s t a b #

Build an index-preserving Lens from a Getter and a Setter.

ilens :: (s -> (i, a)) -> (s -> b -> t) -> IndexedLens i s t a b #

Build an IndexedLens from a Getter and a Setter.

(&~) :: s -> State s a -> s infixl 1 #

This can be used to chain lens operations using op= syntax rather than op~ syntax for simple non-type-changing cases.

>>> (10,20) & _1 .~ 30 & _2 .~ 40
(30,40)
>>> (10,20) &~ do _1 .= 30; _2 .= 40
(30,40)

This does not support type-changing assignment, e.g.

>>> (10,20) & _1 .~ "hello"
("hello",20)

(%%~) :: LensLike f s t a b -> (a -> f b) -> s -> f t infixr 4 #

(%%~) can be used in one of two scenarios:

When applied to a Lens, it can edit the target of the Lens in a structure, extracting a functorial result.

When applied to a Traversal, it can edit the targets of the traversals, extracting an applicative summary of its actions.

>>> [66,97,116,109,97,110] & each %%~ \a -> ("na", chr a)
("nananananana","Batman")

For all that the definition of this combinator is just:

(%%~) ≡ id

It may be beneficial to think about it as if it had these even more restricted types, however:

(%%~) :: Functor f =>     Iso s t a b       -> (a -> f b) -> s -> f t
(%%~) :: Functor f =>     Lens s t a b      -> (a -> f b) -> s -> f t
(%%~) :: Applicative f => Traversal s t a b -> (a -> f b) -> s -> f t

When applied to a Traversal, it can edit the targets of the traversals, extracting a supplemental monoidal summary of its actions, by choosing f = ((,) m)

(%%~) ::             Iso s t a b       -> (a -> (r, b)) -> s -> (r, t)
(%%~) ::             Lens s t a b      -> (a -> (r, b)) -> s -> (r, t)
(%%~) :: Monoid m => Traversal s t a b -> (a -> (m, b)) -> s -> (m, t)

(%%=) :: MonadState s m => Over p ((,) r) s s a b -> p a (r, b) -> m r infix 4 #

Modify the target of a Lens in the current state returning some extra information of type r or modify all targets of a Traversal in the current state, extracting extra information of type r and return a monoidal summary of the changes.

>>> runState (_1 %%= \x -> (f x, g x)) (a,b)
(f a,(g a,b))
(%%=) ≡ (state .)

It may be useful to think of (%%=), instead, as having either of the following more restricted type signatures:

(%%=) :: MonadState s m             => Iso s s a b       -> (a -> (r, b)) -> m r
(%%=) :: MonadState s m             => Lens s s a b      -> (a -> (r, b)) -> m r
(%%=) :: (MonadState s m, Monoid r) => Traversal s s a b -> (a -> (r, b)) -> m r

(??) :: Functor f => f (a -> b) -> a -> f b infixl 1 #

This is convenient to flip argument order of composite functions defined as:

fab ?? a = fmap ($ a) fab

For the Functor instance f = ((->) r) you can reason about this function as if the definition was (??) ≡ flip:

>>> (h ?? x) a
h a x
>>> execState ?? [] $ modify (1:)
[1]
>>> over _2 ?? ("hello","world") $ length
("hello",5)
>>> over ?? length ?? ("hello","world") $ _2
("hello",5)

choosing :: Functor f => LensLike f s t a b -> LensLike f s' t' a b -> LensLike f (Either s s') (Either t t') a b #

Merge two lenses, getters, setters, folds or traversals.

chosenchoosing id id
choosing :: Getter s a     -> Getter s' a     -> Getter (Either s s') a
choosing :: Fold s a       -> Fold s' a       -> Fold (Either s s') a
choosing :: Lens' s a      -> Lens' s' a      -> Lens' (Either s s') a
choosing :: Traversal' s a -> Traversal' s' a -> Traversal' (Either s s') a
choosing :: Setter' s a    -> Setter' s' a    -> Setter' (Either s s') a

chosen :: IndexPreservingLens (Either a a) (Either b b) a b #

This is a Lens that updates either side of an Either, where both sides have the same type.

chosenchoosing id id
>>> Left a^.chosen
a
>>> Right a^.chosen
a
>>> Right "hello"^.chosen
"hello"
>>> Right a & chosen *~ b
Right (a * b)
chosen :: Lens (Either a a) (Either b b) a b
chosen f (Left a)  = Left <$> f a
chosen f (Right a) = Right <$> f a

alongside :: LensLike (AlongsideLeft f b') s t a b -> LensLike (AlongsideRight f t) s' t' a' b' -> LensLike f (s, s') (t, t') (a, a') (b, b') #

alongside makes a Lens from two other lenses or a Getter from two other getters by executing them on their respective halves of a product.

>>> (Left a, Right b)^.alongside chosen chosen
(a,b)
>>> (Left a, Right b) & alongside chosen chosen .~ (c,d)
(Left c,Right d)
alongside :: Lens   s t a b -> Lens   s' t' a' b' -> Lens   (s,s') (t,t') (a,a') (b,b')
alongside :: Getter s   a   -> Getter s'    a'    -> Getter (s,s')        (a,a')

locus :: IndexedComonadStore p => Lens (p a c s) (p b c s) a b #

This Lens lets you view the current pos of any indexed store comonad and seek to a new position. This reduces the API for working these instances to a single Lens.

ipos w ≡ w ^. locus
iseek s w ≡ w & locus .~ s
iseeks f w ≡ w & locus %~ f
locus :: Lens' (Context' a s) a
locus :: Conjoined p => Lens' (Pretext' p a s) a
locus :: Conjoined p => Lens' (PretextT' p g a s) a

cloneLens :: ALens s t a b -> Lens s t a b #

Cloning a Lens is one way to make sure you aren't given something weaker, such as a Traversal and can be used as a way to pass around lenses that have to be monomorphic in f.

Note: This only accepts a proper Lens.

>>> let example l x = set (cloneLens l) (x^.cloneLens l + 1) x in example _2 ("hello",1,"you")
("hello",2,"you")

cloneIndexPreservingLens :: ALens s t a b -> IndexPreservingLens s t a b #

Clone a Lens as an IndexedPreservingLens that just passes through whatever index is on any IndexedLens, IndexedFold, IndexedGetter or IndexedTraversal it is composed with.

cloneIndexedLens :: AnIndexedLens i s t a b -> IndexedLens i s t a b #

Clone an IndexedLens as an IndexedLens with the same index.

(<%~) :: LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t) infixr 4 #

Modify the target of a Lens and return the result.

When you do not need the result of the operation, (%~) is more flexible.

(<%~) ::             Lens s t a b      -> (a -> b) -> s -> (b, t)
(<%~) ::             Iso s t a b       -> (a -> b) -> s -> (b, t)
(<%~) :: Monoid b => Traversal s t a b -> (a -> b) -> s -> (b, t)

(<+~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Increment the target of a numerically valued Lens and return the result.

When you do not need the result of the addition, (+~) is more flexible.

(<+~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<+~) :: Num a => Iso' s a  -> a -> s -> (a, s)

(<-~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Decrement the target of a numerically valued Lens and return the result.

When you do not need the result of the subtraction, (-~) is more flexible.

(<-~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<-~) :: Num a => Iso' s a  -> a -> s -> (a, s)

(<*~) :: Num a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Multiply the target of a numerically valued Lens and return the result.

When you do not need the result of the multiplication, (*~) is more flexible.

(<*~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<*~) :: Num a => Iso'  s a -> a -> s -> (a, s)

(<//~) :: Fractional a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Divide the target of a fractionally valued Lens and return the result.

When you do not need the result of the division, (//~) is more flexible.

(<//~) :: Fractional a => Lens' s a -> a -> s -> (a, s)
(<//~) :: Fractional a => Iso'  s a -> a -> s -> (a, s)

(<^~) :: (Num a, Integral e) => LensLike ((,) a) s t a a -> e -> s -> (a, t) infixr 4 #

Raise the target of a numerically valued Lens to a non-negative Integral power and return the result.

When you do not need the result of the operation, (^~) is more flexible.

(<^~) :: (Num a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<^~) :: (Num a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<^^~) :: (Fractional a, Integral e) => LensLike ((,) a) s t a a -> e -> s -> (a, t) infixr 4 #

Raise the target of a fractionally valued Lens to an Integral power and return the result.

When you do not need the result of the operation, (^^~) is more flexible.

(<^^~) :: (Fractional a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<^^~) :: (Fractional a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<**~) :: Floating a => LensLike ((,) a) s t a a -> a -> s -> (a, t) infixr 4 #

Raise the target of a floating-point valued Lens to an arbitrary power and return the result.

When you do not need the result of the operation, (**~) is more flexible.

(<**~) :: Floating a => Lens' s a -> a -> s -> (a, s)
(<**~) :: Floating a => Iso' s a  -> a -> s -> (a, s)

(<||~) :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t) infixr 4 #

Logically || a Boolean valued Lens and return the result.

When you do not need the result of the operation, (||~) is more flexible.

(<||~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<||~) :: Iso' s Bool  -> Bool -> s -> (Bool, s)

(<&&~) :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t) infixr 4 #

Logically && a Boolean valued Lens and return the result.

When you do not need the result of the operation, (&&~) is more flexible.

(<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<&&~) :: Iso' s Bool  -> Bool -> s -> (Bool, s)

(<<%~) :: LensLike ((,) a) s t a b -> (a -> b) -> s -> (a, t) infixr 4 #

Modify the target of a Lens, but return the old value.

When you do not need the old value, (%~) is more flexible.

(<<%~) ::             Lens s t a b      -> (a -> b) -> s -> (a, t)
(<<%~) ::             Iso s t a b       -> (a -> b) -> s -> (a, t)
(<<%~) :: Monoid a => Traversal s t a b -> (a -> b) -> s -> (a, t)

(<<.~) :: LensLike ((,) a) s t a b -> b -> s -> (a, t) infixr 4 #

Replace the target of a Lens, but return the old value.

When you do not need the old value, (.~) is more flexible.

(<<.~) ::             Lens s t a b      -> b -> s -> (a, t)
(<<.~) ::             Iso s t a b       -> b -> s -> (a, t)
(<<.~) :: Monoid a => Traversal s t a b -> b -> s -> (a, t)

(<<?~) :: LensLike ((,) a) s t a (Maybe b) -> b -> s -> (a, t) infixr 4 #

Replace the target of a Lens with a Just value, but return the old value.

If you do not need the old value (?~) is more flexible.

>>> import Data.Map as Map
>>> _2.at "hello" <<?~ "world" $ (42,Map.fromList [("goodnight","gracie")])
(Nothing,(42,fromList [("goodnight","gracie"),("hello","world")]))
(<<?~) :: Iso s t a (Maybe b)       -> b -> s -> (a, t)
(<<?~) :: Lens s t a (Maybe b)      -> b -> s -> (a, t)
(<<?~) :: Traversal s t a (Maybe b) -> b -> s -> (a, t)

(<<+~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Increment the target of a numerically valued Lens and return the old value.

When you do not need the old value, (+~) is more flexible.

>>> (a,b) & _1 <<+~ c
(a,(a + c,b))
>>> (a,b) & _2 <<+~ c
(b,(a,b + c))
(<<+~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<<+~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<-~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Decrement the target of a numerically valued Lens and return the old value.

When you do not need the old value, (-~) is more flexible.

>>> (a,b) & _1 <<-~ c
(a,(a - c,b))
>>> (a,b) & _2 <<-~ c
(b,(a,b - c))
(<<-~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<<-~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<*~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Multiply the target of a numerically valued Lens and return the old value.

When you do not need the old value, (-~) is more flexible.

>>> (a,b) & _1 <<*~ c
(a,(a * c,b))
>>> (a,b) & _2 <<*~ c
(b,(a,b * c))
(<<*~) :: Num a => Lens' s a -> a -> s -> (a, s)
(<<*~) :: Num a => Iso' s a -> a -> s -> (a, s)

(<<//~) :: Fractional a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Divide the target of a numerically valued Lens and return the old value.

When you do not need the old value, (//~) is more flexible.

>>> (a,b) & _1 <<//~ c
(a,(a / c,b))
>>> ("Hawaii",10) & _2 <<//~ 2
(10.0,("Hawaii",5.0))
(<<//~) :: Fractional a => Lens' s a -> a -> s -> (a, s)
(<<//~) :: Fractional a => Iso' s a -> a -> s -> (a, s)

(<<^~) :: (Num a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s) infixr 4 #

Raise the target of a numerically valued Lens to a non-negative power and return the old value.

When you do not need the old value, (^~) is more flexible.

(<<^~) :: (Num a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<<^~) :: (Num a, Integral e) => Iso' s a -> e -> s -> (a, s)

(<<^^~) :: (Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s) infixr 4 #

Raise the target of a fractionally valued Lens to an integral power and return the old value.

When you do not need the old value, (^^~) is more flexible.

(<<^^~) :: (Fractional a, Integral e) => Lens' s a -> e -> s -> (a, s)
(<<^^~) :: (Fractional a, Integral e) => Iso' s a -> e -> S -> (a, s)

(<<**~) :: Floating a => LensLike' ((,) a) s a -> a -> s -> (a, s) infixr 4 #

Raise the target of a floating-point valued Lens to an arbitrary power and return the old value.

When you do not need the old value, (**~) is more flexible.

>>> (a,b) & _1 <<**~ c
(a,(a**c,b))
>>> (a,b) & _2 <<**~ c
(b,(a,b**c))
(<<**~) :: Floating a => Lens' s a -> a -> s -> (a, s)
(<<**~) :: Floating a => Iso' s a -> a -> s -> (a, s)

(<<||~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s) infixr 4 #

Logically || the target of a Bool-valued Lens and return the old value.

When you do not need the old value, (||~) is more flexible.

>>> (False,6) & _1 <<||~ True
(False,(True,6))
>>> ("hello",True) & _2 <<||~ False
(True,("hello",True))
(<<||~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<<||~) :: Iso' s Bool -> Bool -> s -> (Bool, s)

(<<&&~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s) infixr 4 #

Logically && the target of a Bool-valued Lens and return the old value.

When you do not need the old value, (&&~) is more flexible.

>>> (False,6) & _1 <<&&~ True
(False,(False,6))
>>> ("hello",True) & _2 <<&&~ False
(True,("hello",False))
(<<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<<&&~) :: Iso' s Bool -> Bool -> s -> (Bool, s)

(<<<>~) :: Monoid r => LensLike' ((,) r) s r -> r -> s -> (r, s) infixr 4 #

Modify the target of a monoidally valued Lens by mappending a new value and return the old value.

When you do not need the old value, (<>~) is more flexible.

>>> (Sum a,b) & _1 <<<>~ Sum c
(Sum {getSum = a},(Sum {getSum = a + c},b))
>>> _2 <<<>~ ", 007" $ ("James", "Bond")
("Bond",("James","Bond, 007"))
(<<<>~) :: Monoid r => Lens' s r -> r -> s -> (r, s)
(<<<>~) :: Monoid r => Iso' s r -> r -> s -> (r, s)

(<%=) :: MonadState s m => LensLike ((,) b) s s a b -> (a -> b) -> m b infix 4 #

Modify the target of a Lens into your Monad's state by a user supplied function and return the result.

When applied to a Traversal, it this will return a monoidal summary of all of the intermediate results.

When you do not need the result of the operation, (%=) is more flexible.

(<%=) :: MonadState s m             => Lens' s a      -> (a -> a) -> m a
(<%=) :: MonadState s m             => Iso' s a       -> (a -> a) -> m a
(<%=) :: (MonadState s m, Monoid a) => Traversal' s a -> (a -> a) -> m a

(<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Add to the target of a numerically valued Lens into your Monad's state and return the result.

When you do not need the result of the addition, (+=) is more flexible.

(<+=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<+=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Subtract from the target of a numerically valued Lens into your Monad's state and return the result.

When you do not need the result of the subtraction, (-=) is more flexible.

(<-=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<-=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Multiply the target of a numerically valued Lens into your Monad's state and return the result.

When you do not need the result of the multiplication, (*=) is more flexible.

(<*=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<*=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Divide the target of a fractionally valued Lens into your Monad's state and return the result.

When you do not need the result of the division, (//=) is more flexible.

(<//=) :: (MonadState s m, Fractional a) => Lens' s a -> a -> m a
(<//=) :: (MonadState s m, Fractional a) => Iso' s a -> a -> m a

(<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Raise the target of a numerically valued Lens into your Monad's state to a non-negative Integral power and return the result.

When you do not need the result of the operation, (^=) is more flexible.

(<^=) :: (MonadState s m, Num a, Integral e) => Lens' s a -> e -> m a
(<^=) :: (MonadState s m, Num a, Integral e) => Iso' s a -> e -> m a

(<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Raise the target of a fractionally valued Lens into your Monad's state to an Integral power and return the result.

When you do not need the result of the operation, (^^=) is more flexible.

(<^^=) :: (MonadState s m, Fractional b, Integral e) => Lens' s a -> e -> m a
(<^^=) :: (MonadState s m, Fractional b, Integral e) => Iso' s a  -> e -> m a

(<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Raise the target of a floating-point valued Lens into your Monad's state to an arbitrary power and return the result.

When you do not need the result of the operation, (**=) is more flexible.

(<**=) :: (MonadState s m, Floating a) => Lens' s a -> a -> m a
(<**=) :: (MonadState s m, Floating a) => Iso' s a -> a -> m a

(<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Logically || a Boolean valued Lens into your Monad's state and return the result.

When you do not need the result of the operation, (||=) is more flexible.

(<||=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<||=) :: MonadState s m => Iso' s Bool  -> Bool -> m Bool

(<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Logically && a Boolean valued Lens into your Monad's state and return the result.

When you do not need the result of the operation, (&&=) is more flexible.

(<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<&&=) :: MonadState s m => Iso' s Bool  -> Bool -> m Bool

(<<%=) :: (Strong p, MonadState s m) => Over p ((,) a) s s a b -> p a b -> m a infix 4 #

Modify the target of a Lens into your Monad's state by a user supplied function and return the old value that was replaced.

When applied to a Traversal, this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (%=) is more flexible.

(<<%=) :: MonadState s m             => Lens' s a      -> (a -> a) -> m a
(<<%=) :: MonadState s m             => Iso' s a       -> (a -> a) -> m a
(<<%=) :: (MonadState s m, Monoid a) => Traversal' s a -> (a -> a) -> m a
(<<%=) :: MonadState s m => LensLike ((,)a) s s a b -> (a -> b) -> m a

(<<.=) :: MonadState s m => LensLike ((,) a) s s a b -> b -> m a infix 4 #

Replace the target of a Lens into your Monad's state with a user supplied value and return the old value that was replaced.

When applied to a Traversal, this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (.=) is more flexible.

(<<.=) :: MonadState s m             => Lens' s a      -> a -> m a
(<<.=) :: MonadState s m             => Iso' s a       -> a -> m a
(<<.=) :: (MonadState s m, Monoid a) => Traversal' s a -> a -> m a

(<<?=) :: MonadState s m => LensLike ((,) a) s s a (Maybe b) -> b -> m a infix 4 #

Replace the target of a Lens into your Monad's state with Just a user supplied value and return the old value that was replaced.

When applied to a Traversal, this will return a monoidal summary of all of the old values present.

When you do not need the result of the operation, (?=) is more flexible.

(<<?=) :: MonadState s m             => Lens s t a (Maybe b)      -> b -> m a
(<<?=) :: MonadState s m             => Iso s t a (Maybe b)       -> b -> m a
(<<?=) :: (MonadState s m, Monoid a) => Traversal s t a (Maybe b) -> b -> m a

(<<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by adding a value and return the old value that was replaced.

When you do not need the result of the operation, (+=) is more flexible.

(<<+=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<<+=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by subtracting a value and return the old value that was replaced.

When you do not need the result of the operation, (-=) is more flexible.

(<<-=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<<-=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by multipling a value and return the old value that was replaced.

When you do not need the result of the operation, (*=) is more flexible.

(<<*=) :: (MonadState s m, Num a) => Lens' s a -> a -> m a
(<<*=) :: (MonadState s m, Num a) => Iso' s a -> a -> m a

(<<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monads state by dividing by a value and return the old value that was replaced.

When you do not need the result of the operation, (//=) is more flexible.

(<<//=) :: (MonadState s m, Fractional a) => Lens' s a -> a -> m a
(<<//=) :: (MonadState s m, Fractional a) => Iso' s a -> a -> m a

(<<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Modify the target of a Lens into your Monad's state by raising it by a non-negative power and return the old value that was replaced.

When you do not need the result of the operation, (^=) is more flexible.

(<<^=) :: (MonadState s m, Num a, Integral e) => Lens' s a -> e -> m a
(<<^=) :: (MonadState s m, Num a, Integral e) => Iso' s a -> a -> m a

(<<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a infix 4 #

Modify the target of a Lens into your Monad's state by raising it by an integral power and return the old value that was replaced.

When you do not need the result of the operation, (^^=) is more flexible.

(<<^^=) :: (MonadState s m, Fractional a, Integral e) => Lens' s a -> e -> m a
(<<^^=) :: (MonadState s m, Fractional a, Integral e) => Iso' s a -> e -> m a

(<<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a infix 4 #

Modify the target of a Lens into your Monad's state by raising it by an arbitrary power and return the old value that was replaced.

When you do not need the result of the operation, (**=) is more flexible.

(<<**=) :: (MonadState s m, Floating a) => Lens' s a -> a -> m a
(<<**=) :: (MonadState s m, Floating a) => Iso' s a -> a -> m a

(<<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Modify the target of a Lens into your Monad's state by taking its logical || with a value and return the old value that was replaced.

When you do not need the result of the operation, (||=) is more flexible.

(<<||=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<<||=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool

(<<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool infix 4 #

Modify the target of a Lens into your Monad's state by taking its logical && with a value and return the old value that was replaced.

When you do not need the result of the operation, (&&=) is more flexible.

(<<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<<&&=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool

(<<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,) r) s r -> r -> m r infix 4 #

Modify the target of a Lens into your Monad's state by mappending a value and return the old value that was replaced.

When you do not need the result of the operation, (<>=) is more flexible.

(<<<>=) :: (MonadState s m, Monoid r) => Lens' s r -> r -> m r
(<<<>=) :: (MonadState s m, Monoid r) => Iso' s r -> r -> m r

(<<~) :: MonadState s m => ALens s s a b -> m b -> m b infixr 2 #

Run a monadic action, and set the target of Lens to its result.

(<<~) :: MonadState s m => Iso s s a b   -> m b -> m b
(<<~) :: MonadState s m => Lens s s a b  -> m b -> m b

NB: This is limited to taking an actual Lens than admitting a Traversal because there are potential loss of state issues otherwise.

(<<>~) :: Monoid m => LensLike ((,) m) s t m m -> m -> s -> (m, t) infixr 4 #

mappend a monoidal value onto the end of the target of a Lens and return the result.

When you do not need the result of the operation, (<>~) is more flexible.

(<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,) r) s r -> r -> m r infix 4 #

mappend a monoidal value onto the end of the target of a Lens into your Monad's state and return the result.

When you do not need the result of the operation, (<>=) is more flexible.

overA :: Arrow ar => LensLike (Context a b) s t a b -> ar a b -> ar s t #

over for Arrows.

Unlike over, overA can't accept a simple Setter, but requires a full lens, or close enough.

>>> overA _1 ((+1) *** (+2)) ((1,2),6)
((2,4),6)
overA :: Arrow ar => Lens s t a b -> ar a b -> ar s t

(<%@~) :: Over (Indexed i) ((,) b) s t a b -> (i -> a -> b) -> s -> (b, t) infixr 4 #

Adjust the target of an IndexedLens returning the intermediate result, or adjust all of the targets of an IndexedTraversal and return a monoidal summary along with the answer.

l <%~ f ≡ l <%@~ const f

When you do not need access to the index then (<%~) is more liberal in what it can accept.

If you do not need the intermediate result, you can use (%@~) or even (%~).

(<%@~) ::             IndexedLens i s t a b      -> (i -> a -> b) -> s -> (b, t)
(<%@~) :: Monoid b => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> (b, t)

(<<%@~) :: Over (Indexed i) ((,) a) s t a b -> (i -> a -> b) -> s -> (a, t) infixr 4 #

Adjust the target of an IndexedLens returning the old value, or adjust all of the targets of an IndexedTraversal and return a monoidal summary of the old values along with the answer.

(<<%@~) ::             IndexedLens i s t a b      -> (i -> a -> b) -> s -> (a, t)
(<<%@~) :: Monoid a => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> (a, t)

(%%@~) :: Over (Indexed i) f s t a b -> (i -> a -> f b) -> s -> f t infixr 4 #

Adjust the target of an IndexedLens returning a supplementary result, or adjust all of the targets of an IndexedTraversal and return a monoidal summary of the supplementary results and the answer.

(%%@~) ≡ withIndex
(%%@~) :: Functor f => IndexedLens i s t a b      -> (i -> a -> f b) -> s -> f t
(%%@~) :: Applicative f => IndexedTraversal i s t a b -> (i -> a -> f b) -> s -> f t

In particular, it is often useful to think of this function as having one of these even more restricted type signatures:

(%%@~) ::             IndexedLens i s t a b      -> (i -> a -> (r, b)) -> s -> (r, t)
(%%@~) :: Monoid r => IndexedTraversal i s t a b -> (i -> a -> (r, b)) -> s -> (r, t)

(%%@=) :: MonadState s m => Over (Indexed i) ((,) r) s s a b -> (i -> a -> (r, b)) -> m r infix 4 #

Adjust the target of an IndexedLens returning a supplementary result, or adjust all of the targets of an IndexedTraversal within the current state, and return a monoidal summary of the supplementary results.

l %%@= f ≡ state (l %%@~ f)
(%%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> (r, b)) -> s -> m r
(%%@=) :: (MonadState s m, Monoid r) => IndexedTraversal i s s a b -> (i -> a -> (r, b)) -> s -> m r

(<%@=) :: MonadState s m => Over (Indexed i) ((,) b) s s a b -> (i -> a -> b) -> m b infix 4 #

Adjust the target of an IndexedLens returning the intermediate result, or adjust all of the targets of an IndexedTraversal within the current state, and return a monoidal summary of the intermediate results.

(<%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> b) -> m b
(<%@=) :: (MonadState s m, Monoid b) => IndexedTraversal i s s a b -> (i -> a -> b) -> m b

(<<%@=) :: MonadState s m => Over (Indexed i) ((,) a) s s a b -> (i -> a -> b) -> m a infix 4 #

Adjust the target of an IndexedLens returning the old value, or adjust all of the targets of an IndexedTraversal within the current state, and return a monoidal summary of the old values.

(<<%@=) :: MonadState s m                 => IndexedLens i s s a b      -> (i -> a -> b) -> m a
(<<%@=) :: (MonadState s m, Monoid b) => IndexedTraversal i s s a b -> (i -> a -> b) -> m a

(^#) :: s -> ALens s t a b -> a infixl 8 #

A version of (^.) that works on ALens.

>>> ("hello","world")^#_2
"world"

storing :: ALens s t a b -> b -> s -> t #

A version of set that works on ALens.

>>> storing _2 "world" ("hello","there")
("hello","world")

(#~) :: ALens s t a b -> b -> s -> t infixr 4 #

A version of (.~) that works on ALens.

>>> ("hello","there") & _2 #~ "world"
("hello","world")

(#%~) :: ALens s t a b -> (a -> b) -> s -> t infixr 4 #

A version of (%~) that works on ALens.

>>> ("hello","world") & _2 #%~ length
("hello",5)

(#%%~) :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t infixr 4 #

A version of (%%~) that works on ALens.

>>> ("hello","world") & _2 #%%~ \x -> (length x, x ++ "!")
(5,("hello","world!"))

(#=) :: MonadState s m => ALens s s a b -> b -> m () infix 4 #

A version of (.=) that works on ALens.

(#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m () infix 4 #

A version of (%=) that works on ALens.

(<#%~) :: ALens s t a b -> (a -> b) -> s -> (b, t) infixr 4 #

A version of (<%~) that works on ALens.

>>> ("hello","world") & _2 <#%~ length
(5,("hello",5))

(<#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m b infix 4 #

A version of (<%=) that works on ALens.

(#%%=) :: MonadState s m => ALens s s a b -> (a -> (r, b)) -> m r infix 4 #

A version of (%%=) that works on ALens.

(<#~) :: ALens s t a b -> b -> s -> (b, t) infixr 4 #

A version of (<.~) that works on ALens.

>>> ("hello","there") & _2 <#~ "world"
("world",("hello","world"))

(<#=) :: MonadState s m => ALens s s a b -> b -> m b infix 4 #

A version of (<.=) that works on ALens.

devoid :: Over p f Void Void a b #

There is a field for every type in the Void. Very zen.

>>> [] & mapped.devoid +~ 1
[]
>>> Nothing & mapped.devoid %~ abs
Nothing
devoid :: Lens' Void a

united :: Lens' a () #

We can always retrieve a () from any type.

>>> "hello"^.united
()
>>> "hello" & united .~ ()
"hello"

fusing :: Functor f => LensLike (Yoneda f) s t a b -> LensLike f s t a b #

Fuse a composition of lenses using Yoneda to provide fmap fusion.

In general, given a pair of lenses foo and bar

fusing (foo.bar) = foo.bar

however, foo and bar are either going to fmap internally or they are trivial.

fusing exploits the Yoneda lemma to merge these separate uses into a single fmap.

This is particularly effective when the choice of functor f is unknown at compile time or when the Lens foo.bar in the above description is recursive or complex enough to prevent inlining.

fusing :: Lens s t a b -> Lens s t a b

class Field19 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 19th field of a tuple.

Minimal complete definition

Nothing

Methods

_19 :: Lens s t a b #

Access the 19th field of a tuple.

Instances
19 <= n => Field19 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_19 :: Lens (V n a) (V n a) a a #

Field19 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s') s s' 
Instance details

Defined in Control.Lens.Tuple

Methods

_19 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s') s s' #

class Field18 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 18th field of a tuple.

Minimal complete definition

Nothing

Methods

_18 :: Lens s t a b #

Access the 18th field of a tuple.

Instances
18 <= n => Field18 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_18 :: Lens (V n a) (V n a) a a #

Field18 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r') r r' 
Instance details

Defined in Control.Lens.Tuple

Methods

_18 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r') r r' #

Field18 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r', s) r r' 
Instance details

Defined in Control.Lens.Tuple

Methods

_18 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r', s) r r' #

class Field17 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 17th field of a tuple.

Minimal complete definition

Nothing

Methods

_17 :: Lens s t a b #

Access the 17th field of a tuple.

Instances
17 <= n => Field17 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_17 :: Lens (V n a) (V n a) a a #

Field17 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q') q q' 
Instance details

Defined in Control.Lens.Tuple

Methods

_17 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q') q q' #

Field17 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r) q q' 
Instance details

Defined in Control.Lens.Tuple

Methods

_17 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r) q q' #

Field17 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r, s) q q' 
Instance details

Defined in Control.Lens.Tuple

Methods

_17 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q', r, s) q q' #

class Field16 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 16th field of a tuple.

Minimal complete definition

Nothing

Methods

_16 :: Lens s t a b #

Access the 16th field of a tuple.

Instances
16 <= n => Field16 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_16 :: Lens (V n a) (V n a) a a #

Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p') p p' 
Instance details

Defined in Control.Lens.Tuple

Methods

_16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p') p p' #

Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q) p p' 
Instance details

Defined in Control.Lens.Tuple

Methods

_16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q) p p' #

Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r) p p' 
Instance details

Defined in Control.Lens.Tuple

Methods

_16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r) p p' #

Field16 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r, s) p p' 
Instance details

Defined in Control.Lens.Tuple

Methods

_16 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p', q, r, s) p p' #

class Field15 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 15th field of a tuple.

Minimal complete definition

Nothing

Methods

_15 :: Lens s t a b #

Access the 15th field of a tuple.

Instances
15 <= n => Field15 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_15 :: Lens (V n a) (V n a) a a #

Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o') o o' 
Instance details

Defined in Control.Lens.Tuple

Methods

_15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o') o o' #

Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p) o o' 
Instance details

Defined in Control.Lens.Tuple

Methods

_15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p) o o' #

Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q) o o' 
Instance details

Defined in Control.Lens.Tuple

Methods

_15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q) o o' #

Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r) o o' 
Instance details

Defined in Control.Lens.Tuple

Methods

_15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r) o o' #

Field15 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r, s) o o' 
Instance details

Defined in Control.Lens.Tuple

Methods

_15 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o', p, q, r, s) o o' #

class Field14 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 14th field of a tuple.

Minimal complete definition

Nothing

Methods

_14 :: Lens s t a b #

Access the 14th field of a tuple.

Instances
14 <= n => Field14 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_14 :: Lens (V n a) (V n a) a a #

Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n') n n' 
Instance details

Defined in Control.Lens.Tuple

Methods

_14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n') n n' #

Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o) n n' 
Instance details

Defined in Control.Lens.Tuple

Methods

_14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o) n n' #

Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p) n n' 
Instance details

Defined in Control.Lens.Tuple

Methods

_14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p) n n' #

Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q) n n' 
Instance details

Defined in Control.Lens.Tuple

Methods

_14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q) n n' #

Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r) n n' 
Instance details

Defined in Control.Lens.Tuple

Methods

_14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r) n n' #

Field14 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r, s) n n' 
Instance details

Defined in Control.Lens.Tuple

Methods

_14 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m, n', o, p, q, r, s) n n' #

class Field13 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 13th field of a tuple.

Minimal complete definition

Nothing

Methods

_13 :: Lens s t a b #

Access the 13th field of a tuple.

Instances
13 <= n => Field13 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_13 :: Lens (V n a) (V n a) a a #

Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l, m') m m' 
Instance details

Defined in Control.Lens.Tuple

Methods

_13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l, m') m m' #

Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n) m m' 
Instance details

Defined in Control.Lens.Tuple

Methods

_13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n) m m' #

Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o) m m' 
Instance details

Defined in Control.Lens.Tuple

Methods

_13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o) m m' #

Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p) m m' 
Instance details

Defined in Control.Lens.Tuple

Methods

_13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p) m m' #

Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q) m m' 
Instance details

Defined in Control.Lens.Tuple

Methods

_13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q) m m' #

Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r) m m' 
Instance details

Defined in Control.Lens.Tuple

Methods

_13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r) m m' #

Field13 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r, s) m m' 
Instance details

Defined in Control.Lens.Tuple

Methods

_13 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l, m', n, o, p, q, r, s) m m' #

class Field12 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 12th field of a tuple.

Minimal complete definition

Nothing

Methods

_12 :: Lens s t a b #

Access the 12th field of a tuple.

Instances
12 <= n => Field12 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_12 :: Lens (V n a) (V n a) a a #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk, l') l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk, l') l l' #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l', m) l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk, l', m) l l' #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n) l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n) l l' #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o) l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o) l l' #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p) l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p) l l' #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q) l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q) l l' #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r) l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r) l l' #

Field12 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r, s) l l' 
Instance details

Defined in Control.Lens.Tuple

Methods

_12 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk, l', m, n, o, p, q, r, s) l l' #

class Field11 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 11th field of a tuple.

Minimal complete definition

Nothing

Methods

_11 :: Lens s t a b #

Access the 11th field of a tuple.

Instances
11 <= n => Field11 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_11 :: Lens (V n a) (V n a) a a #

Field11 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j, kk') kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j, kk') kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk', l) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j, kk', l) kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk', l, m) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j, kk', l, m) kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n) kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o) kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p) kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q) kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r) kk kk' #

Field11 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r, s) kk kk' 
Instance details

Defined in Control.Lens.Tuple

Methods

_11 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j, kk', l, m, n, o, p, q, r, s) kk kk' #

class Field10 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 10th field of a tuple.

Minimal complete definition

Nothing

Methods

_10 :: Lens s t a b #

Access the 10th field of a tuple.

Instances
10 <= n => Field10 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_10 :: Lens (V n a) (V n a) a a #

Field10 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i, j') j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i, j') j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j', kk) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i, j', kk) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j', kk, l) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i, j', kk, l) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j', kk, l, m) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i, j', kk, l, m) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r) j j' #

Field10 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r, s) j j' 
Instance details

Defined in Control.Lens.Tuple

Methods

_10 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i, j', kk, l, m, n, o, p, q, r, s) j j' #

class Field9 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 9th field of a tuple.

Minimal complete definition

Nothing

Methods

_9 :: Lens s t a b #

Access the 9th field of a tuple.

Instances
9 <= n => Field9 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_9 :: Lens (V n a) (V n a) a a #

Field9 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h, i') i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h, i') i i' #

Field9 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i', j) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i', j) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i', j, kk) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h, i', j, kk) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i', j, kk, l) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h, i', j, kk, l) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i', j, kk, l, m) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h, i', j, kk, l, m) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r) i i' #

Field9 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r, s) i i' 
Instance details

Defined in Control.Lens.Tuple

Methods

_9 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h, i', j, kk, l, m, n, o, p, q, r, s) i i' #

class Field8 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provide access to the 8th field of a tuple.

Minimal complete definition

Nothing

Methods

_8 :: Lens s t a b #

Access the 8th field of a tuple.

Instances
8 <= n => Field8 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_8 :: Lens (V n a) (V n a) a a #

Field8 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h') h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h') h h' #

Field8 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h', i) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h', i) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h', i, j) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h', i, j) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h', i, j, kk) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g, h', i, j, kk) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h', i, j, kk, l) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g, h', i, j, kk, l) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h', i, j, kk, l, m) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g, h', i, j, kk, l, m) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r) h h' #

Field8 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r, s) h h' 
Instance details

Defined in Control.Lens.Tuple

Methods

_8 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g, h', i, j, kk, l, m, n, o, p, q, r, s) h h' #

class Field7 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provide access to the 7th field of a tuple.

Minimal complete definition

Nothing

Methods

_7 :: Lens s t a b #

Access the 7th field of a tuple.

Instances
7 <= n => Field7 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_7 :: Lens (V n a) (V n a) a a #

Field7 (a, b, c, d, e, f, g) (a, b, c, d, e, f, g') g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e, f, g') g g' #

Field7 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g', h) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g', h) g g' #

Field7 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g', h, i) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g', h, i) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g', h, i, j) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g', h, i, j) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g', h, i, j, kk) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f, g', h, i, j, kk) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g', h, i, j, kk, l) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f, g', h, i, j, kk, l) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g', h, i, j, kk, l, m) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f, g', h, i, j, kk, l, m) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r) g g' #

Field7 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r, s) g g' 
Instance details

Defined in Control.Lens.Tuple

Methods

_7 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f, g', h, i, j, kk, l, m, n, o, p, q, r, s) g g' #

class Field6 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 6th element of a tuple.

Minimal complete definition

Nothing

Methods

_6 :: Lens s t a b #

Access the 6th field of a tuple.

Instances
Field6 (Plucker a) (Plucker a) a a 
Instance details

Defined in Linear.Plucker

Methods

_6 :: Lens (Plucker a) (Plucker a) a a #

6 <= n => Field6 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_6 :: Lens (V n a) (V n a) a a #

Field6 (a, b, c, d, e, f) (a, b, c, d, e, f') f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f) (a, b, c, d, e, f') f f' #

Field6 (a, b, c, d, e, f, g) (a, b, c, d, e, f', g) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e, f', g) f f' #

Field6 (a, b, c, d, e, f, g, h) (a, b, c, d, e, f', g, h) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e, f', g, h) f f' #

Field6 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f', g, h, i) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f', g, h, i) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f', g, h, i, j) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f', g, h, i, j) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f', g, h, i, j, kk) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e, f', g, h, i, j, kk) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f', g, h, i, j, kk, l) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e, f', g, h, i, j, kk, l) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f', g, h, i, j, kk, l, m) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e, f', g, h, i, j, kk, l, m) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r) f f' #

Field6 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r, s) f f' 
Instance details

Defined in Control.Lens.Tuple

Methods

_6 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e, f', g, h, i, j, kk, l, m, n, o, p, q, r, s) f f' #

class Field5 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 5th field of a tuple.

Minimal complete definition

Nothing

Methods

_5 :: Lens s t a b #

Access the 5th field of a tuple.

Instances
Field5 (Plucker a) (Plucker a) a a 
Instance details

Defined in Linear.Plucker

Methods

_5 :: Lens (Plucker a) (Plucker a) a a #

5 <= n => Field5 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_5 :: Lens (V n a) (V n a) a a #

Field5 (a, b, c, d, e) (a, b, c, d, e') e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e) (a, b, c, d, e') e e' #

Field5 (a, b, c, d, e, f) (a, b, c, d, e', f) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f) (a, b, c, d, e', f) e e' #

Field5 (a, b, c, d, e, f, g) (a, b, c, d, e', f, g) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g) (a, b, c, d, e', f, g) e e' #

Field5 (a, b, c, d, e, f, g, h) (a, b, c, d, e', f, g, h) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d, e', f, g, h) e e' #

Field5 (a, b, c, d, e, f, g, h, i) (a, b, c, d, e', f, g, h, i) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d, e', f, g, h, i) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e', f, g, h, i, j) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e', f, g, h, i, j) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e', f, g, h, i, j, kk) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d, e', f, g, h, i, j, kk) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e', f, g, h, i, j, kk, l) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d, e', f, g, h, i, j, kk, l) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e', f, g, h, i, j, kk, l, m) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d, e', f, g, h, i, j, kk, l, m) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r) e e' #

Field5 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r, s) e e' 
Instance details

Defined in Control.Lens.Tuple

Methods

_5 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d, e', f, g, h, i, j, kk, l, m, n, o, p, q, r, s) e e' #

class Field4 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provide access to the 4th field of a tuple.

Minimal complete definition

Nothing

Methods

_4 :: Lens s t a b #

Access the 4th field of a tuple.

Instances
Field4 (Plucker a) (Plucker a) a a 
Instance details

Defined in Linear.Plucker

Methods

_4 :: Lens (Plucker a) (Plucker a) a a #

Field4 (Quaternion a) (Quaternion a) a a 
Instance details

Defined in Linear.Quaternion

Methods

_4 :: Lens (Quaternion a) (Quaternion a) a a #

Field4 (V4 a) (V4 a) a a 
Instance details

Defined in Linear.V4

Methods

_4 :: Lens (V4 a) (V4 a) a a #

4 <= n => Field4 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_4 :: Lens (V n a) (V n a) a a #

Field4 (a, b, c, d) (a, b, c, d') d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d) (a, b, c, d') d d' #

Field4 (a, b, c, d, e) (a, b, c, d', e) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e) (a, b, c, d', e) d d' #

Field4 (a, b, c, d, e, f) (a, b, c, d', e, f) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f) (a, b, c, d', e, f) d d' #

Field4 (a, b, c, d, e, f, g) (a, b, c, d', e, f, g) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g) (a, b, c, d', e, f, g) d d' #

Field4 (a, b, c, d, e, f, g, h) (a, b, c, d', e, f, g, h) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h) (a, b, c, d', e, f, g, h) d d' #

Field4 (a, b, c, d, e, f, g, h, i) (a, b, c, d', e, f, g, h, i) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c, d', e, f, g, h, i) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j) (a, b, c, d', e, f, g, h, i, j) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c, d', e, f, g, h, i, j) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d', e, f, g, h, i, j, kk) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c, d', e, f, g, h, i, j, kk) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d', e, f, g, h, i, j, kk, l) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c, d', e, f, g, h, i, j, kk, l) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d', e, f, g, h, i, j, kk, l, m) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c, d', e, f, g, h, i, j, kk, l, m) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r) d d' #

Field4 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) d d' 
Instance details

Defined in Control.Lens.Tuple

Methods

_4 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c, d', e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) d d' #

class Field3 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 3rd field of a tuple.

Minimal complete definition

Nothing

Methods

_3 :: Lens s t a b #

Access the 3rd field of a tuple.

Instances
Field3 (V3 a) (V3 a) a a 
Instance details

Defined in Linear.V3

Methods

_3 :: Lens (V3 a) (V3 a) a a #

Field3 (Plucker a) (Plucker a) a a 
Instance details

Defined in Linear.Plucker

Methods

_3 :: Lens (Plucker a) (Plucker a) a a #

Field3 (Quaternion a) (Quaternion a) a a 
Instance details

Defined in Linear.Quaternion

Methods

_3 :: Lens (Quaternion a) (Quaternion a) a a #

Field3 (V4 a) (V4 a) a a 
Instance details

Defined in Linear.V4

Methods

_3 :: Lens (V4 a) (V4 a) a a #

Field3 (a, b, c) (a, b, c') c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c) (a, b, c') c c' #

3 <= n => Field3 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_3 :: Lens (V n a) (V n a) a a #

Field3 (a, b, c, d) (a, b, c', d) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d) (a, b, c', d) c c' #

Field3 (a, b, c, d, e) (a, b, c', d, e) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e) (a, b, c', d, e) c c' #

Field3 (a, b, c, d, e, f) (a, b, c', d, e, f) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f) (a, b, c', d, e, f) c c' #

Field3 (a, b, c, d, e, f, g) (a, b, c', d, e, f, g) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g) (a, b, c', d, e, f, g) c c' #

Field3 (a, b, c, d, e, f, g, h) (a, b, c', d, e, f, g, h) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h) (a, b, c', d, e, f, g, h) c c' #

Field3 (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i) (a, b, c', d, e, f, g, h, i) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j) (a, b, c', d, e, f, g, h, i, j) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b, c', d, e, f, g, h, i, j) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c', d, e, f, g, h, i, j, kk) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b, c', d, e, f, g, h, i, j, kk) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c', d, e, f, g, h, i, j, kk, l) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b, c', d, e, f, g, h, i, j, kk, l) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c', d, e, f, g, h, i, j, kk, l, m) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b, c', d, e, f, g, h, i, j, kk, l, m) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) c c' #

Field3 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) c c' 
Instance details

Defined in Control.Lens.Tuple

Methods

_3 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b, c', d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) c c' #

class Field2 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to the 2nd field of a tuple.

Minimal complete definition

Nothing

Methods

_2 :: Lens s t a b #

Access the 2nd field of a tuple.

>>> _2 .~ "hello" $ (1,(),3,4)
(1,"hello",3,4)
>>> (1,2,3,4) & _2 *~ 3
(1,6,3,4)
>>> _2 print (1,2)
2
(1,())
anyOf _2 :: (s -> Bool) -> (a, s) -> Bool
traverse . _2 :: (Applicative f, Traversable t) => (a -> f b) -> t (s, a) -> f (t (s, b))
foldMapOf (traverse . _2) :: (Traversable t, Monoid m) => (s -> m) -> t (b, s) -> m
Instances
Field2 (V2 a) (V2 a) a a 
Instance details

Defined in Linear.V2

Methods

_2 :: Lens (V2 a) (V2 a) a a #

Field2 (V3 a) (V3 a) a a 
Instance details

Defined in Linear.V3

Methods

_2 :: Lens (V3 a) (V3 a) a a #

Field2 (Plucker a) (Plucker a) a a 
Instance details

Defined in Linear.Plucker

Methods

_2 :: Lens (Plucker a) (Plucker a) a a #

Field2 (Quaternion a) (Quaternion a) a a 
Instance details

Defined in Linear.Quaternion

Methods

_2 :: Lens (Quaternion a) (Quaternion a) a a #

Field2 (V4 a) (V4 a) a a 
Instance details

Defined in Linear.V4

Methods

_2 :: Lens (V4 a) (V4 a) a a #

Field2 (a, b) (a, b') b b'
_2 k ~(a,b) = (\b' -> (a,b')) <$> k b
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b) (a, b') b b' #

Field2 (a, b, c) (a, b', c) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c) (a, b', c) b b' #

2 <= n => Field2 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_2 :: Lens (V n a) (V n a) a a #

Field2 (a, b, c, d) (a, b', c, d) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d) (a, b', c, d) b b' #

Field2 ((f :*: g) p) ((f :*: g') p) (g p) (g' p) 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens ((f :*: g) p) ((f :*: g') p) (g p) (g' p) #

Field2 (Product f g a) (Product f g' a) (g a) (g' a) 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (Product f g a) (Product f g' a) (g a) (g' a) #

Field2 (a, b, c, d, e) (a, b', c, d, e) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e) (a, b', c, d, e) b b' #

Field2 (a, b, c, d, e, f) (a, b', c, d, e, f) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f) (a, b', c, d, e, f) b b' #

Field2 (a, b, c, d, e, f, g) (a, b', c, d, e, f, g) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g) (a, b', c, d, e, f, g) b b' #

Field2 (a, b, c, d, e, f, g, h) (a, b', c, d, e, f, g, h) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h) (a, b', c, d, e, f, g, h) b b' #

Field2 (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i) (a, b', c, d, e, f, g, h, i) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j) (a, b', c, d, e, f, g, h, i, j) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j) (a, b', c, d, e, f, g, h, i, j) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk) (a, b', c, d, e, f, g, h, i, j, kk) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a, b', c, d, e, f, g, h, i, j, kk) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b', c, d, e, f, g, h, i, j, kk, l) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a, b', c, d, e, f, g, h, i, j, kk, l) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b', c, d, e, f, g, h, i, j, kk, l, m) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a, b', c, d, e, f, g, h, i, j, kk, l, m) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) b b' #

Field2 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) b b' 
Instance details

Defined in Control.Lens.Tuple

Methods

_2 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a, b', c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) b b' #

class Field1 s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Provides access to 1st field of a tuple.

Minimal complete definition

Nothing

Methods

_1 :: Lens s t a b #

Access the 1st field of a tuple (and possibly change its type).

>>> (1,2)^._1
1
>>> _1 .~ "hello" $ (1,2)
("hello",2)
>>> (1,2) & _1 .~ "hello"
("hello",2)
>>> _1 putStrLn ("hello","world")
hello
((),"world")

This can also be used on larger tuples as well:

>>> (1,2,3,4,5) & _1 +~ 41
(42,2,3,4,5)
_1 :: Lens (a,b) (a',b) a a'
_1 :: Lens (a,b,c) (a',b,c) a a'
_1 :: Lens (a,b,c,d) (a',b,c,d) a a'
...
_1 :: Lens (a,b,c,d,e,f,g,h,i) (a',b,c,d,e,f,g,h,i) a a'
Instances
Field1 (Identity a) (Identity b) a b 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (Identity a) (Identity b) a b #

Field1 (V2 a) (V2 a) a a 
Instance details

Defined in Linear.V2

Methods

_1 :: Lens (V2 a) (V2 a) a a #

Field1 (V3 a) (V3 a) a a 
Instance details

Defined in Linear.V3

Methods

_1 :: Lens (V3 a) (V3 a) a a #

Field1 (Plucker a) (Plucker a) a a 
Instance details

Defined in Linear.Plucker

Methods

_1 :: Lens (Plucker a) (Plucker a) a a #

Field1 (Quaternion a) (Quaternion a) a a 
Instance details

Defined in Linear.Quaternion

Methods

_1 :: Lens (Quaternion a) (Quaternion a) a a #

Field1 (V4 a) (V4 a) a a 
Instance details

Defined in Linear.V4

Methods

_1 :: Lens (V4 a) (V4 a) a a #

Field1 (V1 a) (V1 b) a b 
Instance details

Defined in Linear.V1

Methods

_1 :: Lens (V1 a) (V1 b) a b #

Field1 (a, b) (a', b) a a'
_1 k ~(a,b) = (\a' -> (a',b)) <$> k a
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b) (a', b) a a' #

Field1 (a, b, c) (a', b, c) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c) (a', b, c) a a' #

1 <= n => Field1 (V n a) (V n a) a a 
Instance details

Defined in Linear.V

Methods

_1 :: Lens (V n a) (V n a) a a #

Field1 (a, b, c, d) (a', b, c, d) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d) (a', b, c, d) a a' #

Field1 ((f :*: g) p) ((f' :*: g) p) (f p) (f' p) 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens ((f :*: g) p) ((f' :*: g) p) (f p) (f' p) #

Field1 (Product f g a) (Product f' g a) (f a) (f' a) 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (Product f g a) (Product f' g a) (f a) (f' a) #

Field1 (a, b, c, d, e) (a', b, c, d, e) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e) (a', b, c, d, e) a a' #

Field1 (a, b, c, d, e, f) (a', b, c, d, e, f) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f) (a', b, c, d, e, f) a a' #

Field1 (a, b, c, d, e, f, g) (a', b, c, d, e, f, g) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g) (a', b, c, d, e, f, g) a a' #

Field1 (a, b, c, d, e, f, g, h) (a', b, c, d, e, f, g, h) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h) (a', b, c, d, e, f, g, h) a a' #

Field1 (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i) (a', b, c, d, e, f, g, h, i) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j) (a', b, c, d, e, f, g, h, i, j) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j) (a', b, c, d, e, f, g, h, i, j) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk) (a', b, c, d, e, f, g, h, i, j, kk) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk) (a', b, c, d, e, f, g, h, i, j, kk) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l) (a', b, c, d, e, f, g, h, i, j, kk, l) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l) (a', b, c, d, e, f, g, h, i, j, kk, l) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a', b, c, d, e, f, g, h, i, j, kk, l, m) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m) (a', b, c, d, e, f, g, h, i, j, kk, l, m) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r) a a' #

Field1 (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) a a' 
Instance details

Defined in Control.Lens.Tuple

Methods

_1 :: Lens (a, b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) (a', b, c, d, e, f, g, h, i, j, kk, l, m, n, o, p, q, r, s) a a' #

_1' :: Field1 s t a b => Lens s t a b #

Strict version of _1

_2' :: Field2 s t a b => Lens s t a b #

Strict version of _2

_3' :: Field3 s t a b => Lens s t a b #

Strict version of _3

_4' :: Field4 s t a b => Lens s t a b #

Strict version of _4

_5' :: Field5 s t a b => Lens s t a b #

Strict version of _5

_6' :: Field6 s t a b => Lens s t a b #

Strict version of _6

_7' :: Field7 s t a b => Lens s t a b #

Strict version of _7

_8' :: Field8 s t a b => Lens s t a b #

Strict version of _8

_9' :: Field9 s t a b => Lens s t a b #

Strict version of _9

_10' :: Field10 s t a b => Lens s t a b #

Strict version of _10

_11' :: Field11 s t a b => Lens s t a b #

Strict version of _11

_12' :: Field12 s t a b => Lens s t a b #

Strict version of _12

_13' :: Field13 s t a b => Lens s t a b #

Strict version of _13

_14' :: Field14 s t a b => Lens s t a b #

Strict version of _14

_15' :: Field15 s t a b => Lens s t a b #

Strict version of _15

_16' :: Field16 s t a b => Lens s t a b #

Strict version of _16

_17' :: Field17 s t a b => Lens s t a b #

Strict version of _17

_18' :: Field18 s t a b => Lens s t a b #

Strict version of _18

_19' :: Field19 s t a b => Lens s t a b #

Strict version of _19

type Accessing (p :: Type -> Type -> Type) m s a = p a (Const m a) -> s -> Const m s #

This is a convenient alias used when consuming (indexed) getters and (indexed) folds in a highly general fashion.

type IndexedGetting i m s a = Indexed i a (Const m a) -> s -> Const m s #

Used to consume an IndexedFold.

type Getting r s a = (a -> Const r a) -> s -> Const r s #

When you see this in a type signature it indicates that you can pass the function a Lens, Getter, Traversal, Fold, Prism, Iso, or one of the indexed variants, and it will just "do the right thing".

Most Getter combinators are able to be used with both a Getter or a Fold in limited situations, to do so, they need to be monomorphic in what we are going to extract with Const. To be compatible with Lens, Traversal and Iso we also restricted choices of the irrelevant t and b parameters.

If a function accepts a Getting r s a, then when r is a Monoid, then you can pass a Fold (or Traversal), otherwise you can only pass this a Getter or Lens.

to :: (Profunctor p, Contravariant f) => (s -> a) -> Optic' p f s a #

Build an (index-preserving) Getter from an arbitrary Haskell function.

to f . to g ≡ to (g . f)
a ^. to f ≡ f a
>>> a ^.to f
f a
>>> ("hello","world")^.to snd
"world"
>>> 5^.to succ
6
>>> (0, -5)^._2.to abs
5
to :: (s -> a) -> IndexPreservingGetter s a

ito :: (Indexable i p, Contravariant f) => (s -> (i, a)) -> Over' p f s a #

ito :: (s -> (i, a)) -> IndexedGetter i s a

like :: (Profunctor p, Contravariant f, Functor f) => a -> Optic' p f s a #

Build an constant-valued (index-preserving) Getter from an arbitrary Haskell value.

like a . like b ≡ like b
a ^. like b ≡ b
a ^. like b ≡ a ^. to (const b)

This can be useful as a second case failing a Fold e.g. foo failing like 0

like :: a -> IndexPreservingGetter s a

ilike :: (Indexable i p, Contravariant f, Functor f) => i -> a -> Over' p f s a #

ilike :: i -> a -> IndexedGetter i s a

view :: MonadReader s m => Getting a s a -> m a #

View the value pointed to by a Getter, Iso or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal value.

view . toid
>>> view (to f) a
f a
>>> view _2 (1,"hello")
"hello"
>>> view (to succ) 5
6
>>> view (_2._1) ("hello",("world","!!!"))
"world"

As view is commonly used to access the target of a Getter or obtain a monoidal summary of the targets of a Fold, It may be useful to think of it as having one of these more restricted signatures:

view ::             Getter s a     -> s -> a
view :: Monoid m => Fold s m       -> s -> m
view ::             Iso' s a       -> s -> a
view ::             Lens' s a      -> s -> a
view :: Monoid m => Traversal' s m -> s -> m

In a more general setting, such as when working with a Monad transformer stack you can use:

view :: MonadReader s m             => Getter s a     -> m a
view :: (MonadReader s m, Monoid a) => Fold s a       -> m a
view :: MonadReader s m             => Iso' s a       -> m a
view :: MonadReader s m             => Lens' s a      -> m a
view :: (MonadReader s m, Monoid a) => Traversal' s a -> m a

views :: MonadReader s m => LensLike' (Const r :: Type -> Type) s a -> (a -> r) -> m r #

View a function of the value pointed to by a Getter or Lens or the result of folding over the result of mapping the targets of a Fold or Traversal.

views l f ≡ view (l . to f)
>>> views (to f) g a
g (f a)
>>> views _2 length (1,"hello")
5

As views is commonly used to access the target of a Getter or obtain a monoidal summary of the targets of a Fold, It may be useful to think of it as having one of these more restricted signatures:

views ::             Getter s a     -> (a -> r) -> s -> r
views :: Monoid m => Fold s a       -> (a -> m) -> s -> m
views ::             Iso' s a       -> (a -> r) -> s -> r
views ::             Lens' s a      -> (a -> r) -> s -> r
views :: Monoid m => Traversal' s a -> (a -> m) -> s -> m

In a more general setting, such as when working with a Monad transformer stack you can use:

views :: MonadReader s m             => Getter s a     -> (a -> r) -> m r
views :: (MonadReader s m, Monoid r) => Fold s a       -> (a -> r) -> m r
views :: MonadReader s m             => Iso' s a       -> (a -> r) -> m r
views :: MonadReader s m             => Lens' s a      -> (a -> r) -> m r
views :: (MonadReader s m, Monoid r) => Traversal' s a -> (a -> r) -> m r
views :: MonadReader s m => Getting r s a -> (a -> r) -> m r

(^.) :: s -> Getting a s a -> a infixl 8 #

View the value pointed to by a Getter or Lens or the result of folding over all the results of a Fold or Traversal that points at a monoidal values.

This is the same operation as view with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with (.).

>>> (a,b)^._2
b
>>> ("hello","world")^._2
"world"
>>> import Data.Complex
>>> ((0, 1 :+ 2), 3)^._1._2.to magnitude
2.23606797749979
(^.) ::             s -> Getter s a     -> a
(^.) :: Monoid m => s -> Fold s m       -> m
(^.) ::             s -> Iso' s a       -> a
(^.) ::             s -> Lens' s a      -> a
(^.) :: Monoid m => s -> Traversal' s m -> m

use :: MonadState s m => Getting a s a -> m a #

Use the target of a Lens, Iso, or Getter in the current state, or use a summary of a Fold or Traversal that points to a monoidal value.

>>> evalState (use _1) (a,b)
a
>>> evalState (use _1) ("hello","world")
"hello"
use :: MonadState s m             => Getter s a     -> m a
use :: (MonadState s m, Monoid r) => Fold s r       -> m r
use :: MonadState s m             => Iso' s a       -> m a
use :: MonadState s m             => Lens' s a      -> m a
use :: (MonadState s m, Monoid r) => Traversal' s r -> m r

uses :: MonadState s m => LensLike' (Const r :: Type -> Type) s a -> (a -> r) -> m r #

Use the target of a Lens, Iso or Getter in the current state, or use a summary of a Fold or Traversal that points to a monoidal value.

>>> evalState (uses _1 length) ("hello","world")
5
uses :: MonadState s m             => Getter s a     -> (a -> r) -> m r
uses :: (MonadState s m, Monoid r) => Fold s a       -> (a -> r) -> m r
uses :: MonadState s m             => Lens' s a      -> (a -> r) -> m r
uses :: MonadState s m             => Iso' s a       -> (a -> r) -> m r
uses :: (MonadState s m, Monoid r) => Traversal' s a -> (a -> r) -> m r
uses :: MonadState s m => Getting r s t a b -> (a -> r) -> m r

listening :: MonadWriter w m => Getting u w u -> m a -> m (a, u) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

listening :: MonadWriter w m             => Getter w u     -> m a -> m (a, u)
listening :: MonadWriter w m             => Lens' w u      -> m a -> m (a, u)
listening :: MonadWriter w m             => Iso' w u       -> m a -> m (a, u)
listening :: (MonadWriter w m, Monoid u) => Fold w u       -> m a -> m (a, u)
listening :: (MonadWriter w m, Monoid u) => Traversal' w u -> m a -> m (a, u)
listening :: (MonadWriter w m, Monoid u) => Prism' w u     -> m a -> m (a, u)

ilistening :: MonadWriter w m => IndexedGetting i (i, u) w u -> m a -> m (a, (i, u)) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

ilistening :: MonadWriter w m             => IndexedGetter i w u     -> m a -> m (a, (i, u))
ilistening :: MonadWriter w m             => IndexedLens' i w u      -> m a -> m (a, (i, u))
ilistening :: (MonadWriter w m, Monoid u) => IndexedFold i w u       -> m a -> m (a, (i, u))
ilistening :: (MonadWriter w m, Monoid u) => IndexedTraversal' i w u -> m a -> m (a, (i, u))

listenings :: MonadWriter w m => Getting v w u -> (u -> v) -> m a -> m (a, v) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

listenings :: MonadWriter w m             => Getter w u     -> (u -> v) -> m a -> m (a, v)
listenings :: MonadWriter w m             => Lens' w u      -> (u -> v) -> m a -> m (a, v)
listenings :: MonadWriter w m             => Iso' w u       -> (u -> v) -> m a -> m (a, v)
listenings :: (MonadWriter w m, Monoid v) => Fold w u       -> (u -> v) -> m a -> m (a, v)
listenings :: (MonadWriter w m, Monoid v) => Traversal' w u -> (u -> v) -> m a -> m (a, v)
listenings :: (MonadWriter w m, Monoid v) => Prism' w u     -> (u -> v) -> m a -> m (a, v)

ilistenings :: MonadWriter w m => IndexedGetting i v w u -> (i -> u -> v) -> m a -> m (a, v) #

This is a generalized form of listen that only extracts the portion of the log that is focused on by a Getter. If given a Fold or a Traversal then a monoidal summary of the parts of the log that are visited will be returned.

ilistenings :: MonadWriter w m             => IndexedGetter w u     -> (i -> u -> v) -> m a -> m (a, v)
ilistenings :: MonadWriter w m             => IndexedLens' w u      -> (i -> u -> v) -> m a -> m (a, v)
ilistenings :: (MonadWriter w m, Monoid v) => IndexedFold w u       -> (i -> u -> v) -> m a -> m (a, v)
ilistenings :: (MonadWriter w m, Monoid v) => IndexedTraversal' w u -> (i -> u -> v) -> m a -> m (a, v)

iview :: MonadReader s m => IndexedGetting i (i, a) s a -> m (i, a) #

View the index and value of an IndexedGetter into the current environment as a pair.

When applied to an IndexedFold the result will most likely be a nonsensical monoidal summary of the indices tupled with a monoidal summary of the values and probably not whatever it is you wanted.

iviews :: MonadReader s m => IndexedGetting i r s a -> (i -> a -> r) -> m r #

View a function of the index and value of an IndexedGetter into the current environment.

When applied to an IndexedFold the result will be a monoidal summary instead of a single answer.

iviewsifoldMapOf

iuse :: MonadState s m => IndexedGetting i (i, a) s a -> m (i, a) #

Use the index and value of an IndexedGetter into the current state as a pair.

When applied to an IndexedFold the result will most likely be a nonsensical monoidal summary of the indices tupled with a monoidal summary of the values and probably not whatever it is you wanted.

iuses :: MonadState s m => IndexedGetting i r s a -> (i -> a -> r) -> m r #

Use a function of the index and value of an IndexedGetter into the current state.

When applied to an IndexedFold the result will be a monoidal summary instead of a single answer.

(^@.) :: s -> IndexedGetting i (i, a) s a -> (i, a) infixl 8 #

View the index and value of an IndexedGetter or IndexedLens.

This is the same operation as iview with the arguments flipped.

The fixity and semantics are such that subsequent field accesses can be performed with (.).

(^@.) :: s -> IndexedGetter i s a -> (i, a)
(^@.) :: s -> IndexedLens' i s a  -> (i, a)

The result probably doesn't have much meaning when applied to an IndexedFold.

getting :: (Profunctor p, Profunctor q, Functor f, Contravariant f) => Optical p q f s t a b -> Optical' p q f s a #

Coerce a Getter-compatible Optical to an Optical'. This is useful when using a Traversal that is not simple as a Getter or a Fold.

getting :: Traversal s t a b          -> Fold s a
getting :: Lens s t a b               -> Getter s a
getting :: IndexedTraversal i s t a b -> IndexedFold i s a
getting :: IndexedLens i s t a b      -> IndexedGetter i s a

unto :: (Profunctor p, Bifunctor p, Functor f) => (b -> t) -> Optic p f s t a b #

An analogue of to for review.

unto :: (b -> t) -> Review' t b
unto = un . to

un :: (Profunctor p, Bifunctor p, Functor f) => Getting a s a -> Optic' p f a s #

Turn a Getter around to get a Review

un = unto . view
unto = un . to
>>> un (to length) # [1,2,3]
3

re :: AReview t b -> Getter b t #

Turn a Prism or Iso around to build a Getter.

If you have an Iso, from is a more powerful version of this function that will return an Iso instead of a mere Getter.

>>> 5 ^.re _Left
Left 5
>>> 6 ^.re (_Left.unto succ)
Left 7
reviewview  . re
reviewsviews . re
reuseuse   . re
reusesuses  . re
re :: Prism s t a b -> Getter b t
re :: Iso s t a b   -> Getter b t

review :: MonadReader b m => AReview t b -> m t #

This can be used to turn an Iso or Prism around and view a value (or the current environment) through it the other way.

reviewview . re
review . untoid
>>> review _Left "mustard"
Left "mustard"
>>> review (unto succ) 5
6

Usually review is used in the (->) Monad with a Prism or Iso, in which case it may be useful to think of it as having one of these more restricted type signatures:

review :: Iso' s a   -> a -> s
review :: Prism' s a -> a -> s

However, when working with a Monad transformer stack, it is sometimes useful to be able to review the current environment, in which case it may be beneficial to think of it as having one of these slightly more liberal type signatures:

review :: MonadReader a m => Iso' s a   -> m s
review :: MonadReader a m => Prism' s a -> m s

reviews :: MonadReader b m => AReview t b -> (t -> r) -> m r #

This can be used to turn an Iso or Prism around and view a value (or the current environment) through it the other way, applying a function.

reviewsviews . re
reviews (unto f) g ≡ g . f
>>> reviews _Left isRight "mustard"
False
>>> reviews (unto succ) (*2) 3
8

Usually this function is used in the (->) Monad with a Prism or Iso, in which case it may be useful to think of it as having one of these more restricted type signatures:

reviews :: Iso' s a   -> (s -> r) -> a -> r
reviews :: Prism' s a -> (s -> r) -> a -> r

However, when working with a Monad transformer stack, it is sometimes useful to be able to review the current environment, in which case it may be beneficial to think of it as having one of these slightly more liberal type signatures:

reviews :: MonadReader a m => Iso' s a   -> (s -> r) -> m r
reviews :: MonadReader a m => Prism' s a -> (s -> r) -> m r

reuse :: MonadState b m => AReview t b -> m t #

This can be used to turn an Iso or Prism around and use a value (or the current environment) through it the other way.

reuseuse . re
reuse . untogets
>>> evalState (reuse _Left) 5
Left 5
>>> evalState (reuse (unto succ)) 5
6
reuse :: MonadState a m => Prism' s a -> m s
reuse :: MonadState a m => Iso' s a   -> m s

reuses :: MonadState b m => AReview t b -> (t -> r) -> m r #

This can be used to turn an Iso or Prism around and use the current state through it the other way, applying a function.

reusesuses . re
reuses (unto f) g ≡ gets (g . f)
>>> evalState (reuses _Left isLeft) (5 :: Int)
True
reuses :: MonadState a m => Prism' s a -> (s -> r) -> m r
reuses :: MonadState a m => Iso' s a   -> (s -> r) -> m r

type APrism' s a = APrism s s a a #

type APrism' = Simple APrism

type APrism s t a b = Market a b a (Identity b) -> Market a b s (Identity t) #

If you see this in a signature for a function, the function is expecting a Prism.

withPrism :: APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r #

Convert APrism to the pair of functions that characterize it.

clonePrism :: APrism s t a b -> Prism s t a b #

Clone a Prism so that you can reuse the same monomorphically typed Prism for different purposes.

See cloneLens and cloneTraversal for examples of why you might want to do this.

prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b #

Build a Prism.

Either t a is used instead of Maybe a to permit the types of s and t to differ.

prism' :: (b -> s) -> (s -> Maybe a) -> Prism s s a b #

This is usually used to build a Prism', when you have to use an operation like cast which already returns a Maybe.

without :: APrism s t a b -> APrism u v c d -> Prism (Either s u) (Either t v) (Either a c) (Either b d) #

Given a pair of prisms, project sums.

Viewing a Prism as a co-Lens, this combinator can be seen to be dual to alongside.

aside :: APrism s t a b -> Prism (e, s) (e, t) (e, a) (e, b) #

Use a Prism to work over part of a structure.

below :: Traversable f => APrism' s a -> Prism' (f s) (f a) #

lift a Prism through a Traversable functor, giving a Prism that matches only if all the elements of the container match the Prism.

>>> [Left 1, Right "foo", Left 4, Right "woot"]^..below _Right
[]
>>> [Right "hail hydra!", Right "foo", Right "blah", Right "woot"]^..below _Right
[["hail hydra!","foo","blah","woot"]]

isn't :: APrism s t a b -> s -> Bool #

Check to see if this Prism doesn't match.

>>> isn't _Left (Right 12)
True
>>> isn't _Left (Left 12)
False
>>> isn't _Empty []
False

matching :: APrism s t a b -> s -> Either t a #

Retrieve the value targeted by a Prism or return the original value while allowing the type to change if it does not match.

>>> matching _Just (Just 12)
Right 12
>>> matching _Just (Nothing :: Maybe Int) :: Either (Maybe Bool) Int
Left Nothing

_Left :: Prism (Either a c) (Either b c) a b #

This Prism provides a Traversal for tweaking the Left half of an Either:

>>> over _Left (+1) (Left 2)
Left 3
>>> over _Left (+1) (Right 2)
Right 2
>>> Right 42 ^._Left :: String
""
>>> Left "hello" ^._Left
"hello"

It also can be turned around to obtain the embedding into the Left half of an Either:

>>> _Left # 5
Left 5
>>> 5^.re _Left
Left 5

_Right :: Prism (Either c a) (Either c b) a b #

This Prism provides a Traversal for tweaking the Right half of an Either:

>>> over _Right (+1) (Left 2)
Left 2
>>> over _Right (+1) (Right 2)
Right 3
>>> Right "hello" ^._Right
"hello"
>>> Left "hello" ^._Right :: [Double]
[]

It also can be turned around to obtain the embedding into the Right half of an Either:

>>> _Right # 5
Right 5
>>> 5^.re _Right
Right 5

_Just :: Prism (Maybe a) (Maybe b) a b #

This Prism provides a Traversal for tweaking the target of the value of Just in a Maybe.

>>> over _Just (+1) (Just 2)
Just 3

Unlike traverse this is a Prism, and so you can use it to inject as well:

>>> _Just # 5
Just 5
>>> 5^.re _Just
Just 5

Interestingly,

m ^? _Just ≡ m
>>> Just x ^? _Just
Just x
>>> Nothing ^? _Just
Nothing

_Nothing :: Prism' (Maybe a) () #

This Prism provides the Traversal of a Nothing in a Maybe.

>>> Nothing ^? _Nothing
Just ()
>>> Just () ^? _Nothing
Nothing

But you can turn it around and use it to construct Nothing as well:

>>> _Nothing # ()
Nothing

_Void :: Prism s s a Void #

Void is a logically uninhabited data type.

This is a Prism that will always fail to match.

only :: Eq a => a -> Prism' a () #

This Prism compares for exact equality with a given value.

>>> only 4 # ()
4
>>> 5 ^? only 4
Nothing

nearly :: a -> (a -> Bool) -> Prism' a () #

This Prism compares for approximate equality with a given value and a predicate for testing, an example where the value is the empty list and the predicate checks that a list is empty (same as _Empty with the AsEmpty list instance):

>>> nearly [] null # ()
[]
>>> [1,2,3,4] ^? nearly [] null
Nothing
nearly [] null :: Prism' [a] ()

To comply with the Prism laws the arguments you supply to nearly a p are somewhat constrained.

We assume p x holds iff x ≡ a. Under that assumption then this is a valid Prism.

This is useful when working with a type where you can test equality for only a subset of its values, and the prism selects such a value.

_Show :: (Read a, Show a) => Prism' String a #

This is an improper prism for text formatting based on Read and Show.

This Prism is "improper" in the sense that it normalizes the text formatting, but round tripping is idempotent given sane 'Read'/'Show' instances.

>>> _Show # 2
"2"
>>> "EQ" ^? _Show :: Maybe Ordering
Just EQ
_Showprism' show readMaybe

folding :: Foldable f => (s -> f a) -> Fold s a #

Obtain a Fold by lifting an operation that returns a Foldable result.

This can be useful to lift operations from Data.List and elsewhere into a Fold.

>>> [1,2,3,4]^..folding tail
[2,3,4]

ifolding :: (Foldable f, Indexable i p, Contravariant g, Applicative g) => (s -> f (i, a)) -> Over p g s t a b #

foldring :: (Contravariant f, Applicative f) => ((a -> f a -> f a) -> f a -> s -> f a) -> LensLike f s t a b #

Obtain a Fold by lifting foldr like function.

>>> [1,2,3,4]^..foldring foldr
[1,2,3,4]

ifoldring :: (Indexable i p, Contravariant f, Applicative f) => ((i -> a -> f a -> f a) -> f a -> s -> f a) -> Over p f s t a b #

Obtain FoldWithIndex by lifting ifoldr like function.

folded :: Foldable f => IndexedFold Int (f a) a #

Obtain a Fold from any Foldable indexed by ordinal position.

>>> Just 3^..folded
[3]
>>> Nothing^..folded
[]
>>> [(1,2),(3,4)]^..folded.both
[1,2,3,4]

folded64 :: Foldable f => IndexedFold Int64 (f a) a #

Obtain a Fold from any Foldable indexed by ordinal position.

repeated :: Apply f => LensLike' f a a #

Form a Fold1 by repeating the input forever.

repeattoListOf repeated
>>> timingOut $ 5^..taking 20 repeated
[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]
repeated :: Fold1 a a

replicated :: Int -> Fold a a #

A Fold that replicates its input n times.

replicate n ≡ toListOf (replicated n)
>>> 5^..replicated 20
[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]

cycled :: Apply f => LensLike f s t a b -> LensLike f s t a b #

Transform a non-empty Fold into a Fold1 that loops over its elements over and over.

>>> timingOut $ [1,2,3]^..taking 7 (cycled traverse)
[1,2,3,1,2,3,1]
cycled :: Fold1 s a -> Fold1 s a

unfolded :: (b -> Maybe (a, b)) -> Fold b a #

Build a Fold that unfolds its values from a seed.

unfoldrtoListOf . unfolded
>>> 10^..unfolded (\b -> if b == 0 then Nothing else Just (b, b-1))
[10,9,8,7,6,5,4,3,2,1]

iterated :: Apply f => (a -> a) -> LensLike' f a a #

x ^. iterated f returns an infinite Fold1 of repeated applications of f to x.

toListOf (iterated f) a ≡ iterate f a
iterated :: (a -> a) -> Fold1 a a

filtered :: (Choice p, Applicative f) => (a -> Bool) -> Optic' p f a a #

Obtain a Fold that can be composed with to filter another Lens, Iso, Getter, Fold (or Traversal).

Note: This is not a legal Traversal, unless you are very careful not to invalidate the predicate on the target.

Note: This is also not a legal Prism, unless you are very careful not to inject a value that matches the predicate.

As a counter example, consider that given evens = filtered even the second Traversal law is violated:

over evens succ . over evens succ /= over evens (succ . succ)

So, in order for this to qualify as a legal Traversal you can only use it for actions that preserve the result of the predicate!

>>> [1..10]^..folded.filtered even
[2,4,6,8,10]

This will preserve an index if it is present.

takingWhile :: (Conjoined p, Applicative f) => (a -> Bool) -> Over p (TakingWhile p f a a) s t a a -> Over p f s t a a #

Obtain a Fold by taking elements from another Fold, Lens, Iso, Getter or Traversal while a predicate holds.

takeWhile p ≡ toListOf (takingWhile p folded)
>>> timingOut $ toListOf (takingWhile (<=3) folded) [1..]
[1,2,3]
takingWhile :: (a -> Bool) -> Fold s a                         -> Fold s a
takingWhile :: (a -> Bool) -> Getter s a                       -> Fold s a
takingWhile :: (a -> Bool) -> Traversal' s a                   -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> Lens' s a                        -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> Prism' s a                       -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> Iso' s a                         -> Fold s a -- * See note below
takingWhile :: (a -> Bool) -> IndexedTraversal' i s a          -> IndexedFold i s a -- * See note below
takingWhile :: (a -> Bool) -> IndexedLens' i s a               -> IndexedFold i s a -- * See note below
takingWhile :: (a -> Bool) -> IndexedFold i s a                -> IndexedFold i s a
takingWhile :: (a -> Bool) -> IndexedGetter i s a              -> IndexedFold i s a

Note: When applied to a Traversal, takingWhile yields something that can be used as if it were a Traversal, but which is not a Traversal per the laws, unless you are careful to ensure that you do not invalidate the predicate when writing back through it.

droppingWhile :: (Conjoined p, Profunctor q, Applicative f) => (a -> Bool) -> Optical p q (Compose (State Bool) f) s t a a -> Optical p q f s t a a #

Obtain a Fold by dropping elements from another Fold, Lens, Iso, Getter or Traversal while a predicate holds.

dropWhile p ≡ toListOf (droppingWhile p folded)
>>> toListOf (droppingWhile (<=3) folded) [1..6]
[4,5,6]
>>> toListOf (droppingWhile (<=3) folded) [1,6,1]
[6,1]
droppingWhile :: (a -> Bool) -> Fold s a                         -> Fold s a
droppingWhile :: (a -> Bool) -> Getter s a                       -> Fold s a
droppingWhile :: (a -> Bool) -> Traversal' s a                   -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> Lens' s a                        -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> Prism' s a                       -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> Iso' s a                         -> Fold s a                -- see notes
droppingWhile :: (a -> Bool) -> IndexPreservingTraversal' s a    -> IndexPreservingFold s a -- see notes
droppingWhile :: (a -> Bool) -> IndexPreservingLens' s a         -> IndexPreservingFold s a -- see notes
droppingWhile :: (a -> Bool) -> IndexPreservingGetter s a        -> IndexPreservingFold s a
droppingWhile :: (a -> Bool) -> IndexPreservingFold s a          -> IndexPreservingFold s a
droppingWhile :: (a -> Bool) -> IndexedTraversal' i s a          -> IndexedFold i s a       -- see notes
droppingWhile :: (a -> Bool) -> IndexedLens' i s a               -> IndexedFold i s a       -- see notes
droppingWhile :: (a -> Bool) -> IndexedGetter i s a              -> IndexedFold i s a
droppingWhile :: (a -> Bool) -> IndexedFold i s a                -> IndexedFold i s a

Note: Many uses of this combinator will yield something that meets the types, but not the laws of a valid Traversal or IndexedTraversal. The Traversal and IndexedTraversal laws are only satisfied if the new values you assign to the first target also does not pass the predicate! Otherwise subsequent traversals will visit fewer elements and Traversal fusion is not sound.

So for any traversal t and predicate p, droppingWhile p t may not be lawful, but (dropping 1 . droppingWhile p) t is. For example:

>>> let l  :: Traversal' [Int] Int; l  = droppingWhile (<= 1) traverse
>>> let l' :: Traversal' [Int] Int; l' = dropping 1 l

l is not a lawful setter because over l f . over l g ≢ over l (f . g):

>>> [1,2,3] & l .~ 0 & l .~ 4
[1,0,0]
>>> [1,2,3] & l .~ 4
[1,4,4]

l' on the other hand behaves lawfully:

>>> [1,2,3] & l' .~ 0 & l' .~ 4
[1,2,4]
>>> [1,2,3] & l' .~ 4
[1,2,4]

worded :: Applicative f => IndexedLensLike' Int f String String #

A Fold over the individual words of a String.

worded :: Fold String String
worded :: Traversal' String String
worded :: IndexedFold Int String String
worded :: IndexedTraversal' Int String String

Note: This function type-checks as a Traversal but it doesn't satisfy the laws. It's only valid to use it when you don't insert any whitespace characters while traversing, and if your original String contains only isolated space characters (and no other characters that count as space, such as non-breaking spaces).

lined :: Applicative f => IndexedLensLike' Int f String String #

A Fold over the individual lines of a String.

lined :: Fold String String
lined :: Traversal' String String
lined :: IndexedFold Int String String
lined :: IndexedTraversal' Int String String

Note: This function type-checks as a Traversal but it doesn't satisfy the laws. It's only valid to use it when you don't insert any newline characters while traversing, and if your original String contains only isolated newline characters.

foldMapOf :: Getting r s a -> (a -> r) -> s -> r #

Map each part of a structure viewed through a Lens, Getter, Fold or Traversal to a monoid and combine the results.

>>> foldMapOf (folded . both . _Just) Sum [(Just 21, Just 21)]
Sum {getSum = 42}
foldMap = foldMapOf folded
foldMapOfviews
ifoldMapOf l = foldMapOf l . Indexed
foldMapOf ::                Getter s a      -> (a -> r) -> s -> r
foldMapOf :: Monoid r    => Fold s a        -> (a -> r) -> s -> r
foldMapOf :: Semigroup r => Fold1 s a       -> (a -> r) -> s -> r
foldMapOf ::                Lens' s a       -> (a -> r) -> s -> r
foldMapOf ::                Iso' s a        -> (a -> r) -> s -> r
foldMapOf :: Monoid r    => Traversal' s a  -> (a -> r) -> s -> r
foldMapOf :: Semigroup r => Traversal1' s a -> (a -> r) -> s -> r
foldMapOf :: Monoid r    => Prism' s a      -> (a -> r) -> s -> r
foldMapOf :: Getting r s a -> (a -> r) -> s -> r

foldOf :: Getting a s a -> s -> a #

Combine the elements of a structure viewed through a Lens, Getter, Fold or Traversal using a monoid.

>>> foldOf (folded.folded) [[Sum 1,Sum 4],[Sum 8, Sum 8],[Sum 21]]
Sum {getSum = 42}
fold = foldOf folded
foldOfview
foldOf ::             Getter s m     -> s -> m
foldOf :: Monoid m => Fold s m       -> s -> m
foldOf ::             Lens' s m      -> s -> m
foldOf ::             Iso' s m       -> s -> m
foldOf :: Monoid m => Traversal' s m -> s -> m
foldOf :: Monoid m => Prism' s m     -> s -> m

foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r #

Right-associative fold of parts of a structure that are viewed through a Lens, Getter, Fold or Traversal.

foldrfoldrOf folded
foldrOf :: Getter s a     -> (a -> r -> r) -> r -> s -> r
foldrOf :: Fold s a       -> (a -> r -> r) -> r -> s -> r
foldrOf :: Lens' s a      -> (a -> r -> r) -> r -> s -> r
foldrOf :: Iso' s a       -> (a -> r -> r) -> r -> s -> r
foldrOf :: Traversal' s a -> (a -> r -> r) -> r -> s -> r
foldrOf :: Prism' s a     -> (a -> r -> r) -> r -> s -> r
ifoldrOf l ≡ foldrOf l . Indexed
foldrOf :: Getting (Endo r) s a -> (a -> r -> r) -> r -> s -> r

foldlOf :: Getting (Dual (Endo r)) s a -> (r -> a -> r) -> r -> s -> r #

Left-associative fold of the parts of a structure that are viewed through a Lens, Getter, Fold or Traversal.

foldlfoldlOf folded
foldlOf :: Getter s a     -> (r -> a -> r) -> r -> s -> r
foldlOf :: Fold s a       -> (r -> a -> r) -> r -> s -> r
foldlOf :: Lens' s a      -> (r -> a -> r) -> r -> s -> r
foldlOf :: Iso' s a       -> (r -> a -> r) -> r -> s -> r
foldlOf :: Traversal' s a -> (r -> a -> r) -> r -> s -> r
foldlOf :: Prism' s a     -> (r -> a -> r) -> r -> s -> r

toListOf :: Getting (Endo [a]) s a -> s -> [a] #

Extract a list of the targets of a Fold. See also (^..).

toListtoListOf folded
(^..) ≡ flip toListOf

toNonEmptyOf :: Getting (NonEmptyDList a) s a -> s -> NonEmpty a #

Extract a NonEmpty of the targets of Fold1.

>>> toNonEmptyOf both1 ("hello", "world")
"hello" :| ["world"]
toNonEmptyOf :: Getter s a      -> s -> NonEmpty a
toNonEmptyOf :: Fold1 s a       -> s -> NonEmpty a
toNonEmptyOf :: Lens' s a       -> s -> NonEmpty a
toNonEmptyOf :: Iso' s a        -> s -> NonEmpty a
toNonEmptyOf :: Traversal1' s a -> s -> NonEmpty a
toNonEmptyOf :: Prism' s a      -> s -> NonEmpty a

(^..) :: s -> Getting (Endo [a]) s a -> [a] infixl 8 #

A convenient infix (flipped) version of toListOf.

>>> [[1,2],[3]]^..id
[[[1,2],[3]]]
>>> [[1,2],[3]]^..traverse
[[1,2],[3]]
>>> [[1,2],[3]]^..traverse.traverse
[1,2,3]
>>> (1,2)^..both
[1,2]
toList xs ≡ xs ^.. folded
(^..) ≡ flip toListOf
(^..) :: s -> Getter s a     -> a :: s -> Fold s a       -> a :: s -> Lens' s a      -> a :: s -> Iso' s a       -> a :: s -> Traversal' s a -> a :: s -> Prism' s a     -> [a]

andOf :: Getting All s Bool -> s -> Bool #

Returns True if every target of a Fold is True.

>>> andOf both (True,False)
False
>>> andOf both (True,True)
True
andandOf folded
andOf :: Getter s Bool     -> s -> Bool
andOf :: Fold s Bool       -> s -> Bool
andOf :: Lens' s Bool      -> s -> Bool
andOf :: Iso' s Bool       -> s -> Bool
andOf :: Traversal' s Bool -> s -> Bool
andOf :: Prism' s Bool     -> s -> Bool

orOf :: Getting Any s Bool -> s -> Bool #

Returns True if any target of a Fold is True.

>>> orOf both (True,False)
True
>>> orOf both (False,False)
False
ororOf folded
orOf :: Getter s Bool     -> s -> Bool
orOf :: Fold s Bool       -> s -> Bool
orOf :: Lens' s Bool      -> s -> Bool
orOf :: Iso' s Bool       -> s -> Bool
orOf :: Traversal' s Bool -> s -> Bool
orOf :: Prism' s Bool     -> s -> Bool

anyOf :: Getting Any s a -> (a -> Bool) -> s -> Bool #

Returns True if any target of a Fold satisfies a predicate.

>>> anyOf both (=='x') ('x','y')
True
>>> import Data.Data.Lens
>>> anyOf biplate (== "world") (((),2::Int),"hello",("world",11::Int))
True
anyanyOf folded
ianyOf l ≡ anyOf l . Indexed
anyOf :: Getter s a     -> (a -> Bool) -> s -> Bool
anyOf :: Fold s a       -> (a -> Bool) -> s -> Bool
anyOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
anyOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
anyOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
anyOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

allOf :: Getting All s a -> (a -> Bool) -> s -> Bool #

Returns True if every target of a Fold satisfies a predicate.

>>> allOf both (>=3) (4,5)
True
>>> allOf folded (>=2) [1..10]
False
allallOf folded
iallOf l = allOf l . Indexed
allOf :: Getter s a     -> (a -> Bool) -> s -> Bool
allOf :: Fold s a       -> (a -> Bool) -> s -> Bool
allOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
allOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
allOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
allOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

noneOf :: Getting Any s a -> (a -> Bool) -> s -> Bool #

Returns True only if no targets of a Fold satisfy a predicate.

>>> noneOf each (is _Nothing) (Just 3, Just 4, Just 5)
True
>>> noneOf (folded.folded) (<10) [[13,99,20],[3,71,42]]
False
inoneOf l = noneOf l . Indexed
noneOf :: Getter s a     -> (a -> Bool) -> s -> Bool
noneOf :: Fold s a       -> (a -> Bool) -> s -> Bool
noneOf :: Lens' s a      -> (a -> Bool) -> s -> Bool
noneOf :: Iso' s a       -> (a -> Bool) -> s -> Bool
noneOf :: Traversal' s a -> (a -> Bool) -> s -> Bool
noneOf :: Prism' s a     -> (a -> Bool) -> s -> Bool

productOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a #

Calculate the Product of every number targeted by a Fold.

>>> productOf both (4,5)
20
>>> productOf folded [1,2,3,4,5]
120
productproductOf folded

This operation may be more strict than you would expect. If you want a lazier version use ala Product . foldMapOf

productOf :: Num a => Getter s a     -> s -> a
productOf :: Num a => Fold s a       -> s -> a
productOf :: Num a => Lens' s a      -> s -> a
productOf :: Num a => Iso' s a       -> s -> a
productOf :: Num a => Traversal' s a -> s -> a
productOf :: Num a => Prism' s a     -> s -> a

sumOf :: Num a => Getting (Endo (Endo a)) s a -> s -> a #

Calculate the Sum of every number targeted by a Fold.

>>> sumOf both (5,6)
11
>>> sumOf folded [1,2,3,4]
10
>>> sumOf (folded.both) [(1,2),(3,4)]
10
>>> import Data.Data.Lens
>>> sumOf biplate [(1::Int,[]),(2,[(3::Int,4::Int)])] :: Int
10
sumsumOf folded

This operation may be more strict than you would expect. If you want a lazier version use ala Sum . foldMapOf

sumOf _1 :: Num a => (a, b) -> a
sumOf (folded . _1) :: (Foldable f, Num a) => f (a, b) -> a
sumOf :: Num a => Getter s a     -> s -> a
sumOf :: Num a => Fold s a       -> s -> a
sumOf :: Num a => Lens' s a      -> s -> a
sumOf :: Num a => Iso' s a       -> s -> a
sumOf :: Num a => Traversal' s a -> s -> a
sumOf :: Num a => Prism' s a     -> s -> a

traverseOf_ :: Functor f => Getting (Traversed r f) s a -> (a -> f r) -> s -> f () #

Traverse over all of the targets of a Fold (or Getter), computing an Applicative (or Functor)-based answer, but unlike traverseOf do not construct a new structure. traverseOf_ generalizes traverse_ to work over any Fold.

When passed a Getter, traverseOf_ can work over any Functor, but when passed a Fold, traverseOf_ requires an Applicative.

>>> traverseOf_ both putStrLn ("hello","world")
hello
world
traverse_traverseOf_ folded
traverseOf_ _2 :: Functor f => (c -> f r) -> (d, c) -> f ()
traverseOf_ _Left :: Applicative f => (a -> f b) -> Either a c -> f ()
itraverseOf_ l ≡ traverseOf_ l . Indexed

The rather specific signature of traverseOf_ allows it to be used as if the signature was any of:

traverseOf_ :: Functor f     => Getter s a     -> (a -> f r) -> s -> f ()
traverseOf_ :: Applicative f => Fold s a       -> (a -> f r) -> s -> f ()
traverseOf_ :: Functor f     => Lens' s a      -> (a -> f r) -> s -> f ()
traverseOf_ :: Functor f     => Iso' s a       -> (a -> f r) -> s -> f ()
traverseOf_ :: Applicative f => Traversal' s a -> (a -> f r) -> s -> f ()
traverseOf_ :: Applicative f => Prism' s a     -> (a -> f r) -> s -> f ()

forOf_ :: Functor f => Getting (Traversed r f) s a -> s -> (a -> f r) -> f () #

Traverse over all of the targets of a Fold (or Getter), computing an Applicative (or Functor)-based answer, but unlike forOf do not construct a new structure. forOf_ generalizes for_ to work over any Fold.

When passed a Getter, forOf_ can work over any Functor, but when passed a Fold, forOf_ requires an Applicative.

for_forOf_ folded
>>> forOf_ both ("hello","world") putStrLn
hello
world

The rather specific signature of forOf_ allows it to be used as if the signature was any of:

iforOf_ l s ≡ forOf_ l s . Indexed
forOf_ :: Functor f     => Getter s a     -> s -> (a -> f r) -> f ()
forOf_ :: Applicative f => Fold s a       -> s -> (a -> f r) -> f ()
forOf_ :: Functor f     => Lens' s a      -> s -> (a -> f r) -> f ()
forOf_ :: Functor f     => Iso' s a       -> s -> (a -> f r) -> f ()
forOf_ :: Applicative f => Traversal' s a -> s -> (a -> f r) -> f ()
forOf_ :: Applicative f => Prism' s a     -> s -> (a -> f r) -> f ()

sequenceAOf_ :: Functor f => Getting (Traversed a f) s (f a) -> s -> f () #

Evaluate each action in observed by a Fold on a structure from left to right, ignoring the results.

sequenceA_sequenceAOf_ folded
>>> sequenceAOf_ both (putStrLn "hello",putStrLn "world")
hello
world
sequenceAOf_ :: Functor f     => Getter s (f a)     -> s -> f ()
sequenceAOf_ :: Applicative f => Fold s (f a)       -> s -> f ()
sequenceAOf_ :: Functor f     => Lens' s (f a)      -> s -> f ()
sequenceAOf_ :: Functor f     => Iso' s (f a)       -> s -> f ()
sequenceAOf_ :: Applicative f => Traversal' s (f a) -> s -> f ()
sequenceAOf_ :: Applicative f => Prism' s (f a)     -> s -> f ()

traverse1Of_ :: Functor f => Getting (TraversedF r f) s a -> (a -> f r) -> s -> f () #

Traverse over all of the targets of a Fold1, computing an Apply based answer.

As long as you have Applicative or Functor effect you are better using traverseOf_. The traverse1Of_ is useful only when you have genuine Apply effect.

>>> traverse1Of_ both1 (\ks -> Map.fromList [ (k, ()) | k <- ks ]) ("abc", "bcd")
fromList [('b',()),('c',())]
traverse1Of_ :: Apply f => Fold1 s a -> (a -> f r) -> s -> f ()

Since: lens-4.16

for1Of_ :: Functor f => Getting (TraversedF r f) s a -> s -> (a -> f r) -> f () #

See forOf_ and traverse1Of_.

>>> for1Of_ both1 ("abc", "bcd") (\ks -> Map.fromList [ (k, ()) | k <- ks ])
fromList [('b',()),('c',())]
for1Of_ :: Apply f => Fold1 s a -> s -> (a -> f r) -> f ()

Since: lens-4.16

sequence1Of_ :: Functor f => Getting (TraversedF a f) s (f a) -> s -> f () #

See sequenceAOf_ and traverse1Of_.

sequence1Of_ :: Apply f => Fold1 s (f a) -> s -> f ()

Since: lens-4.16

mapMOf_ :: Monad m => Getting (Sequenced r m) s a -> (a -> m r) -> s -> m () #

Map each target of a Fold on a structure to a monadic action, evaluate these actions from left to right, and ignore the results.

>>> mapMOf_ both putStrLn ("hello","world")
hello
world
mapM_mapMOf_ folded
mapMOf_ :: Monad m => Getter s a     -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Fold s a       -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Lens' s a      -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Iso' s a       -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Traversal' s a -> (a -> m r) -> s -> m ()
mapMOf_ :: Monad m => Prism' s a     -> (a -> m r) -> s -> m ()

forMOf_ :: Monad m => Getting (Sequenced r m) s a -> s -> (a -> m r) -> m () #

forMOf_ is mapMOf_ with two of its arguments flipped.

>>> forMOf_ both ("hello","world") putStrLn
hello
world
forM_forMOf_ folded
forMOf_ :: Monad m => Getter s a     -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Fold s a       -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Lens' s a      -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Iso' s a       -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Traversal' s a -> s -> (a -> m r) -> m ()
forMOf_ :: Monad m => Prism' s a     -> s -> (a -> m r) -> m ()

sequenceOf_ :: Monad m => Getting (Sequenced a m) s (m a) -> s -> m () #

Evaluate each monadic action referenced by a Fold on the structure from left to right, and ignore the results.

>>> sequenceOf_ both (putStrLn "hello",putStrLn "world")
hello
world
sequence_sequenceOf_ folded
sequenceOf_ :: Monad m => Getter s (m a)     -> s -> m ()
sequenceOf_ :: Monad m => Fold s (m a)       -> s -> m ()
sequenceOf_ :: Monad m => Lens' s (m a)      -> s -> m ()
sequenceOf_ :: Monad m => Iso' s (m a)       -> s -> m ()
sequenceOf_ :: Monad m => Traversal' s (m a) -> s -> m ()
sequenceOf_ :: Monad m => Prism' s (m a)     -> s -> m ()

asumOf :: Alternative f => Getting (Endo (f a)) s (f a) -> s -> f a #

The sum of a collection of actions, generalizing concatOf.

>>> asumOf both ("hello","world")
"helloworld"
>>> asumOf each (Nothing, Just "hello", Nothing)
Just "hello"
asumasumOf folded
asumOf :: Alternative f => Getter s (f a)     -> s -> f a
asumOf :: Alternative f => Fold s (f a)       -> s -> f a
asumOf :: Alternative f => Lens' s (f a)      -> s -> f a
asumOf :: Alternative f => Iso' s (f a)       -> s -> f a
asumOf :: Alternative f => Traversal' s (f a) -> s -> f a
asumOf :: Alternative f => Prism' s (f a)     -> s -> f a

msumOf :: MonadPlus m => Getting (Endo (m a)) s (m a) -> s -> m a #

The sum of a collection of actions, generalizing concatOf.

>>> msumOf both ("hello","world")
"helloworld"
>>> msumOf each (Nothing, Just "hello", Nothing)
Just "hello"
msummsumOf folded
msumOf :: MonadPlus m => Getter s (m a)     -> s -> m a
msumOf :: MonadPlus m => Fold s (m a)       -> s -> m a
msumOf :: MonadPlus m => Lens' s (m a)      -> s -> m a
msumOf :: MonadPlus m => Iso' s (m a)       -> s -> m a
msumOf :: MonadPlus m => Traversal' s (m a) -> s -> m a
msumOf :: MonadPlus m => Prism' s (m a)     -> s -> m a

elemOf :: Eq a => Getting Any s a -> a -> s -> Bool #

Does the element occur anywhere within a given Fold of the structure?

>>> elemOf both "hello" ("hello","world")
True
elemelemOf folded
elemOf :: Eq a => Getter s a     -> a -> s -> Bool
elemOf :: Eq a => Fold s a       -> a -> s -> Bool
elemOf :: Eq a => Lens' s a      -> a -> s -> Bool
elemOf :: Eq a => Iso' s a       -> a -> s -> Bool
elemOf :: Eq a => Traversal' s a -> a -> s -> Bool
elemOf :: Eq a => Prism' s a     -> a -> s -> Bool

notElemOf :: Eq a => Getting All s a -> a -> s -> Bool #

Does the element not occur anywhere within a given Fold of the structure?

>>> notElemOf each 'd' ('a','b','c')
True
>>> notElemOf each 'a' ('a','b','c')
False
notElemnotElemOf folded
notElemOf :: Eq a => Getter s a     -> a -> s -> Bool
notElemOf :: Eq a => Fold s a       -> a -> s -> Bool
notElemOf :: Eq a => Iso' s a       -> a -> s -> Bool
notElemOf :: Eq a => Lens' s a      -> a -> s -> Bool
notElemOf :: Eq a => Traversal' s a -> a -> s -> Bool
notElemOf :: Eq a => Prism' s a     -> a -> s -> Bool

concatMapOf :: Getting [r] s a -> (a -> [r]) -> s -> [r] #

Map a function over all the targets of a Fold of a container and concatenate the resulting lists.

>>> concatMapOf both (\x -> [x, x + 1]) (1,3)
[1,2,3,4]
concatMapconcatMapOf folded
concatMapOf :: Getter s a     -> (a -> [r]) -> s -> [r]
concatMapOf :: Fold s a       -> (a -> [r]) -> s -> [r]
concatMapOf :: Lens' s a      -> (a -> [r]) -> s -> [r]
concatMapOf :: Iso' s a       -> (a -> [r]) -> s -> [r]
concatMapOf :: Traversal' s a -> (a -> [r]) -> s -> [r]

concatOf :: Getting [r] s [r] -> s -> [r] #

Concatenate all of the lists targeted by a Fold into a longer list.

>>> concatOf both ("pan","ama")
"panama"
concatconcatOf folded
concatOfview
concatOf :: Getter s [r]     -> s -> [r]
concatOf :: Fold s [r]       -> s -> [r]
concatOf :: Iso' s [r]       -> s -> [r]
concatOf :: Lens' s [r]      -> s -> [r]
concatOf :: Traversal' s [r] -> s -> [r]

lengthOf :: Getting (Endo (Endo Int)) s a -> s -> Int #

Calculate the number of targets there are for a Fold in a given container.

Note: This can be rather inefficient for large containers and just like length, this will not terminate for infinite folds.

lengthlengthOf folded
>>> lengthOf _1 ("hello",())
1
>>> lengthOf traverse [1..10]
10
>>> lengthOf (traverse.traverse) [[1,2],[3,4],[5,6]]
6
lengthOf (folded . folded) :: (Foldable f, Foldable g) => f (g a) -> Int
lengthOf :: Getter s a     -> s -> Int
lengthOf :: Fold s a       -> s -> Int
lengthOf :: Lens' s a      -> s -> Int
lengthOf :: Iso' s a       -> s -> Int
lengthOf :: Traversal' s a -> s -> Int

(^?) :: s -> Getting (First a) s a -> Maybe a infixl 8 #

Perform a safe head of a Fold or Traversal or retrieve Just the result from a Getter or Lens.

When using a Traversal as a partial Lens, or a Fold as a partial Getter this can be a convenient way to extract the optional value.

Note: if you get stack overflows due to this, you may want to use firstOf instead, which can deal more gracefully with heavily left-biased trees.

>>> Left 4 ^?_Left
Just 4
>>> Right 4 ^?_Left
Nothing
>>> "world" ^? ix 3
Just 'l'
>>> "world" ^? ix 20
Nothing
(^?) ≡ flip preview
(^?) :: s -> Getter s a     -> Maybe a
(^?) :: s -> Fold s a       -> Maybe a
(^?) :: s -> Lens' s a      -> Maybe a
(^?) :: s -> Iso' s a       -> Maybe a
(^?) :: s -> Traversal' s a -> Maybe a

(^?!) :: HasCallStack => s -> Getting (Endo a) s a -> a infixl 8 #

Perform an *UNSAFE* head of a Fold or Traversal assuming that it is there.

>>> Left 4 ^?! _Left
4
>>> "world" ^?! ix 3
'l'
(^?!) :: s -> Getter s a     -> a
(^?!) :: s -> Fold s a       -> a
(^?!) :: s -> Lens' s a      -> a
(^?!) :: s -> Iso' s a       -> a
(^?!) :: s -> Traversal' s a -> a

firstOf :: Getting (Leftmost a) s a -> s -> Maybe a #

Retrieve the First entry of a Fold or Traversal or retrieve Just the result from a Getter or Lens.

The answer is computed in a manner that leaks space less than ala First . foldMapOf and gives you back access to the outermost Just constructor more quickly, but may have worse constant factors.

Note: this could been named headOf.

>>> firstOf traverse [1..10]
Just 1
>>> firstOf both (1,2)
Just 1
>>> firstOf ignored ()
Nothing
firstOf :: Getter s a     -> s -> Maybe a
firstOf :: Fold s a       -> s -> Maybe a
firstOf :: Lens' s a      -> s -> Maybe a
firstOf :: Iso' s a       -> s -> Maybe a
firstOf :: Traversal' s a -> s -> Maybe a

first1Of :: Getting (First a) s a -> s -> a #

Retrieve the First entry of a Fold1 or Traversal1 or the result from a Getter or Lens.

>>> first1Of traverse1 (1 :| [2..10])
1
>>> first1Of both1 (1,2)
1

Note: this is different from ^..

>>> first1Of traverse1 ([1,2] :| [[3,4],[5,6]])
[1,2]
>>> ([1,2] :| [[3,4],[5,6]]) ^. traverse1
[1,2,3,4,5,6]
first1Of :: Getter s a      -> s -> a
first1Of :: Fold1 s a       -> s -> a
first1Of :: Lens' s a       -> s -> a
first1Of :: Iso' s a        -> s -> a
first1Of :: Traversal1' s a -> s -> a

lastOf :: Getting (Rightmost a) s a -> s -> Maybe a #

Retrieve the Last entry of a Fold or Traversal or retrieve Just the result from a Getter or Lens.

The answer is computed in a manner that leaks space less than ala Last . foldMapOf and gives you back access to the outermost Just constructor more quickly, but may have worse constant factors.

>>> lastOf traverse [1..10]
Just 10
>>> lastOf both (1,2)
Just 2
>>> lastOf ignored ()
Nothing
lastOf :: Getter s a     -> s -> Maybe a
lastOf :: Fold s a       -> s -> Maybe a
lastOf :: Lens' s a      -> s -> Maybe a
lastOf :: Iso' s a       -> s -> Maybe a
lastOf :: Traversal' s a -> s -> Maybe a

last1Of :: Getting (Last a) s a -> s -> a #

Retrieve the Last entry of a Fold1 or Traversal1 or retrieve the result from a Getter or Lens.o

>>> last1Of traverse1 (1 :| [2..10])
10
>>> last1Of both1 (1,2)
2
last1Of :: Getter s a      -> s -> Maybe a
last1Of :: Fold1 s a       -> s -> Maybe a
last1Of :: Lens' s a       -> s -> Maybe a
last1Of :: Iso' s a        -> s -> Maybe a
last1Of :: Traversal1' s a -> s -> Maybe a

nullOf :: Getting All s a -> s -> Bool #

Returns True if this Fold or Traversal has no targets in the given container.

Note: nullOf on a valid Iso, Lens or Getter should always return False.

nullnullOf folded

This may be rather inefficient compared to the null check of many containers.

>>> nullOf _1 (1,2)
False
>>> nullOf ignored ()
True
>>> nullOf traverse []
True
>>> nullOf (element 20) [1..10]
True
nullOf (folded . _1 . folded) :: (Foldable f, Foldable g) => f (g a, b) -> Bool
nullOf :: Getter s a     -> s -> Bool
nullOf :: Fold s a       -> s -> Bool
nullOf :: Iso' s a       -> s -> Bool
nullOf :: Lens' s a      -> s -> Bool
nullOf :: Traversal' s a -> s -> Bool

notNullOf :: Getting Any s a -> s -> Bool #

Returns True if this Fold or Traversal has any targets in the given container.

A more "conversational" alias for this combinator is has.

Note: notNullOf on a valid Iso, Lens or Getter should always return True.

not . nullnotNullOf folded

This may be rather inefficient compared to the not . null check of many containers.

>>> notNullOf _1 (1,2)
True
>>> notNullOf traverse [1..10]
True
>>> notNullOf folded []
False
>>> notNullOf (element 20) [1..10]
False
notNullOf (folded . _1 . folded) :: (Foldable f, Foldable g) => f (g a, b) -> Bool
notNullOf :: Getter s a     -> s -> Bool
notNullOf :: Fold s a       -> s -> Bool
notNullOf :: Iso' s a       -> s -> Bool
notNullOf :: Lens' s a      -> s -> Bool
notNullOf :: Traversal' s a -> s -> Bool

maximumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a #

Obtain the maximum element (if any) targeted by a Fold or Traversal safely.

Note: maximumOf on a valid Iso, Lens or Getter will always return Just a value.

>>> maximumOf traverse [1..10]
Just 10
>>> maximumOf traverse []
Nothing
>>> maximumOf (folded.filtered even) [1,4,3,6,7,9,2]
Just 6
maximumfromMaybe (error "empty") . maximumOf folded

In the interest of efficiency, This operation has semantics more strict than strictly necessary. rmap getMax (foldMapOf l Max) has lazier semantics but could leak memory.

maximumOf :: Ord a => Getter s a     -> s -> Maybe a
maximumOf :: Ord a => Fold s a       -> s -> Maybe a
maximumOf :: Ord a => Iso' s a       -> s -> Maybe a
maximumOf :: Ord a => Lens' s a      -> s -> Maybe a
maximumOf :: Ord a => Traversal' s a -> s -> Maybe a

maximum1Of :: Ord a => Getting (Max a) s a -> s -> a #

Obtain the maximum element targeted by a Fold1 or Traversal1.

>>> maximum1Of traverse1 (1 :| [2..10])
10
maximum1Of :: Ord a => Getter s a      -> s -> a
maximum1Of :: Ord a => Fold1 s a       -> s -> a
maximum1Of :: Ord a => Iso' s a        -> s -> a
maximum1Of :: Ord a => Lens' s a       -> s -> a
maximum1Of :: Ord a => Traversal1' s a -> s -> a

minimumOf :: Ord a => Getting (Endo (Endo (Maybe a))) s a -> s -> Maybe a #

Obtain the minimum element (if any) targeted by a Fold or Traversal safely.

Note: minimumOf on a valid Iso, Lens or Getter will always return Just a value.

>>> minimumOf traverse [1..10]
Just 1
>>> minimumOf traverse []
Nothing
>>> minimumOf (folded.filtered even) [1,4,3,6,7,9,2]
Just 2
minimumfromMaybe (error "empty") . minimumOf folded

In the interest of efficiency, This operation has semantics more strict than strictly necessary. rmap getMin (foldMapOf l Min) has lazier semantics but could leak memory.

minimumOf :: Ord a => Getter s a     -> s -> Maybe a
minimumOf :: Ord a => Fold s a       -> s -> Maybe a
minimumOf :: Ord a => Iso' s a       -> s -> Maybe a
minimumOf :: Ord a => Lens' s a      -> s -> Maybe a
minimumOf :: Ord a => Traversal' s a -> s -> Maybe a

minimum1Of :: Ord a => Getting (Min a) s a -> s -> a #

Obtain the minimum element targeted by a Fold1 or Traversal1.

>>> minimum1Of traverse1 (1 :| [2..10])
1
minimum1Of :: Ord a => Getter s a      -> s -> a
minimum1Of :: Ord a => Fold1 s a       -> s -> a
minimum1Of :: Ord a => Iso' s a        -> s -> a
minimum1Of :: Ord a => Lens' s a       -> s -> a
minimum1Of :: Ord a => Traversal1' s a -> s -> a

maximumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a #

Obtain the maximum element (if any) targeted by a Fold, Traversal, Lens, Iso, or Getter according to a user supplied Ordering.

>>> maximumByOf traverse (compare `on` length) ["mustard","relish","ham"]
Just "mustard"

In the interest of efficiency, This operation has semantics more strict than strictly necessary.

maximumBy cmp ≡ fromMaybe (error "empty") . maximumByOf folded cmp
maximumByOf :: Getter s a     -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Fold s a       -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Iso' s a       -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Lens' s a      -> (a -> a -> Ordering) -> s -> Maybe a
maximumByOf :: Traversal' s a -> (a -> a -> Ordering) -> s -> Maybe a

minimumByOf :: Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> Ordering) -> s -> Maybe a #

Obtain the minimum element (if any) targeted by a Fold, Traversal, Lens, Iso or Getter according to a user supplied Ordering.

In the interest of efficiency, This operation has semantics more strict than strictly necessary.

>>> minimumByOf traverse (compare `on` length) ["mustard","relish","ham"]
Just "ham"
minimumBy cmp ≡ fromMaybe (error "empty") . minimumByOf folded cmp
minimumByOf :: Getter s a     -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Fold s a       -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Iso' s a       -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Lens' s a      -> (a -> a -> Ordering) -> s -> Maybe a
minimumByOf :: Traversal' s a -> (a -> a -> Ordering) -> s -> Maybe a

findOf :: Getting (Endo (Maybe a)) s a -> (a -> Bool) -> s -> Maybe a #

The findOf function takes a Lens (or Getter, Iso, Fold, or Traversal), a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element.

>>> findOf each even (1,3,4,6)
Just 4
>>> findOf folded even [1,3,5,7]
Nothing
findOf :: Getter s a     -> (a -> Bool) -> s -> Maybe a
findOf :: Fold s a       -> (a -> Bool) -> s -> Maybe a
findOf :: Iso' s a       -> (a -> Bool) -> s -> Maybe a
findOf :: Lens' s a      -> (a -> Bool) -> s -> Maybe a
findOf :: Traversal' s a -> (a -> Bool) -> s -> Maybe a
findfindOf folded
ifindOf l ≡ findOf l . Indexed

A simpler version that didn't permit indexing, would be:

findOf :: Getting (Endo (Maybe a)) s a -> (a -> Bool) -> s -> Maybe a
findOf l p = foldrOf l (a y -> if p a then Just a else y) Nothing

findMOf :: Monad m => Getting (Endo (m (Maybe a))) s a -> (a -> m Bool) -> s -> m (Maybe a) #

The findMOf function takes a Lens (or Getter, Iso, Fold, or Traversal), a monadic predicate and a structure and returns in the monad the leftmost element of the structure matching the predicate, or Nothing if there is no such element.

>>> findMOf each ( \x -> print ("Checking " ++ show x) >> return (even x)) (1,3,4,6)
"Checking 1"
"Checking 3"
"Checking 4"
Just 4
>>> findMOf each ( \x -> print ("Checking " ++ show x) >> return (even x)) (1,3,5,7)
"Checking 1"
"Checking 3"
"Checking 5"
"Checking 7"
Nothing
findMOf :: (Monad m, Getter s a)     -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Fold s a)       -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Iso' s a)       -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Lens' s a)      -> (a -> m Bool) -> s -> m (Maybe a)
findMOf :: (Monad m, Traversal' s a) -> (a -> m Bool) -> s -> m (Maybe a)
findMOf folded :: (Monad m, Foldable f) => (a -> m Bool) -> f a -> m (Maybe a)
ifindMOf l ≡ findMOf l . Indexed

A simpler version that didn't permit indexing, would be:

findMOf :: Monad m => Getting (Endo (m (Maybe a))) s a -> (a -> m Bool) -> s -> m (Maybe a)
findMOf l p = foldrOf l (a y -> p a >>= x -> if x then return (Just a) else y) $ return Nothing

lookupOf :: Eq k => Getting (Endo (Maybe v)) s (k, v) -> k -> s -> Maybe v #

The lookupOf function takes a Fold (or Getter, Traversal, Lens, Iso, etc.), a key, and a structure containing key/value pairs. It returns the first value corresponding to the given key. This function generalizes lookup to work on an arbitrary Fold instead of lists.

>>> lookupOf folded 4 [(2, 'a'), (4, 'b'), (4, 'c')]
Just 'b'
>>> lookupOf each 2 [(2, 'a'), (4, 'b'), (4, 'c')]
Just 'a'
lookupOf :: Eq k => Fold s (k,v) -> k -> s -> Maybe v

foldr1Of :: HasCallStack => Getting (Endo (Maybe a)) s a -> (a -> a -> a) -> s -> a #

A variant of foldrOf that has no base case and thus may only be applied to lenses and structures such that the Lens views at least one element of the structure.

>>> foldr1Of each (+) (1,2,3,4)
10
foldr1Of l f ≡ foldr1 f . toListOf l
foldr1foldr1Of folded
foldr1Of :: Getter s a     -> (a -> a -> a) -> s -> a
foldr1Of :: Fold s a       -> (a -> a -> a) -> s -> a
foldr1Of :: Iso' s a       -> (a -> a -> a) -> s -> a
foldr1Of :: Lens' s a      -> (a -> a -> a) -> s -> a
foldr1Of :: Traversal' s a -> (a -> a -> a) -> s -> a

foldl1Of :: HasCallStack => Getting (Dual (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a #

A variant of foldlOf that has no base case and thus may only be applied to lenses and structures such that the Lens views at least one element of the structure.

>>> foldl1Of each (+) (1,2,3,4)
10
foldl1Of l f ≡ foldl1 f . toListOf l
foldl1foldl1Of folded
foldl1Of :: Getter s a     -> (a -> a -> a) -> s -> a
foldl1Of :: Fold s a       -> (a -> a -> a) -> s -> a
foldl1Of :: Iso' s a       -> (a -> a -> a) -> s -> a
foldl1Of :: Lens' s a      -> (a -> a -> a) -> s -> a
foldl1Of :: Traversal' s a -> (a -> a -> a) -> s -> a

foldrOf' :: Getting (Dual (Endo (Endo r))) s a -> (a -> r -> r) -> r -> s -> r #

Strictly fold right over the elements of a structure.

foldr'foldrOf' folded
foldrOf' :: Getter s a     -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Fold s a       -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Iso' s a       -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Lens' s a      -> (a -> r -> r) -> r -> s -> r
foldrOf' :: Traversal' s a -> (a -> r -> r) -> r -> s -> r

foldlOf' :: Getting (Endo (Endo r)) s a -> (r -> a -> r) -> r -> s -> r #

Fold over the elements of a structure, associating to the left, but strictly.

foldl'foldlOf' folded
foldlOf' :: Getter s a     -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Fold s a       -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Iso' s a       -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Lens' s a      -> (r -> a -> r) -> r -> s -> r
foldlOf' :: Traversal' s a -> (r -> a -> r) -> r -> s -> r

foldr1Of' :: HasCallStack => Getting (Dual (Endo (Endo (Maybe a)))) s a -> (a -> a -> a) -> s -> a #

A variant of foldrOf' that has no base case and thus may only be applied to folds and structures such that the fold views at least one element of the structure.

foldr1Of l f ≡ foldr1 f . toListOf l
foldr1Of' :: Getter s a     -> (a -> a -> a) -> s -> a
foldr1Of' :: Fold s a       -> (a -> a -> a) -> s -> a
foldr1Of' :: Iso' s a       -> (a -> a -> a) -> s -> a
foldr1Of' :: Lens' s a      -> (a -> a -> a) -> s -> a
foldr1Of' :: Traversal' s a -> (a -> a -> a) -> s -> a

foldl1Of' :: HasCallStack => Getting (Endo (Endo (Maybe a))) s a -> (a -> a -> a) -> s -> a #

A variant of foldlOf' that has no base case and thus may only be applied to folds and structures such that the fold views at least one element of the structure.

foldl1Of' l f ≡ foldl1' f . toListOf l
foldl1Of' :: Getter s a     -> (a -> a -> a) -> s -> a
foldl1Of' :: Fold s a       -> (a -> a -> a) -> s -> a
foldl1Of' :: Iso' s a       -> (a -> a -> a) -> s -> a
foldl1Of' :: Lens' s a      -> (a -> a -> a) -> s -> a
foldl1Of' :: Traversal' s a -> (a -> a -> a) -> s -> a

foldrMOf :: Monad m => Getting (Dual (Endo (r -> m r))) s a -> (a -> r -> m r) -> r -> s -> m r #

Monadic fold over the elements of a structure, associating to the right, i.e. from right to left.

foldrMfoldrMOf folded
foldrMOf :: Monad m => Getter s a     -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Fold s a       -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Iso' s a       -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Lens' s a      -> (a -> r -> m r) -> r -> s -> m r
foldrMOf :: Monad m => Traversal' s a -> (a -> r -> m r) -> r -> s -> m r

foldlMOf :: Monad m => Getting (Endo (r -> m r)) s a -> (r -> a -> m r) -> r -> s -> m r #

Monadic fold over the elements of a structure, associating to the left, i.e. from left to right.

foldlMfoldlMOf folded
foldlMOf :: Monad m => Getter s a     -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Fold s a       -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Iso' s a       -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Lens' s a      -> (r -> a -> m r) -> r -> s -> m r
foldlMOf :: Monad m => Traversal' s a -> (r -> a -> m r) -> r -> s -> m r

has :: Getting Any s a -> s -> Bool #

Check to see if this Fold or Traversal matches 1 or more entries.

>>> has (element 0) []
False
>>> has _Left (Left 12)
True
>>> has _Right (Left 12)
False

This will always return True for a Lens or Getter.

>>> has _1 ("hello","world")
True
has :: Getter s a     -> s -> Bool
has :: Fold s a       -> s -> Bool
has :: Iso' s a       -> s -> Bool
has :: Lens' s a      -> s -> Bool
has :: Traversal' s a -> s -> Bool

hasn't :: Getting All s a -> s -> Bool #

Check to see if this Fold or Traversal has no matches.

>>> hasn't _Left (Right 12)
True
>>> hasn't _Left (Left 12)
False

pre :: Getting (First a) s a -> IndexPreservingGetter s (Maybe a) #

This converts a Fold to a IndexPreservingGetter that returns the first element, if it exists, as a Maybe.

pre :: Getter s a     -> IndexPreservingGetter s (Maybe a)
pre :: Fold s a       -> IndexPreservingGetter s (Maybe a)
pre :: Traversal' s a -> IndexPreservingGetter s (Maybe a)
pre :: Lens' s a      -> IndexPreservingGetter s (Maybe a)
pre :: Iso' s a       -> IndexPreservingGetter s (Maybe a)
pre :: Prism' s a     -> IndexPreservingGetter s (Maybe a)

ipre :: IndexedGetting i (First (i, a)) s a -> IndexPreservingGetter s (Maybe (i, a)) #

This converts an IndexedFold to an IndexPreservingGetter that returns the first index and element, if they exist, as a Maybe.

ipre :: IndexedGetter i s a     -> IndexPreservingGetter s (Maybe (i, a))
ipre :: IndexedFold i s a       -> IndexPreservingGetter s (Maybe (i, a))
ipre :: IndexedTraversal' i s a -> IndexPreservingGetter s (Maybe (i, a))
ipre :: IndexedLens' i s a      -> IndexPreservingGetter s (Maybe (i, a))

preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a) #

Retrieve the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens). See also (^?).

listToMaybe . toListpreview folded

This is usually applied in the Reader Monad (->) s.

preview = view . pre
preview :: Getter s a     -> s -> Maybe a
preview :: Fold s a       -> s -> Maybe a
preview :: Lens' s a      -> s -> Maybe a
preview :: Iso' s a       -> s -> Maybe a
preview :: Traversal' s a -> s -> Maybe a

However, it may be useful to think of its full generality when working with a Monad transformer stack:

preview :: MonadReader s m => Getter s a     -> m (Maybe a)
preview :: MonadReader s m => Fold s a       -> m (Maybe a)
preview :: MonadReader s m => Lens' s a      -> m (Maybe a)
preview :: MonadReader s m => Iso' s a       -> m (Maybe a)
preview :: MonadReader s m => Traversal' s a -> m (Maybe a)

ipreview :: MonadReader s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a)) #

Retrieve the first index and value targeted by a Fold or Traversal (or Just the result from a Getter or Lens). See also (^@?).

ipreview = view . ipre

This is usually applied in the Reader Monad (->) s.

ipreview :: IndexedGetter i s a     -> s -> Maybe (i, a)
ipreview :: IndexedFold i s a       -> s -> Maybe (i, a)
ipreview :: IndexedLens' i s a      -> s -> Maybe (i, a)
ipreview :: IndexedTraversal' i s a -> s -> Maybe (i, a)

However, it may be useful to think of its full generality when working with a Monad transformer stack:

ipreview :: MonadReader s m => IndexedGetter s a     -> m (Maybe (i, a))
ipreview :: MonadReader s m => IndexedFold s a       -> m (Maybe (i, a))
ipreview :: MonadReader s m => IndexedLens' s a      -> m (Maybe (i, a))
ipreview :: MonadReader s m => IndexedTraversal' s a -> m (Maybe (i, a))

previews :: MonadReader s m => Getting (First r) s a -> (a -> r) -> m (Maybe r) #

Retrieve a function of the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens).

This is usually applied in the Reader Monad (->) s.

ipreviews :: MonadReader s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r) #

Retrieve a function of the first index and value targeted by an IndexedFold or IndexedTraversal (or Just the result from an IndexedGetter or IndexedLens). See also (^@?).

ipreviews = views . ipre

This is usually applied in the Reader Monad (->) s.

ipreviews :: IndexedGetter i s a     -> (i -> a -> r) -> s -> Maybe r
ipreviews :: IndexedFold i s a       -> (i -> a -> r) -> s -> Maybe r
ipreviews :: IndexedLens' i s a      -> (i -> a -> r) -> s -> Maybe r
ipreviews :: IndexedTraversal' i s a -> (i -> a -> r) -> s -> Maybe r

However, it may be useful to think of its full generality when working with a Monad transformer stack:

ipreviews :: MonadReader s m => IndexedGetter i s a     -> (i -> a -> r) -> m (Maybe r)
ipreviews :: MonadReader s m => IndexedFold i s a       -> (i -> a -> r) -> m (Maybe r)
ipreviews :: MonadReader s m => IndexedLens' i s a      -> (i -> a -> r) -> m (Maybe r)
ipreviews :: MonadReader s m => IndexedTraversal' i s a -> (i -> a -> r) -> m (Maybe r)

preuse :: MonadState s m => Getting (First a) s a -> m (Maybe a) #

Retrieve the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens) into the current state.

preuse = use . pre
preuse :: MonadState s m => Getter s a     -> m (Maybe a)
preuse :: MonadState s m => Fold s a       -> m (Maybe a)
preuse :: MonadState s m => Lens' s a      -> m (Maybe a)
preuse :: MonadState s m => Iso' s a       -> m (Maybe a)
preuse :: MonadState s m => Traversal' s a -> m (Maybe a)

ipreuse :: MonadState s m => IndexedGetting i (First (i, a)) s a -> m (Maybe (i, a)) #

Retrieve the first index and value targeted by an IndexedFold or IndexedTraversal (or Just the index and result from an IndexedGetter or IndexedLens) into the current state.

ipreuse = use . ipre
ipreuse :: MonadState s m => IndexedGetter i s a     -> m (Maybe (i, a))
ipreuse :: MonadState s m => IndexedFold i s a       -> m (Maybe (i, a))
ipreuse :: MonadState s m => IndexedLens' i s a      -> m (Maybe (i, a))
ipreuse :: MonadState s m => IndexedTraversal' i s a -> m (Maybe (i, a))

preuses :: MonadState s m => Getting (First r) s a -> (a -> r) -> m (Maybe r) #

Retrieve a function of the first value targeted by a Fold or Traversal (or Just the result from a Getter or Lens) into the current state.

preuses = uses . pre
preuses :: MonadState s m => Getter s a     -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Fold s a       -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Lens' s a      -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Iso' s a       -> (a -> r) -> m (Maybe r)
preuses :: MonadState s m => Traversal' s a -> (a -> r) -> m (Maybe r)

ipreuses :: MonadState s m => IndexedGetting i (First r) s a -> (i -> a -> r) -> m (Maybe r) #

Retrieve a function of the first index and value targeted by an IndexedFold or IndexedTraversal (or a function of Just the index and result from an IndexedGetter or IndexedLens) into the current state.

ipreuses = uses . ipre
ipreuses :: MonadState s m => IndexedGetter i s a     -> (i -> a -> r) -> m (Maybe r)
ipreuses :: MonadState s m => IndexedFold i s a       -> (i -> a -> r) -> m (Maybe r)
ipreuses :: MonadState s m => IndexedLens' i s a      -> (i -> a -> r) -> m (Maybe r)
ipreuses :: MonadState s m => IndexedTraversal' i s a -> (i -> a -> r) -> m (Maybe r)

ifoldMapOf :: IndexedGetting i m s a -> (i -> a -> m) -> s -> m #

Fold an IndexedFold or IndexedTraversal by mapping indices and values to an arbitrary Monoid with access to the i.

When you don't need access to the index then foldMapOf is more flexible in what it accepts.

foldMapOf l ≡ ifoldMapOf l . const
ifoldMapOf ::             IndexedGetter i s a     -> (i -> a -> m) -> s -> m
ifoldMapOf :: Monoid m => IndexedFold i s a       -> (i -> a -> m) -> s -> m
ifoldMapOf ::             IndexedLens' i s a      -> (i -> a -> m) -> s -> m
ifoldMapOf :: Monoid m => IndexedTraversal' i s a -> (i -> a -> m) -> s -> m

ifoldrOf :: IndexedGetting i (Endo r) s a -> (i -> a -> r -> r) -> r -> s -> r #

Right-associative fold of parts of a structure that are viewed through an IndexedFold or IndexedTraversal with access to the i.

When you don't need access to the index then foldrOf is more flexible in what it accepts.

foldrOf l ≡ ifoldrOf l . const
ifoldrOf :: IndexedGetter i s a     -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf :: IndexedFold i s a       -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf :: IndexedLens' i s a      -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf :: IndexedTraversal' i s a -> (i -> a -> r -> r) -> r -> s -> r

ifoldlOf :: IndexedGetting i (Dual (Endo r)) s a -> (i -> r -> a -> r) -> r -> s -> r #

Left-associative fold of the parts of a structure that are viewed through an IndexedFold or IndexedTraversal with access to the i.

When you don't need access to the index then foldlOf is more flexible in what it accepts.

foldlOf l ≡ ifoldlOf l . const
ifoldlOf :: IndexedGetter i s a     -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf :: IndexedFold i s a       -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf :: IndexedLens' i s a      -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf :: IndexedTraversal' i s a -> (i -> r -> a -> r) -> r -> s -> r

ianyOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool #

Return whether or not any element viewed through an IndexedFold or IndexedTraversal satisfy a predicate, with access to the i.

When you don't need access to the index then anyOf is more flexible in what it accepts.

anyOf l ≡ ianyOf l . const
ianyOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
ianyOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
ianyOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
ianyOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

iallOf :: IndexedGetting i All s a -> (i -> a -> Bool) -> s -> Bool #

Return whether or not all elements viewed through an IndexedFold or IndexedTraversal satisfy a predicate, with access to the i.

When you don't need access to the index then allOf is more flexible in what it accepts.

allOf l ≡ iallOf l . const
iallOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
iallOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
iallOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
iallOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

inoneOf :: IndexedGetting i Any s a -> (i -> a -> Bool) -> s -> Bool #

Return whether or not none of the elements viewed through an IndexedFold or IndexedTraversal satisfy a predicate, with access to the i.

When you don't need access to the index then noneOf is more flexible in what it accepts.

noneOf l ≡ inoneOf l . const
inoneOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Bool
inoneOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Bool
inoneOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Bool
inoneOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Bool

itraverseOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> (i -> a -> f r) -> s -> f () #

Traverse the targets of an IndexedFold or IndexedTraversal with access to the i, discarding the results.

When you don't need access to the index then traverseOf_ is more flexible in what it accepts.

traverseOf_ l ≡ itraverseOf l . const
itraverseOf_ :: Functor f     => IndexedGetter i s a     -> (i -> a -> f r) -> s -> f ()
itraverseOf_ :: Applicative f => IndexedFold i s a       -> (i -> a -> f r) -> s -> f ()
itraverseOf_ :: Functor f     => IndexedLens' i s a      -> (i -> a -> f r) -> s -> f ()
itraverseOf_ :: Applicative f => IndexedTraversal' i s a -> (i -> a -> f r) -> s -> f ()

iforOf_ :: Functor f => IndexedGetting i (Traversed r f) s a -> s -> (i -> a -> f r) -> f () #

Traverse the targets of an IndexedFold or IndexedTraversal with access to the index, discarding the results (with the arguments flipped).

iforOf_flip . itraverseOf_

When you don't need access to the index then forOf_ is more flexible in what it accepts.

forOf_ l a ≡ iforOf_ l a . const
iforOf_ :: Functor f     => IndexedGetter i s a     -> s -> (i -> a -> f r) -> f ()
iforOf_ :: Applicative f => IndexedFold i s a       -> s -> (i -> a -> f r) -> f ()
iforOf_ :: Functor f     => IndexedLens' i s a      -> s -> (i -> a -> f r) -> f ()
iforOf_ :: Applicative f => IndexedTraversal' i s a -> s -> (i -> a -> f r) -> f ()

imapMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> (i -> a -> m r) -> s -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results.

When you don't need access to the index then mapMOf_ is more flexible in what it accepts.

mapMOf_ l ≡ imapMOf l . const
imapMOf_ :: Monad m => IndexedGetter i s a     -> (i -> a -> m r) -> s -> m ()
imapMOf_ :: Monad m => IndexedFold i s a       -> (i -> a -> m r) -> s -> m ()
imapMOf_ :: Monad m => IndexedLens' i s a      -> (i -> a -> m r) -> s -> m ()
imapMOf_ :: Monad m => IndexedTraversal' i s a -> (i -> a -> m r) -> s -> m ()

iforMOf_ :: Monad m => IndexedGetting i (Sequenced r m) s a -> s -> (i -> a -> m r) -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results (with the arguments flipped).

iforMOf_flip . imapMOf_

When you don't need access to the index then forMOf_ is more flexible in what it accepts.

forMOf_ l a ≡ iforMOf l a . const
iforMOf_ :: Monad m => IndexedGetter i s a     -> s -> (i -> a -> m r) -> m ()
iforMOf_ :: Monad m => IndexedFold i s a       -> s -> (i -> a -> m r) -> m ()
iforMOf_ :: Monad m => IndexedLens' i s a      -> s -> (i -> a -> m r) -> m ()
iforMOf_ :: Monad m => IndexedTraversal' i s a -> s -> (i -> a -> m r) -> m ()

iconcatMapOf :: IndexedGetting i [r] s a -> (i -> a -> [r]) -> s -> [r] #

Concatenate the results of a function of the elements of an IndexedFold or IndexedTraversal with access to the index.

When you don't need access to the index then concatMapOf is more flexible in what it accepts.

concatMapOf l ≡ iconcatMapOf l . const
iconcatMapOfifoldMapOf
iconcatMapOf :: IndexedGetter i s a     -> (i -> a -> [r]) -> s -> [r]
iconcatMapOf :: IndexedFold i s a       -> (i -> a -> [r]) -> s -> [r]
iconcatMapOf :: IndexedLens' i s a      -> (i -> a -> [r]) -> s -> [r]
iconcatMapOf :: IndexedTraversal' i s a -> (i -> a -> [r]) -> s -> [r]

ifindOf :: IndexedGetting i (Endo (Maybe a)) s a -> (i -> a -> Bool) -> s -> Maybe a #

The ifindOf function takes an IndexedFold or IndexedTraversal, a predicate that is also supplied the index, a structure and returns the left-most element of the structure matching the predicate, or Nothing if there is no such element.

When you don't need access to the index then findOf is more flexible in what it accepts.

findOf l ≡ ifindOf l . const
ifindOf :: IndexedGetter i s a     -> (i -> a -> Bool) -> s -> Maybe a
ifindOf :: IndexedFold i s a       -> (i -> a -> Bool) -> s -> Maybe a
ifindOf :: IndexedLens' i s a      -> (i -> a -> Bool) -> s -> Maybe a
ifindOf :: IndexedTraversal' i s a -> (i -> a -> Bool) -> s -> Maybe a

ifindMOf :: Monad m => IndexedGetting i (Endo (m (Maybe a))) s a -> (i -> a -> m Bool) -> s -> m (Maybe a) #

The ifindMOf function takes an IndexedFold or IndexedTraversal, a monadic predicate that is also supplied the index, a structure and returns in the monad the left-most element of the structure matching the predicate, or Nothing if there is no such element.

When you don't need access to the index then findMOf is more flexible in what it accepts.

findMOf l ≡ ifindMOf l . const
ifindMOf :: Monad m => IndexedGetter i s a     -> (i -> a -> m Bool) -> s -> m (Maybe a)
ifindMOf :: Monad m => IndexedFold i s a       -> (i -> a -> m Bool) -> s -> m (Maybe a)
ifindMOf :: Monad m => IndexedLens' i s a      -> (i -> a -> m Bool) -> s -> m (Maybe a)
ifindMOf :: Monad m => IndexedTraversal' i s a -> (i -> a -> m Bool) -> s -> m (Maybe a)

ifoldrOf' :: IndexedGetting i (Dual (Endo (r -> r))) s a -> (i -> a -> r -> r) -> r -> s -> r #

Strictly fold right over the elements of a structure with an index.

When you don't need access to the index then foldrOf' is more flexible in what it accepts.

foldrOf' l ≡ ifoldrOf' l . const
ifoldrOf' :: IndexedGetter i s a     -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf' :: IndexedFold i s a       -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf' :: IndexedLens' i s a      -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf' :: IndexedTraversal' i s a -> (i -> a -> r -> r) -> r -> s -> r

ifoldlOf' :: IndexedGetting i (Endo (r -> r)) s a -> (i -> r -> a -> r) -> r -> s -> r #

Fold over the elements of a structure with an index, associating to the left, but strictly.

When you don't need access to the index then foldlOf' is more flexible in what it accepts.

foldlOf' l ≡ ifoldlOf' l . const
ifoldlOf' :: IndexedGetter i s a       -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' :: IndexedFold i s a         -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' :: IndexedLens' i s a        -> (i -> r -> a -> r) -> r -> s -> r
ifoldlOf' :: IndexedTraversal' i s a   -> (i -> r -> a -> r) -> r -> s -> r

ifoldrMOf :: Monad m => IndexedGetting i (Dual (Endo (r -> m r))) s a -> (i -> a -> r -> m r) -> r -> s -> m r #

Monadic fold right over the elements of a structure with an index.

When you don't need access to the index then foldrMOf is more flexible in what it accepts.

foldrMOf l ≡ ifoldrMOf l . const
ifoldrMOf :: Monad m => IndexedGetter i s a     -> (i -> a -> r -> m r) -> r -> s -> m r
ifoldrMOf :: Monad m => IndexedFold i s a       -> (i -> a -> r -> m r) -> r -> s -> m r
ifoldrMOf :: Monad m => IndexedLens' i s a      -> (i -> a -> r -> m r) -> r -> s -> m r
ifoldrMOf :: Monad m => IndexedTraversal' i s a -> (i -> a -> r -> m r) -> r -> s -> m r

ifoldlMOf :: Monad m => IndexedGetting i (Endo (r -> m r)) s a -> (i -> r -> a -> m r) -> r -> s -> m r #

Monadic fold over the elements of a structure with an index, associating to the left.

When you don't need access to the index then foldlMOf is more flexible in what it accepts.

foldlMOf l ≡ ifoldlMOf l . const
ifoldlMOf :: Monad m => IndexedGetter i s a     -> (i -> r -> a -> m r) -> r -> s -> m r
ifoldlMOf :: Monad m => IndexedFold i s a       -> (i -> r -> a -> m r) -> r -> s -> m r
ifoldlMOf :: Monad m => IndexedLens' i s a      -> (i -> r -> a -> m r) -> r -> s -> m r
ifoldlMOf :: Monad m => IndexedTraversal' i s a -> (i -> r -> a -> m r) -> r -> s -> m r

itoListOf :: IndexedGetting i (Endo [(i, a)]) s a -> s -> [(i, a)] #

Extract the key-value pairs from a structure.

When you don't need access to the indices in the result, then toListOf is more flexible in what it accepts.

toListOf l ≡ map snd . itoListOf l
itoListOf :: IndexedGetter i s a     -> s -> [(i,a)]
itoListOf :: IndexedFold i s a       -> s -> [(i,a)]
itoListOf :: IndexedLens' i s a      -> s -> [(i,a)]
itoListOf :: IndexedTraversal' i s a -> s -> [(i,a)]

(^@..) :: s -> IndexedGetting i (Endo [(i, a)]) s a -> [(i, a)] infixl 8 #

An infix version of itoListOf.

(^@?) :: s -> IndexedGetting i (Endo (Maybe (i, a))) s a -> Maybe (i, a) infixl 8 #

Perform a safe head (with index) of an IndexedFold or IndexedTraversal or retrieve Just the index and result from an IndexedGetter or IndexedLens.

When using a IndexedTraversal as a partial IndexedLens, or an IndexedFold as a partial IndexedGetter this can be a convenient way to extract the optional value.

(^@?) :: s -> IndexedGetter i s a     -> Maybe (i, a)
(^@?) :: s -> IndexedFold i s a       -> Maybe (i, a)
(^@?) :: s -> IndexedLens' i s a      -> Maybe (i, a)
(^@?) :: s -> IndexedTraversal' i s a -> Maybe (i, a)

(^@?!) :: HasCallStack => s -> IndexedGetting i (Endo (i, a)) s a -> (i, a) infixl 8 #

Perform an *UNSAFE* head (with index) of an IndexedFold or IndexedTraversal assuming that it is there.

(^@?!) :: s -> IndexedGetter i s a     -> (i, a)
(^@?!) :: s -> IndexedFold i s a       -> (i, a)
(^@?!) :: s -> IndexedLens' i s a      -> (i, a)
(^@?!) :: s -> IndexedTraversal' i s a -> (i, a)

elemIndexOf :: Eq a => IndexedGetting i (First i) s a -> a -> s -> Maybe i #

Retrieve the index of the first value targeted by a IndexedFold or IndexedTraversal which is equal to a given value.

elemIndexelemIndexOf folded
elemIndexOf :: Eq a => IndexedFold i s a       -> a -> s -> Maybe i
elemIndexOf :: Eq a => IndexedTraversal' i s a -> a -> s -> Maybe i

elemIndicesOf :: Eq a => IndexedGetting i (Endo [i]) s a -> a -> s -> [i] #

Retrieve the indices of the values targeted by a IndexedFold or IndexedTraversal which are equal to a given value.

elemIndiceselemIndicesOf folded
elemIndicesOf :: Eq a => IndexedFold i s a       -> a -> s -> [i]
elemIndicesOf :: Eq a => IndexedTraversal' i s a -> a -> s -> [i]

findIndexOf :: IndexedGetting i (First i) s a -> (a -> Bool) -> s -> Maybe i #

Retrieve the index of the first value targeted by a IndexedFold or IndexedTraversal which satisfies a predicate.

findIndexfindIndexOf folded
findIndexOf :: IndexedFold i s a       -> (a -> Bool) -> s -> Maybe i
findIndexOf :: IndexedTraversal' i s a -> (a -> Bool) -> s -> Maybe i

findIndicesOf :: IndexedGetting i (Endo [i]) s a -> (a -> Bool) -> s -> [i] #

Retrieve the indices of the values targeted by a IndexedFold or IndexedTraversal which satisfy a predicate.

findIndicesfindIndicesOf folded
findIndicesOf :: IndexedFold i s a       -> (a -> Bool) -> s -> [i]
findIndicesOf :: IndexedTraversal' i s a -> (a -> Bool) -> s -> [i]

ifiltered :: (Indexable i p, Applicative f) => (i -> a -> Bool) -> Optical' p (Indexed i) f a a #

Filter an IndexedFold or IndexedGetter, obtaining an IndexedFold.

>>> [0,0,0,5,5,5]^..traversed.ifiltered (\i a -> i <= a)
[0,5,5,5]

Compose with ifiltered to filter another IndexedLens, IndexedIso, IndexedGetter, IndexedFold (or IndexedTraversal) with access to both the value and the index.

Note: As with filtered, this is not a legal IndexedTraversal, unless you are very careful not to invalidate the predicate on the target!

itakingWhile :: (Indexable i p, Profunctor q, Contravariant f, Applicative f) => (i -> a -> Bool) -> Optical' (Indexed i) q (Const (Endo (f s)) :: Type -> Type) s a -> Optical' p q f s a #

Obtain an IndexedFold by taking elements from another IndexedFold, IndexedLens, IndexedGetter or IndexedTraversal while a predicate holds.

itakingWhile :: (i -> a -> Bool) -> IndexedFold i s a          -> IndexedFold i s a
itakingWhile :: (i -> a -> Bool) -> IndexedTraversal' i s a    -> IndexedFold i s a
itakingWhile :: (i -> a -> Bool) -> IndexedLens' i s a         -> IndexedFold i s a
itakingWhile :: (i -> a -> Bool) -> IndexedGetter i s a        -> IndexedFold i s a

Note: Applying itakingWhile to an IndexedLens or IndexedTraversal will still allow you to use it as a pseudo-IndexedTraversal, but if you change the value of any target to one where the predicate returns False, then you will break the Traversal laws and Traversal fusion will no longer be sound.

idroppingWhile :: (Indexable i p, Profunctor q, Applicative f) => (i -> a -> Bool) -> Optical (Indexed i) q (Compose (State Bool) f) s t a a -> Optical p q f s t a a #

Obtain an IndexedFold by dropping elements from another IndexedFold, IndexedLens, IndexedGetter or IndexedTraversal while a predicate holds.

idroppingWhile :: (i -> a -> Bool) -> IndexedFold i s a          -> IndexedFold i s a
idroppingWhile :: (i -> a -> Bool) -> IndexedTraversal' i s a    -> IndexedFold i s a -- see notes
idroppingWhile :: (i -> a -> Bool) -> IndexedLens' i s a         -> IndexedFold i s a -- see notes
idroppingWhile :: (i -> a -> Bool) -> IndexedGetter i s a        -> IndexedFold i s a

Note: As with droppingWhile applying idroppingWhile to an IndexedLens or IndexedTraversal will still allow you to use it as a pseudo-IndexedTraversal, but if you change the value of the first target to one where the predicate returns True, then you will break the Traversal laws and Traversal fusion will no longer be sound.

foldByOf :: Fold s a -> (a -> a -> a) -> a -> s -> a #

Fold a value using a specified Fold and Monoid operations. This is like foldBy where the Foldable instance can be manually specified.

foldByOf foldedfoldBy
foldByOf :: Getter s a     -> (a -> a -> a) -> a -> s -> a
foldByOf :: Fold s a       -> (a -> a -> a) -> a -> s -> a
foldByOf :: Lens' s a      -> (a -> a -> a) -> a -> s -> a
foldByOf :: Traversal' s a -> (a -> a -> a) -> a -> s -> a
foldByOf :: Iso' s a       -> (a -> a -> a) -> a -> s -> a
>>> foldByOf both (++) [] ("hello","world")
"helloworld"

foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r #

Fold a value using a specified Fold and Monoid operations. This is like foldMapBy where the Foldable instance can be manually specified.

foldMapByOf foldedfoldMapBy
foldMapByOf :: Getter s a     -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Fold s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Traversal' s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Lens' s a      -> (r -> r -> r) -> r -> (a -> r) -> s -> r
foldMapByOf :: Iso' s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r
>>> foldMapByOf both (+) 0 length ("hello","world")
10

class Ord k => TraverseMax k (m :: Type -> Type) | m -> k where #

Allows IndexedTraversal of the value at the largest index.

Methods

traverseMax :: IndexedTraversal' k (m v) v #

IndexedTraversal of the element at the largest index.

Instances
TraverseMax Int IntMap 
Instance details

Defined in Control.Lens.Traversal

Ord k => TraverseMax k (Map k) 
Instance details

Defined in Control.Lens.Traversal

Methods

traverseMax :: IndexedTraversal' k (Map k v) v #

class Ord k => TraverseMin k (m :: Type -> Type) | m -> k where #

Allows IndexedTraversal the value at the smallest index.

Methods

traverseMin :: IndexedTraversal' k (m v) v #

IndexedTraversal of the element with the smallest index.

Instances
TraverseMin Int IntMap 
Instance details

Defined in Control.Lens.Traversal

Ord k => TraverseMin k (Map k) 
Instance details

Defined in Control.Lens.Traversal

Methods

traverseMin :: IndexedTraversal' k (Map k v) v #

type Traversing1' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Traversing1 p f s s a a #

type Traversing' (p :: Type -> Type -> Type) (f :: Type -> Type) s a = Traversing p f s s a a #

type Traversing1 (p :: Type -> Type -> Type) (f :: Type -> Type) s t a b = Over p (BazaarT1 p f a b) s t a b #

type Traversing (p :: Type -> Type -> Type) (f :: Type -> Type) s t a b = Over p (BazaarT p f a b) s t a b #

When you see this as an argument to a function, it expects

type AnIndexedTraversal1 i s t a b = Over (Indexed i) (Bazaar1 (Indexed i) a b) s t a b #

When you see this as an argument to a function, it expects an IndexedTraversal1.

type AnIndexedTraversal i s t a b = Over (Indexed i) (Bazaar (Indexed i) a b) s t a b #

When you see this as an argument to a function, it expects an IndexedTraversal.

type ATraversal1 s t a b = LensLike (Bazaar1 ((->) :: Type -> Type -> Type) a b) s t a b #

When you see this as an argument to a function, it expects a Traversal1.

type ATraversal s t a b = LensLike (Bazaar ((->) :: Type -> Type -> Type) a b) s t a b #

When you see this as an argument to a function, it expects a Traversal.

traverseOf :: LensLike f s t a b -> (a -> f b) -> s -> f t #

Map each element of a structure targeted by a Lens or Traversal, evaluate these actions from left to right, and collect the results.

This function is only provided for consistency, id is strictly more general.

>>> traverseOf each print (1,2,3)
1
2
3
((),(),())
traverseOfid
itraverseOf l ≡ traverseOf l . Indexed
itraverseOf itraverseditraverse

This yields the obvious law:

traversetraverseOf traverse
traverseOf :: Functor f     => Iso s t a b        -> (a -> f b) -> s -> f t
traverseOf :: Functor f     => Lens s t a b       -> (a -> f b) -> s -> f t
traverseOf :: Apply f       => Traversal1 s t a b -> (a -> f b) -> s -> f t
traverseOf :: Applicative f => Traversal s t a b  -> (a -> f b) -> s -> f t

forOf :: LensLike f s t a b -> s -> (a -> f b) -> f t #

A version of traverseOf with the arguments flipped, such that:

>>> forOf each (1,2,3) print
1
2
3
((),(),())

This function is only provided for consistency, flip is strictly more general.

forOfflip
forOfflip . traverseOf
forforOf traverse
ifor l s ≡ for l s . Indexed
forOf :: Functor f => Iso s t a b -> s -> (a -> f b) -> f t
forOf :: Functor f => Lens s t a b -> s -> (a -> f b) -> f t
forOf :: Applicative f => Traversal s t a b -> s -> (a -> f b) -> f t

sequenceAOf :: LensLike f s t (f b) b -> s -> f t #

Evaluate each action in the structure from left to right, and collect the results.

>>> sequenceAOf both ([1,2],[3,4])
[(1,3),(1,4),(2,3),(2,4)]
sequenceAsequenceAOf traversetraverse id
sequenceAOf l ≡ traverseOf l id ≡ l id
sequenceAOf :: Functor f => Iso s t (f b) b       -> s -> f t
sequenceAOf :: Functor f => Lens s t (f b) b      -> s -> f t
sequenceAOf :: Applicative f => Traversal s t (f b) b -> s -> f t

mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t #

Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results.

>>> mapMOf both (\x -> [x, x + 1]) (1,3)
[(1,3),(1,4),(2,3),(2,4)]
mapMmapMOf traverse
imapMOf l ≡ forM l . Indexed
mapMOf :: Monad m => Iso s t a b       -> (a -> m b) -> s -> m t
mapMOf :: Monad m => Lens s t a b      -> (a -> m b) -> s -> m t
mapMOf :: Monad m => Traversal s t a b -> (a -> m b) -> s -> m t

forMOf :: LensLike (WrappedMonad m) s t a b -> s -> (a -> m b) -> m t #

forMOf is a flipped version of mapMOf, consistent with the definition of forM.

>>> forMOf both (1,3) $ \x -> [x, x + 1]
[(1,3),(1,4),(2,3),(2,4)]
forMforMOf traverse
forMOf l ≡ flip (mapMOf l)
iforMOf l s ≡ forM l s . Indexed
forMOf :: Monad m => Iso s t a b       -> s -> (a -> m b) -> m t
forMOf :: Monad m => Lens s t a b      -> s -> (a -> m b) -> m t
forMOf :: Monad m => Traversal s t a b -> s -> (a -> m b) -> m t

sequenceOf :: LensLike (WrappedMonad m) s t (m b) b -> s -> m t #

Sequence the (monadic) effects targeted by a Lens in a container from left to right.

>>> sequenceOf each ([1,2],[3,4],[5,6])
[(1,3,5),(1,3,6),(1,4,5),(1,4,6),(2,3,5),(2,3,6),(2,4,5),(2,4,6)]
sequencesequenceOf traverse
sequenceOf l ≡ mapMOf l id
sequenceOf l ≡ unwrapMonad . l WrapMonad
sequenceOf :: Monad m => Iso s t (m b) b       -> s -> m t
sequenceOf :: Monad m => Lens s t (m b) b      -> s -> m t
sequenceOf :: Monad m => Traversal s t (m b) b -> s -> m t

transposeOf :: LensLike ZipList s t [a] a -> s -> [t] #

This generalizes transpose to an arbitrary Traversal.

Note: transpose handles ragged inputs more intelligently, but for non-ragged inputs:

>>> transposeOf traverse [[1,2,3],[4,5,6]]
[[1,4],[2,5],[3,6]]
transposetransposeOf traverse

Since every Lens is a Traversal, we can use this as a form of monadic strength as well:

transposeOf _2 :: (b, [a]) -> [(b, a)]

mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

This generalizes mapAccumR to an arbitrary Traversal.

mapAccumRmapAccumROf traverse

mapAccumROf accumulates State from right to left.

mapAccumROf :: Iso s t a b       -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumROf :: Lens s t a b      -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumROf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumROf :: LensLike (Backwards (State acc)) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

This generalizes mapAccumL to an arbitrary Traversal.

mapAccumLmapAccumLOf traverse

mapAccumLOf accumulates State from left to right.

mapAccumLOf :: Iso s t a b       -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf :: Lens s t a b      -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf :: Traversal s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf :: LensLike (State acc) s t a b -> (acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
mapAccumLOf l f acc0 s = swap (runState (l (a -> state (acc -> swap (f acc a))) s) acc0)

scanr1Of :: LensLike (Backwards (State (Maybe a))) s t a a -> (a -> a -> a) -> s -> t #

This permits the use of scanr1 over an arbitrary Traversal or Lens.

scanr1scanr1Of traverse
scanr1Of :: Iso s t a a       -> (a -> a -> a) -> s -> t
scanr1Of :: Lens s t a a      -> (a -> a -> a) -> s -> t
scanr1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t

scanl1Of :: LensLike (State (Maybe a)) s t a a -> (a -> a -> a) -> s -> t #

This permits the use of scanl1 over an arbitrary Traversal or Lens.

scanl1scanl1Of traverse
scanl1Of :: Iso s t a a       -> (a -> a -> a) -> s -> t
scanl1Of :: Lens s t a a      -> (a -> a -> a) -> s -> t
scanl1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t

loci :: Traversal (Bazaar ((->) :: Type -> Type -> Type) a c s) (Bazaar ((->) :: Type -> Type -> Type) b c s) a b #

This Traversal allows you to traverse the individual stores in a Bazaar.

iloci :: IndexedTraversal i (Bazaar (Indexed i) a c s) (Bazaar (Indexed i) b c s) a b #

This IndexedTraversal allows you to traverse the individual stores in a Bazaar with access to their indices.

partsOf :: Functor f => Traversing ((->) :: Type -> Type -> Type) f s t a a -> LensLike f s t [a] [a] #

partsOf turns a Traversal into a Lens that resembles an early version of the uniplate (or biplate) type.

Note: You should really try to maintain the invariant of the number of children in the list.

>>> (a,b,c) & partsOf each .~ [x,y,z]
(x,y,z)

Any extras will be lost. If you do not supply enough, then the remainder will come from the original structure.

>>> (a,b,c) & partsOf each .~ [w,x,y,z]
(w,x,y)
>>> (a,b,c) & partsOf each .~ [x,y]
(x,y,c)
>>> ('b', 'a', 'd', 'c') & partsOf each %~ sort
('a','b','c','d')

So technically, this is only a Lens if you do not change the number of results it returns.

When applied to a Fold the result is merely a Getter.

partsOf :: Iso' s a       -> Lens' s [a]
partsOf :: Lens' s a      -> Lens' s [a]
partsOf :: Traversal' s a -> Lens' s [a]
partsOf :: Fold s a       -> Getter s [a]
partsOf :: Getter s a     -> Getter s [a]

ipartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a a -> Over p f s t [a] [a] #

An indexed version of partsOf that receives the entire list of indices as its index.

partsOf' :: ATraversal s t a a -> Lens s t [a] [a] #

A type-restricted version of partsOf that can only be used with a Traversal.

ipartsOf' :: (Indexable [i] p, Functor f) => Over (Indexed i) (Bazaar' (Indexed i) a) s t a a -> Over p f s t [a] [a] #

A type-restricted version of ipartsOf that can only be used with an IndexedTraversal.

unsafePartsOf :: Functor f => Traversing ((->) :: Type -> Type -> Type) f s t a b -> LensLike f s t [a] [b] #

unsafePartsOf turns a Traversal into a uniplate (or biplate) family.

If you do not need the types of s and t to be different, it is recommended that you use partsOf.

It is generally safer to traverse with the Bazaar rather than use this combinator. However, it is sometimes convenient.

This is unsafe because if you don't supply at least as many b's as you were given a's, then the reconstruction of t will result in an error!

When applied to a Fold the result is merely a Getter (and becomes safe).

unsafePartsOf :: Iso s t a b       -> Lens s t [a] [b]
unsafePartsOf :: Lens s t a b      -> Lens s t [a] [b]
unsafePartsOf :: Traversal s t a b -> Lens s t [a] [b]
unsafePartsOf :: Fold s a          -> Getter s [a]
unsafePartsOf :: Getter s a        -> Getter s [a]

iunsafePartsOf :: (Indexable [i] p, Functor f) => Traversing (Indexed i) f s t a b -> Over p f s t [a] [b] #

An indexed version of unsafePartsOf that receives the entire list of indices as its index.

unsafePartsOf' :: ATraversal s t a b -> Lens s t [a] [b] #

iunsafePartsOf' :: Over (Indexed i) (Bazaar (Indexed i) a b) s t a b -> IndexedLens [i] s t [a] [b] #

unsafeSingular :: (HasCallStack, Conjoined p, Functor f) => Traversing p f s t a b -> Over p f s t a b #

This converts a Traversal that you "know" will target only one element to a Lens. It can also be used to transform a Fold into a Getter.

The resulting Lens or Getter will be partial if the Traversal targets nothing or more than one element.

>>> Left (ErrorCall "unsafeSingular: empty traversal") <- try (evaluate ([] & unsafeSingular traverse .~ 0)) :: IO (Either ErrorCall [Integer])
unsafeSingular :: Traversal s t a b          -> Lens s t a b
unsafeSingular :: Fold s a                   -> Getter s a
unsafeSingular :: IndexedTraversal i s t a b -> IndexedLens i s t a b
unsafeSingular :: IndexedFold i s a          -> IndexedGetter i s a

holesOf :: Conjoined p => Over p (Bazaar p a a) s t a a -> s -> [Pretext p a a t] #

The one-level version of contextsOf. This extracts a list of the immediate children according to a given Traversal as editable contexts.

Given a context you can use pos to see the values, peek at what the structure would be like with an edited result, or simply extract the original structure.

propChildren l x = toListOf l x == map pos (holesOf l x)
propId l x = all (== x) [extract w | w <- holesOf l x]
holesOf :: Iso' s a                -> s -> [Pretext' (->) a s]
holesOf :: Lens' s a               -> s -> [Pretext' (->) a s]
holesOf :: Traversal' s a          -> s -> [Pretext' (->) a s]
holesOf :: IndexedLens' i s a      -> s -> [Pretext' (Indexed i) a s]
holesOf :: IndexedTraversal' i s a -> s -> [Pretext' (Indexed i) a s]

holes1Of :: Conjoined p => Over p (Bazaar1 p a a) s t a a -> s -> NonEmpty (Pretext p a a t) #

The non-empty version of holesOf. This extract a non-empty list of immediate children accroding to a given Traversal1 as editable contexts.

>>> let head1 f s = runPretext (NonEmpty.head $ holes1Of traversed1 s) f
>>> ('a' :| "bc") ^. head1
'a'
>>> ('a' :| "bc") & head1 %~ toUpper
'A' :| "bc"
holes1Of :: Iso' s a                 -> s -> NonEmpty (Pretext' (->) a s)
holes1Of :: Lens' s a                -> s -> NonEmpty (Pretext' (->) a s)
holes1Of :: Traversal1' s a          -> s -> NonEmpty (Pretext' (->) a s)
holes1Of :: IndexedLens' i s a       -> s -> NonEmpty (Pretext' (Indexed i) a s)
holes1Of :: IndexedTraversal1' i s a -> s -> NonEmpty (Pretext' (Indexed i) a s)

both :: Bitraversable r => Traversal (r a a) (r b b) a b #

Traverse both parts of a Bitraversable container with matching types.

Usually that type will be a pair.

>>> (1,2) & both *~ 10
(10,20)
>>> over both length ("hello","world")
(5,5)
>>> ("hello","world")^.both
"helloworld"
both :: Traversal (a, a)       (b, b)       a b
both :: Traversal (Either a a) (Either b b) a b

both1 :: Bitraversable1 r => Traversal1 (r a a) (r b b) a b #

Traverse both parts of a Bitraversable1 container with matching types.

Usually that type will be a pair.

both1 :: Traversal1 (a, a)       (b, b)       a b
both1 :: Traversal1 (Either a a) (Either b b) a b

taking :: (Conjoined p, Applicative f) => Int -> Traversing p f s t a a -> Over p f s t a a #

Visit the first n targets of a Traversal, Fold, Getter or Lens.

>>> [("hello","world"),("!!!","!!!")]^.. taking 2 (traverse.both)
["hello","world"]
>>> timingOut $ [1..] ^.. taking 3 traverse
[1,2,3]
>>> over (taking 5 traverse) succ "hello world"
"ifmmp world"
taking :: Int -> Traversal' s a                   -> Traversal' s a
taking :: Int -> Lens' s a                        -> Traversal' s a
taking :: Int -> Iso' s a                         -> Traversal' s a
taking :: Int -> Prism' s a                       -> Traversal' s a
taking :: Int -> Getter s a                       -> Fold s a
taking :: Int -> Fold s a                         -> Fold s a
taking :: Int -> IndexedTraversal' i s a          -> IndexedTraversal' i s a
taking :: Int -> IndexedLens' i s a               -> IndexedTraversal' i s a
taking :: Int -> IndexedGetter i s a              -> IndexedFold i s a
taking :: Int -> IndexedFold i s a                -> IndexedFold i s a

dropping :: (Conjoined p, Applicative f) => Int -> Over p (Indexing f) s t a a -> Over p f s t a a #

Visit all but the first n targets of a Traversal, Fold, Getter or Lens.

>>> ("hello","world") ^? dropping 1 both
Just "world"

Dropping works on infinite traversals as well:

>>> [1..] ^? dropping 1 folded
Just 2
dropping :: Int -> Traversal' s a                   -> Traversal' s a
dropping :: Int -> Lens' s a                        -> Traversal' s a
dropping :: Int -> Iso' s a                         -> Traversal' s a
dropping :: Int -> Prism' s a                       -> Traversal' s a
dropping :: Int -> Getter s a                       -> Fold s a
dropping :: Int -> Fold s a                         -> Fold s a
dropping :: Int -> IndexedTraversal' i s a          -> IndexedTraversal' i s a
dropping :: Int -> IndexedLens' i s a               -> IndexedTraversal' i s a
dropping :: Int -> IndexedGetter i s a              -> IndexedFold i s a
dropping :: Int -> IndexedFold i s a                -> IndexedFold i s a

cloneTraversal :: ATraversal s t a b -> Traversal s t a b #

A Traversal is completely characterized by its behavior on a Bazaar.

Cloning a Traversal is one way to make sure you aren't given something weaker, such as a Fold and can be used as a way to pass around traversals that have to be monomorphic in f.

Note: This only accepts a proper Traversal (or Lens). To clone a Lens as such, use cloneLens.

Note: It is usually better to use ReifiedTraversal and runTraversal than to cloneTraversal. The former can execute at full speed, while the latter needs to round trip through the Bazaar.

>>> let foo l a = (view (getting (cloneTraversal l)) a, set (cloneTraversal l) 10 a)
>>> foo both ("hello","world")
("helloworld",(10,10))
cloneTraversal :: LensLike (Bazaar (->) a b) s t a b -> Traversal s t a b

cloneIndexPreservingTraversal :: ATraversal s t a b -> IndexPreservingTraversal s t a b #

Clone a Traversal yielding an IndexPreservingTraversal that passes through whatever index it is composed with.

cloneIndexedTraversal :: AnIndexedTraversal i s t a b -> IndexedTraversal i s t a b #

Clone an IndexedTraversal yielding an IndexedTraversal with the same index.

cloneTraversal1 :: ATraversal1 s t a b -> Traversal1 s t a b #

A Traversal1 is completely characterized by its behavior on a Bazaar1.

cloneIndexPreservingTraversal1 :: ATraversal1 s t a b -> IndexPreservingTraversal1 s t a b #

Clone a Traversal1 yielding an IndexPreservingTraversal1 that passes through whatever index it is composed with.

cloneIndexedTraversal1 :: AnIndexedTraversal1 i s t a b -> IndexedTraversal1 i s t a b #

Clone an IndexedTraversal1 yielding an IndexedTraversal1 with the same index.

itraverseOf :: (Indexed i a (f b) -> s -> f t) -> (i -> a -> f b) -> s -> f t #

Traversal with an index.

NB: When you don't need access to the index then you can just apply your IndexedTraversal directly as a function!

itraverseOfwithIndex
traverseOf l = itraverseOf l . const = id
itraverseOf :: Functor f     => IndexedLens i s t a b       -> (i -> a -> f b) -> s -> f t
itraverseOf :: Applicative f => IndexedTraversal i s t a b  -> (i -> a -> f b) -> s -> f t
itraverseOf :: Apply f       => IndexedTraversal1 i s t a b -> (i -> a -> f b) -> s -> f t

iforOf :: (Indexed i a (f b) -> s -> f t) -> s -> (i -> a -> f b) -> f t #

Traverse with an index (and the arguments flipped).

forOf l a ≡ iforOf l a . const
iforOfflip . itraverseOf
iforOf :: Functor f     => IndexedLens i s t a b       -> s -> (i -> a -> f b) -> f t
iforOf :: Applicative f => IndexedTraversal i s t a b  -> s -> (i -> a -> f b) -> f t
iforOf :: Apply f       => IndexedTraversal1 i s t a b -> s -> (i -> a -> f b) -> f t

imapMOf :: Over (Indexed i) (WrappedMonad m) s t a b -> (i -> a -> m b) -> s -> m t #

Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results, with access its position.

When you don't need access to the index mapMOf is more liberal in what it can accept.

mapMOf l ≡ imapMOf l . const
imapMOf :: Monad m => IndexedLens       i s t a b -> (i -> a -> m b) -> s -> m t
imapMOf :: Monad m => IndexedTraversal  i s t a b -> (i -> a -> m b) -> s -> m t
imapMOf :: Bind  m => IndexedTraversal1 i s t a b -> (i -> a -> m b) -> s -> m t

iforMOf :: (Indexed i a (WrappedMonad m b) -> s -> WrappedMonad m t) -> s -> (i -> a -> m b) -> m t #

Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results, with access its position (and the arguments flipped).

forMOf l a ≡ iforMOf l a . const
iforMOfflip . imapMOf
iforMOf :: Monad m => IndexedLens i s t a b      -> s -> (i -> a -> m b) -> m t
iforMOf :: Monad m => IndexedTraversal i s t a b -> s -> (i -> a -> m b) -> m t

imapAccumROf :: Over (Indexed i) (Backwards (State acc)) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

Generalizes mapAccumR to an arbitrary IndexedTraversal with access to the index.

imapAccumROf accumulates state from right to left.

mapAccumROf l ≡ imapAccumROf l . const
imapAccumROf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
imapAccumROf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

imapAccumLOf :: Over (Indexed i) (State acc) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t) #

Generalizes mapAccumL to an arbitrary IndexedTraversal with access to the index.

imapAccumLOf accumulates state from left to right.

mapAccumLOf l ≡ imapAccumLOf l . const
imapAccumLOf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
imapAccumLOf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

traversed :: Traversable f => IndexedTraversal Int (f a) (f b) a b #

Traverse any Traversable container. This is an IndexedTraversal that is indexed by ordinal position.

traversed1 :: Traversable1 f => IndexedTraversal1 Int (f a) (f b) a b #

Traverse any Traversable1 container. This is an IndexedTraversal1 that is indexed by ordinal position.

traversed64 :: Traversable f => IndexedTraversal Int64 (f a) (f b) a b #

Traverse any Traversable container. This is an IndexedTraversal that is indexed by ordinal position.

ignored :: Applicative f => pafb -> s -> f s #

This is the trivial empty Traversal.

ignored :: IndexedTraversal i s s a b
ignoredconst pure
>>> 6 & ignored %~ absurd
6

elementOf :: Applicative f => LensLike (Indexing f) s t a a -> Int -> IndexedLensLike Int f s t a a #

Traverse the nth elementOf a Traversal, Lens or Iso if it exists.

>>> [[1],[3,4]] & elementOf (traverse.traverse) 1 .~ 5
[[1],[5,4]]
>>> [[1],[3,4]] ^? elementOf (folded.folded) 1
Just 3
>>> timingOut $ ['a'..] ^?! elementOf folded 5
'f'
>>> timingOut $ take 10 $ elementOf traverse 3 .~ 16 $ [0..]
[0,1,2,16,4,5,6,7,8,9]
elementOf :: Traversal' s a -> Int -> IndexedTraversal' Int s a
elementOf :: Fold s a       -> Int -> IndexedFold Int s a

element :: Traversable t => Int -> IndexedTraversal' Int (t a) a #

Traverse the nth element of a Traversable container.

elementelementOf traverse

elementsOf :: Applicative f => LensLike (Indexing f) s t a a -> (Int -> Bool) -> IndexedLensLike Int f s t a a #

Traverse (or fold) selected elements of a Traversal (or Fold) where their ordinal positions match a predicate.

elementsOf :: Traversal' s a -> (Int -> Bool) -> IndexedTraversal' Int s a
elementsOf :: Fold s a       -> (Int -> Bool) -> IndexedFold Int s a

elements :: Traversable t => (Int -> Bool) -> IndexedTraversal' Int (t a) a #

Traverse elements of a Traversable container where their ordinal positions match a predicate.

elementselementsOf traverse

failover :: Alternative m => LensLike ((,) Any) s t a b -> (a -> b) -> s -> m t #

Try to map a function over this Traversal, failing if the Traversal has no targets.

>>> failover (element 3) (*2) [1,2] :: Maybe [Int]
Nothing
>>> failover _Left (*2) (Right 4) :: Maybe (Either Int Int)
Nothing
>>> failover _Right (*2) (Right 4) :: Maybe (Either Int Int)
Just (Right 8)
failover :: Alternative m => Traversal s t a b -> (a -> b) -> s -> m t

ifailover :: Alternative m => Over (Indexed i) ((,) Any) s t a b -> (i -> a -> b) -> s -> m t #

Try to map a function which uses the index over this IndexedTraversal, failing if the IndexedTraversal has no targets.

ifailover :: Alternative m => IndexedTraversal i s t a b -> (i -> a -> b) -> s -> m t

failing :: (Conjoined p, Applicative f) => Traversing p f s t a b -> Over p f s t a b -> Over p f s t a b infixl 5 #

Try the first Traversal (or Fold), falling back on the second Traversal (or Fold) if it returns no entries.

This is only a valid Traversal if the second Traversal is disjoint from the result of the first or returns exactly the same results. These conditions are trivially met when given a Lens, Iso, Getter, Prism or "affine" Traversal -- one that has 0 or 1 target.

Mutatis mutandis for Fold.

>>> [0,1,2,3] ^? failing (ix 1) (ix 2)
Just 1
>>> [0,1,2,3] ^? failing (ix 42) (ix 2)
Just 2
failing :: Traversal s t a b -> Traversal s t a b -> Traversal s t a b
failing :: Prism s t a b     -> Prism s t a b     -> Traversal s t a b
failing :: Fold s a          -> Fold s a          -> Fold s a

These cases are also supported, trivially, but are boring, because the left hand side always succeeds.

failing :: Lens s t a b      -> Traversal s t a b -> Traversal s t a b
failing :: Iso s t a b       -> Traversal s t a b -> Traversal s t a b
failing :: Equality s t a b  -> Traversal s t a b -> Traversal s t a b
failing :: Getter s a        -> Fold s a          -> Fold s a

If both of the inputs are indexed, the result is also indexed, so you can apply this to a pair of indexed traversals or indexed folds, obtaining an indexed traversal or indexed fold.

failing :: IndexedTraversal i s t a b -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b
failing :: IndexedFold i s a          -> IndexedFold i s a          -> IndexedFold i s a

These cases are also supported, trivially, but are boring, because the left hand side always succeeds.

failing :: IndexedLens i s t a b      -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b
failing :: IndexedGetter i s a        -> IndexedGetter i s a        -> IndexedFold i s a

deepOf :: (Conjoined p, Applicative f) => LensLike f s t s t -> Traversing p f s t a b -> Over p f s t a b #

Try the second traversal. If it returns no entries, try again with all entries from the first traversal, recursively.

deepOf :: Fold s s          -> Fold s a                   -> Fold s a
deepOf :: Traversal' s s    -> Traversal' s a             -> Traversal' s a
deepOf :: Traversal s t s t -> Traversal s t a b          -> Traversal s t a b
deepOf :: Fold s s          -> IndexedFold i s a          -> IndexedFold i s a
deepOf :: Traversal s t s t -> IndexedTraversal i s t a b -> IndexedTraversal i s t a b

confusing :: Applicative f => LensLike (Curried (Yoneda f) (Yoneda f)) s t a b -> LensLike f s t a b #

Fuse a Traversal by reassociating all of the (<*>) operations to the left and fusing all of the fmap calls into one. This is particularly useful when constructing a Traversal using operations from GHC.Generics.

Given a pair of Traversals foo and bar,

confusing (foo.bar) = foo.bar

However, foo and bar are each going to use the Applicative they are given.

confusing exploits the Yoneda lemma to merge their separate uses of fmap into a single fmap. and it further exploits an interesting property of the right Kan lift (or Curried) to left associate all of the uses of (<*>) to make it possible to fuse together more fmaps.

This is particularly effective when the choice of functor f is unknown at compile time or when the Traversal foo.bar in the above description is recursive or complex enough to prevent inlining.

fusing is a version of this combinator suitable for fusing lenses.

confusing :: Traversal s t a b -> Traversal s t a b

traverseByOf :: Traversal s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (a -> f b) -> s -> f t #

Traverse a container using a specified Applicative.

This is like traverseBy where the Traversable instance can be specified by any Traversal

traverseByOf traversetraverseBy

sequenceByOf :: Traversal s t (f b) b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> s -> f t #

Sequence a container using a specified Applicative.

This is like traverseBy where the Traversable instance can be specified by any Traversal

sequenceByOf traversesequenceBy

ilevels :: Applicative f => Traversing (Indexed i) f s t a b -> IndexedLensLike Int f s t (Level i a) (Level j b) #

This provides a breadth-first Traversal or Fold of the individual levels of any other Traversal or Fold via iterative deepening depth-first search. The levels are returned to you in a compressed format.

This is similar to levels, but retains the index of the original IndexedTraversal, so you can access it when traversing the levels later on.

>>> ["dog","cat"]^@..ilevels (traversed<.>traversed).itraversed
[((0,0),'d'),((0,1),'o'),((1,0),'c'),((0,2),'g'),((1,1),'a'),((1,2),'t')]

The resulting Traversal of the levels which is indexed by the depth of each Level.

>>> ["dog","cat"]^@..ilevels (traversed<.>traversed)<.>itraversed
[((2,(0,0)),'d'),((3,(0,1)),'o'),((3,(1,0)),'c'),((4,(0,2)),'g'),((4,(1,1)),'a'),((5,(1,2)),'t')]
ilevels :: IndexedTraversal i s t a b      -> IndexedTraversal Int s t (Level i a) (Level i b)
ilevels :: IndexedFold i s a               -> IndexedFold Int s (Level i a)

Note: Internally this is implemented by using an illegal Applicative, as it extracts information in an order that violates the Applicative laws.

newtype ReifiedPrism s t a b #

Reify a ReifiedPrism so it can be stored safely in a container.

Constructors

Prism 

Fields

newtype ReifiedIso s t a b #

Reify an ReifiedIso so it can be stored safely in a container.

Constructors

Iso 

Fields

newtype ReifiedIndexedSetter i s t a b #

Reify an ReifiedIndexedSetter so it can be stored safely in a container.

Constructors

IndexedSetter 

Fields

newtype ReifiedSetter s t a b #

Reify a ReifiedSetter so it can be stored safely in a container.

Constructors

Setter 

Fields

newtype ReifiedIndexedFold i s a #

Constructors

IndexedFold 

Fields

Instances
Profunctor (ReifiedIndexedFold i) 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(#.) :: Coercible c b => q b c -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(.#) :: Coercible b a => ReifiedIndexedFold i b c -> q a b -> ReifiedIndexedFold i a c #

Representable (ReifiedIndexedFold i) 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep (ReifiedIndexedFold i) :: Type -> Type #

Methods

tabulate :: (d -> Rep (ReifiedIndexedFold i) c) -> ReifiedIndexedFold i d c #

Strong (ReifiedIndexedFold i) 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (a, c) (b, c) #

second' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (c, a) (c, b) #

Sieve (ReifiedIndexedFold i) (Compose [] ((,) i)) 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedIndexedFold i a b -> a -> Compose [] ((,) i) b #

Functor (ReifiedIndexedFold i s) 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s b #

(<$) :: a -> ReifiedIndexedFold i s b -> ReifiedIndexedFold i s a #

Plus (ReifiedIndexedFold i s) 
Instance details

Defined in Control.Lens.Reified

Methods

zero :: ReifiedIndexedFold i s a #

Alt (ReifiedIndexedFold i s) 
Instance details

Defined in Control.Lens.Reified

Semigroup (ReifiedIndexedFold i s a) 
Instance details

Defined in Control.Lens.Reified

Monoid (ReifiedIndexedFold i s a) 
Instance details

Defined in Control.Lens.Reified

type Rep (ReifiedIndexedFold i) 
Instance details

Defined in Control.Lens.Reified

type Rep (ReifiedIndexedFold i) = Compose [] ((,) i)

newtype ReifiedFold s a #

Reify a ReifiedFold so it can be stored safely in a container.

This can also be useful for creatively combining folds as ReifiedFold s is isomorphic to ReaderT s [] and provides similar instances.

>>> ("hello","world")^..runFold ((,) <$> Fold _2 <*> Fold both)
[("world","hello"),("world","world")]

Constructors

Fold 

Fields

Instances
Arrow ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

arr :: (b -> c) -> ReifiedFold b c #

first :: ReifiedFold b c -> ReifiedFold (b, d) (c, d) #

second :: ReifiedFold b c -> ReifiedFold (d, b) (d, c) #

(***) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (b, b') (c, c') #

(&&&) :: ReifiedFold b c -> ReifiedFold b c' -> ReifiedFold b (c, c') #

ArrowChoice ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

left :: ReifiedFold b c -> ReifiedFold (Either b d) (Either c d) #

right :: ReifiedFold b c -> ReifiedFold (Either d b) (Either d c) #

(+++) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (Either b b') (Either c c') #

(|||) :: ReifiedFold b d -> ReifiedFold c d -> ReifiedFold (Either b c) d #

ArrowApply ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

app :: ReifiedFold (ReifiedFold b c, b) c #

Choice ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

left' :: ReifiedFold a b -> ReifiedFold (Either a c) (Either b c) #

right' :: ReifiedFold a b -> ReifiedFold (Either c a) (Either c b) #

Profunctor ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(#.) :: Coercible c b => q b c -> ReifiedFold a b -> ReifiedFold a c #

(.#) :: Coercible b a => ReifiedFold b c -> q a b -> ReifiedFold a c #

Representable ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep ReifiedFold :: Type -> Type #

Methods

tabulate :: (d -> Rep ReifiedFold c) -> ReifiedFold d c #

Strong ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedFold a b -> ReifiedFold (a, c) (b, c) #

second' :: ReifiedFold a b -> ReifiedFold (c, a) (c, b) #

Sieve ReifiedFold [] 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedFold a b -> a -> [b] #

MonadReader s (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

ask :: ReifiedFold s s #

local :: (s -> s) -> ReifiedFold s a -> ReifiedFold s a #

reader :: (s -> a) -> ReifiedFold s a #

Monad (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

(>>=) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

(>>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

return :: a -> ReifiedFold s a #

fail :: String -> ReifiedFold s a #

Functor (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(<$) :: a -> ReifiedFold s b -> ReifiedFold s a #

Applicative (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedFold s a #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

liftA2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

MonadPlus (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

mzero :: ReifiedFold s a #

mplus :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

Alternative (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

empty :: ReifiedFold s a #

(<|>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

some :: ReifiedFold s a -> ReifiedFold s [a] #

many :: ReifiedFold s a -> ReifiedFold s [a] #

Apply (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

(<.>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(.>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<.) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

liftF2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c #

Plus (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

zero :: ReifiedFold s a #

Alt (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Bind (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

(>>-) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

join :: ReifiedFold s (ReifiedFold s a) -> ReifiedFold s a #

Category ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

id :: ReifiedFold a a #

(.) :: ReifiedFold b c -> ReifiedFold a b -> ReifiedFold a c #

Semigroup (ReifiedFold s a) 
Instance details

Defined in Control.Lens.Reified

Methods

(<>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

sconcat :: NonEmpty (ReifiedFold s a) -> ReifiedFold s a #

stimes :: Integral b => b -> ReifiedFold s a -> ReifiedFold s a #

Monoid (ReifiedFold s a) 
Instance details

Defined in Control.Lens.Reified

Methods

mempty :: ReifiedFold s a #

mappend :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

mconcat :: [ReifiedFold s a] -> ReifiedFold s a #

type Rep ReifiedFold 
Instance details

Defined in Control.Lens.Reified

type Rep ReifiedFold = []

newtype ReifiedIndexedGetter i s a #

Reify an ReifiedIndexedGetter so it can be stored safely in a container.

Constructors

IndexedGetter 
Instances
Profunctor (ReifiedIndexedGetter i) 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(#.) :: Coercible c b => q b c -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(.#) :: Coercible b a => ReifiedIndexedGetter i b c -> q a b -> ReifiedIndexedGetter i a c #

Representable (ReifiedIndexedGetter i) 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep (ReifiedIndexedGetter i) :: Type -> Type #

Methods

tabulate :: (d -> Rep (ReifiedIndexedGetter i) c) -> ReifiedIndexedGetter i d c #

Strong (ReifiedIndexedGetter i) 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (a, c) (b, c) #

second' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (c, a) (c, b) #

Sieve (ReifiedIndexedGetter i) ((,) i) 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedIndexedGetter i a b -> a -> (i, b) #

Functor (ReifiedIndexedGetter i s) 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b #

(<$) :: a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a #

Semigroup i => Apply (ReifiedIndexedGetter i s) 
Instance details

Defined in Control.Lens.Reified

type Rep (ReifiedIndexedGetter i) 
Instance details

Defined in Control.Lens.Reified

newtype ReifiedGetter s a #

Reify a ReifiedGetter so it can be stored safely in a container.

This can also be useful when combining getters in novel ways, as ReifiedGetter is isomorphic to '(->)' and provides similar instances.

>>> ("hello","world","!!!")^.runGetter ((,) <$> Getter _2 <*> Getter (_1.to length))
("world",5)

Constructors

Getter 

Fields

Instances
Arrow ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

arr :: (b -> c) -> ReifiedGetter b c #

first :: ReifiedGetter b c -> ReifiedGetter (b, d) (c, d) #

second :: ReifiedGetter b c -> ReifiedGetter (d, b) (d, c) #

(***) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (b, b') (c, c') #

(&&&) :: ReifiedGetter b c -> ReifiedGetter b c' -> ReifiedGetter b (c, c') #

ArrowChoice ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

left :: ReifiedGetter b c -> ReifiedGetter (Either b d) (Either c d) #

right :: ReifiedGetter b c -> ReifiedGetter (Either d b) (Either d c) #

(+++) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (Either b b') (Either c c') #

(|||) :: ReifiedGetter b d -> ReifiedGetter c d -> ReifiedGetter (Either b c) d #

ArrowApply ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

app :: ReifiedGetter (ReifiedGetter b c, b) c #

ArrowLoop ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

loop :: ReifiedGetter (b, d) (c, d) -> ReifiedGetter b c #

Choice ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

left' :: ReifiedGetter a b -> ReifiedGetter (Either a c) (Either b c) #

right' :: ReifiedGetter a b -> ReifiedGetter (Either c a) (Either c b) #

Conjoined ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) #

conjoined :: ((ReifiedGetter ~ (->)) -> q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r #

Profunctor ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(#.) :: Coercible c b => q b c -> ReifiedGetter a b -> ReifiedGetter a c #

(.#) :: Coercible b a => ReifiedGetter b c -> q a b -> ReifiedGetter a c #

Representable ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep ReifiedGetter :: Type -> Type #

Methods

tabulate :: (d -> Rep ReifiedGetter c) -> ReifiedGetter d c #

Corepresentable ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Corep ReifiedGetter :: Type -> Type #

Methods

cotabulate :: (Corep ReifiedGetter d -> c) -> ReifiedGetter d c #

Closed ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

closed :: ReifiedGetter a b -> ReifiedGetter (x -> a) (x -> b) #

Strong ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedGetter a b -> ReifiedGetter (a, c) (b, c) #

second' :: ReifiedGetter a b -> ReifiedGetter (c, a) (c, b) #

Costrong ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

unfirst :: ReifiedGetter (a, d) (b, d) -> ReifiedGetter a b #

unsecond :: ReifiedGetter (d, a) (d, b) -> ReifiedGetter a b #

Sieve ReifiedGetter Identity 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedGetter a b -> a -> Identity b #

Cosieve ReifiedGetter Identity 
Instance details

Defined in Control.Lens.Reified

Methods

cosieve :: ReifiedGetter a b -> Identity a -> b #

MonadReader s (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

ask :: ReifiedGetter s s #

local :: (s -> s) -> ReifiedGetter s a -> ReifiedGetter s a #

reader :: (s -> a) -> ReifiedGetter s a #

Monad (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

(>>=) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

(>>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

return :: a -> ReifiedGetter s a #

fail :: String -> ReifiedGetter s a #

Functor (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(<$) :: a -> ReifiedGetter s b -> ReifiedGetter s a #

Applicative (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedGetter s a #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

liftA2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Apply (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

(<.>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(.>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<.) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

liftF2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c #

Distributive (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

distribute :: Functor f => f (ReifiedGetter s a) -> ReifiedGetter s (f a) #

collect :: Functor f => (a -> ReifiedGetter s b) -> f a -> ReifiedGetter s (f b) #

distributeM :: Monad m => m (ReifiedGetter s a) -> ReifiedGetter s (m a) #

collectM :: Monad m => (a -> ReifiedGetter s b) -> m a -> ReifiedGetter s (m b) #

Monoid s => Comonad (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Monoid s => ComonadApply (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

(<@>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(@>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<@) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Bind (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

(>>-) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

join :: ReifiedGetter s (ReifiedGetter s a) -> ReifiedGetter s a #

Semigroup s => Extend (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Category ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

id :: ReifiedGetter a a #

(.) :: ReifiedGetter b c -> ReifiedGetter a b -> ReifiedGetter a c #

type Rep ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

type Corep ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

newtype ReifiedTraversal s t a b #

A form of ReifiedTraversal that can be stored monomorphically in a container.

Constructors

Traversal 

Fields

newtype ReifiedIndexedTraversal i s t a b #

Reify an ReifiedIndexedTraversal so it can be stored safely in a container.

Constructors

IndexedTraversal 

newtype ReifiedIndexedLens i s t a b #

Reify an ReifiedIndexedLens so it can be stored safely in a container.

Constructors

IndexedLens 

Fields

newtype ReifiedLens s t a b #

Reify a ReifiedLens so it can be stored safely in a container.

Constructors

Lens 

Fields

class (FunctorWithIndex i t, FoldableWithIndex i t, Traversable t) => TraversableWithIndex i (t :: Type -> Type) | t -> i where #

A Traversable with an additional index.

An instance must satisfy a (modified) form of the Traversable laws:

itraverse (const Identity) ≡ Identity
fmap (itraverse f) . itraverse g ≡ getCompose . itraverse (\i -> Compose . fmap (f i) . g i)

Minimal complete definition

Nothing

Methods

itraverse :: Applicative f => (i -> a -> f b) -> t a -> f (t b) #

Traverse an indexed container.

itraverseitraverseOf itraversed

itraversed :: IndexedTraversal i (t a) (t b) a b #

Instances
TraversableWithIndex Int [] 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> [a] -> f [b] #

itraversed :: IndexedTraversal Int [a] [b] a b #

TraversableWithIndex Int ZipList 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> ZipList a -> f (ZipList b) #

itraversed :: IndexedTraversal Int (ZipList a) (ZipList b) a b #

TraversableWithIndex Int NonEmpty 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> NonEmpty a -> f (NonEmpty b) #

itraversed :: IndexedTraversal Int (NonEmpty a) (NonEmpty b) a b #

TraversableWithIndex Int Vector 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> Vector a -> f (Vector b) #

itraversed :: IndexedTraversal Int (Vector a) (Vector b) a b #

TraversableWithIndex Int IntMap 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> IntMap a -> f (IntMap b) #

itraversed :: IndexedTraversal Int (IntMap a) (IntMap b) a b #

TraversableWithIndex Int Seq 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> Seq a -> f (Seq b) #

itraversed :: IndexedTraversal Int (Seq a) (Seq b) a b #

TraversableWithIndex () Maybe 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Maybe a -> f (Maybe b) #

itraversed :: IndexedTraversal () (Maybe a) (Maybe b) a b #

TraversableWithIndex () Par1 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Par1 a -> f (Par1 b) #

itraversed :: IndexedTraversal () (Par1 a) (Par1 b) a b #

TraversableWithIndex () Identity 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Identity a -> f (Identity b) #

itraversed :: IndexedTraversal () (Identity a) (Identity b) a b #

TraversableWithIndex k (Map k) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (k -> a -> f b) -> Map k a -> f (Map k b) #

itraversed :: IndexedTraversal k (Map k a) (Map k b) a b #

TraversableWithIndex k (HashMap k) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (k -> a -> f b) -> HashMap k a -> f (HashMap k b) #

itraversed :: IndexedTraversal k (HashMap k a) (HashMap k b) a b #

TraversableWithIndex k ((,) k) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (k -> a -> f b) -> (k, a) -> f (k, b) #

itraversed :: IndexedTraversal k (k, a) (k, b) a b #

TraversableWithIndex i (Level i) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (i -> a -> f b) -> Level i a -> f (Level i b) #

itraversed :: IndexedTraversal i (Level i a) (Level i b) a b #

Ix i => TraversableWithIndex i (Array i) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (i -> a -> f b) -> Array i a -> f (Array i b) #

itraversed :: IndexedTraversal i (Array i a) (Array i b) a b #

TraversableWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> V1 a -> f (V1 b) #

itraversed :: IndexedTraversal Void (V1 a) (V1 b) a b #

TraversableWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> U1 a -> f (U1 b) #

itraversed :: IndexedTraversal Void (U1 a) (U1 b) a b #

TraversableWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> Proxy a -> f (Proxy b) #

itraversed :: IndexedTraversal Void (Proxy a) (Proxy b) a b #

TraversableWithIndex Int (V n) 
Instance details

Defined in Linear.V

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> V n a -> f (V n b) #

itraversed :: IndexedTraversal Int (V n a) (V n b) a b #

TraversableWithIndex () (Tagged a) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (() -> a0 -> f b) -> Tagged a a0 -> f (Tagged a b) #

itraversed :: IndexedTraversal () (Tagged a a0) (Tagged a b) a0 b #

TraversableWithIndex i f => TraversableWithIndex i (Reverse f) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => (i -> a -> f0 b) -> Reverse f a -> f0 (Reverse f b) #

itraversed :: IndexedTraversal i (Reverse f a) (Reverse f b) a b #

TraversableWithIndex i f => TraversableWithIndex i (Rec1 f) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => (i -> a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) #

itraversed :: IndexedTraversal i (Rec1 f a) (Rec1 f b) a b #

TraversableWithIndex i m => TraversableWithIndex i (IdentityT m) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (i -> a -> f b) -> IdentityT m a -> f (IdentityT m b) #

itraversed :: IndexedTraversal i (IdentityT m a) (IdentityT m b) a b #

TraversableWithIndex i f => TraversableWithIndex i (Backwards f) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => (i -> a -> f0 b) -> Backwards f a -> f0 (Backwards f b) #

itraversed :: IndexedTraversal i (Backwards f a) (Backwards f b) a b #

TraversableWithIndex i (Magma i t b) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (i -> a -> f b0) -> Magma i t b a -> f (Magma i t b b0) #

itraversed :: IndexedTraversal i (Magma i t b a) (Magma i t b b0) a b0 #

TraversableWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> K1 i c a -> f (K1 i c b) #

itraversed :: IndexedTraversal Void (K1 i c a) (K1 i c b) a b #

TraversableWithIndex [Int] Tree 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f => ([Int] -> a -> f b) -> Tree a -> f (Tree b) #

itraversed :: IndexedTraversal [Int] (Tree a) (Tree b) a b #

TraversableWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

itraverse :: Applicative f => (E V2 -> a -> f b) -> V2 a -> f (V2 b) #

itraversed :: IndexedTraversal (E V2) (V2 a) (V2 b) a b #

TraversableWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

itraverse :: Applicative f => (E V3 -> a -> f b) -> V3 a -> f (V3 b) #

itraversed :: IndexedTraversal (E V3) (V3 a) (V3 b) a b #

TraversableWithIndex (E Plucker) Plucker 
Instance details

Defined in Linear.Plucker

Methods

itraverse :: Applicative f => (E Plucker -> a -> f b) -> Plucker a -> f (Plucker b) #

itraversed :: IndexedTraversal (E Plucker) (Plucker a) (Plucker b) a b #

TraversableWithIndex (E Quaternion) Quaternion 
Instance details

Defined in Linear.Quaternion

TraversableWithIndex (E V0) V0 
Instance details

Defined in Linear.V0

Methods

itraverse :: Applicative f => (E V0 -> a -> f b) -> V0 a -> f (V0 b) #

itraversed :: IndexedTraversal (E V0) (V0 a) (V0 b) a b #

TraversableWithIndex (E V4) V4 
Instance details

Defined in Linear.V4

Methods

itraverse :: Applicative f => (E V4 -> a -> f b) -> V4 a -> f (V4 b) #

itraversed :: IndexedTraversal (E V4) (V4 a) (V4 b) a b #

TraversableWithIndex (E V1) V1 
Instance details

Defined in Linear.V1

Methods

itraverse :: Applicative f => (E V1 -> a -> f b) -> V1 a -> f (V1 b) #

itraversed :: IndexedTraversal (E V1) (V1 a) (V1 b) a b #

TraversableWithIndex i f => TraversableWithIndex [i] (Free f) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => ([i] -> a -> f0 b) -> Free f a -> f0 (Free f b) #

itraversed :: IndexedTraversal [i] (Free f a) (Free f b) a b #

TraversableWithIndex i f => TraversableWithIndex [i] (Cofree f) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => ([i] -> a -> f0 b) -> Cofree f a -> f0 (Cofree f b) #

itraversed :: IndexedTraversal [i] (Cofree f a) (Cofree f b) a b #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (Sum f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> Sum f g a -> f0 (Sum f g b) #

itraversed :: IndexedTraversal (Either i j) (Sum f g a) (Sum f g b) a b #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (Product f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> Product f g a -> f0 (Product f g b) #

itraversed :: IndexedTraversal (Either i j) (Product f g a) (Product f g b) a b #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (f :+: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #

itraversed :: IndexedTraversal (Either i j) ((f :+: g) a) ((f :+: g) b) a b #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (f :*: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

itraversed :: IndexedTraversal (Either i j) ((f :*: g) a) ((f :*: g) b) a b #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (i, j) (Compose f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => ((i, j) -> a -> f0 b) -> Compose f g a -> f0 (Compose f g b) #

itraversed :: IndexedTraversal (i, j) (Compose f g a) (Compose f g b) a b #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (i, j) (f :.: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

itraverse :: Applicative f0 => ((i, j) -> a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) #

itraversed :: IndexedTraversal (i, j) ((f :.: g) a) ((f :.: g) b) a b #

class Foldable f => FoldableWithIndex i (f :: Type -> Type) | f -> i where #

A container that supports folding with an additional index.

Minimal complete definition

Nothing

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> f a -> m #

Fold a container by mapping value to an arbitrary Monoid with access to the index i.

When you don't need access to the index then foldMap is more flexible in what it accepts.

foldMapifoldMap . const

ifolded :: IndexedFold i (f a) a #

The IndexedFold of a FoldableWithIndex container.

ifolded . asIndex is a fold over the keys of a FoldableWithIndex.

>>> Data.Map.fromList [(2, "hello"), (1, "world")]^..ifolded.asIndex
[1,2]

ifoldr :: (i -> a -> b -> b) -> b -> f a -> b #

Right-associative fold of an indexed container with access to the index i.

When you don't need access to the index then foldr is more flexible in what it accepts.

foldrifoldr . const

ifoldl :: (i -> b -> a -> b) -> b -> f a -> b #

Left-associative fold of an indexed container with access to the index i.

When you don't need access to the index then foldl is more flexible in what it accepts.

foldlifoldl . const

ifoldr' :: (i -> a -> b -> b) -> b -> f a -> b #

Strictly fold right over the elements of a structure with access to the index i.

When you don't need access to the index then Foldable is more flexible in what it accepts.

Foldableifoldr' . const

ifoldl' :: (i -> b -> a -> b) -> b -> f a -> b #

Fold over the elements of a structure with an index, associating to the left, but strictly.

When you don't need access to the index then foldlOf' is more flexible in what it accepts.

foldlOf' l ≡ ifoldlOf' l . const
Instances
FoldableWithIndex Int [] 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> [a] -> m #

ifolded :: IndexedFold Int [a] a #

ifoldr :: (Int -> a -> b -> b) -> b -> [a] -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> [a] -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> [a] -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> [a] -> b #

FoldableWithIndex Int ZipList 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> ZipList a -> m #

ifolded :: IndexedFold Int (ZipList a) a #

ifoldr :: (Int -> a -> b -> b) -> b -> ZipList a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> ZipList a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> ZipList a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> ZipList a -> b #

FoldableWithIndex Int NonEmpty 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> NonEmpty a -> m #

ifolded :: IndexedFold Int (NonEmpty a) a #

ifoldr :: (Int -> a -> b -> b) -> b -> NonEmpty a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> NonEmpty a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> NonEmpty a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> NonEmpty a -> b #

FoldableWithIndex Int Vector 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> Vector a -> m #

ifolded :: IndexedFold Int (Vector a) a #

ifoldr :: (Int -> a -> b -> b) -> b -> Vector a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> Vector a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> Vector a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> Vector a -> b #

FoldableWithIndex Int IntMap 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> IntMap a -> m #

ifolded :: IndexedFold Int (IntMap a) a #

ifoldr :: (Int -> a -> b -> b) -> b -> IntMap a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> IntMap a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> IntMap a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> IntMap a -> b #

FoldableWithIndex Int Seq 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> Seq a -> m #

ifolded :: IndexedFold Int (Seq a) a #

ifoldr :: (Int -> a -> b -> b) -> b -> Seq a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> Seq a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> Seq a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> Seq a -> b #

FoldableWithIndex () Maybe 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Maybe a -> m #

ifolded :: IndexedFold () (Maybe a) a #

ifoldr :: (() -> a -> b -> b) -> b -> Maybe a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Maybe a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Maybe a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Maybe a -> b #

FoldableWithIndex () Par1 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Par1 a -> m #

ifolded :: IndexedFold () (Par1 a) a #

ifoldr :: (() -> a -> b -> b) -> b -> Par1 a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Par1 a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Par1 a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Par1 a -> b #

FoldableWithIndex () Identity 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Identity a -> m #

ifolded :: IndexedFold () (Identity a) a #

ifoldr :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Identity a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Identity a -> b #

FoldableWithIndex k (Map k) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (k -> a -> m) -> Map k a -> m #

ifolded :: IndexedFold k (Map k a) a #

ifoldr :: (k -> a -> b -> b) -> b -> Map k a -> b #

ifoldl :: (k -> b -> a -> b) -> b -> Map k a -> b #

ifoldr' :: (k -> a -> b -> b) -> b -> Map k a -> b #

ifoldl' :: (k -> b -> a -> b) -> b -> Map k a -> b #

FoldableWithIndex k (HashMap k) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (k -> a -> m) -> HashMap k a -> m #

ifolded :: IndexedFold k (HashMap k a) a #

ifoldr :: (k -> a -> b -> b) -> b -> HashMap k a -> b #

ifoldl :: (k -> b -> a -> b) -> b -> HashMap k a -> b #

ifoldr' :: (k -> a -> b -> b) -> b -> HashMap k a -> b #

ifoldl' :: (k -> b -> a -> b) -> b -> HashMap k a -> b #

FoldableWithIndex k ((,) k) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (k -> a -> m) -> (k, a) -> m #

ifolded :: IndexedFold k (k, a) a #

ifoldr :: (k -> a -> b -> b) -> b -> (k, a) -> b #

ifoldl :: (k -> b -> a -> b) -> b -> (k, a) -> b #

ifoldr' :: (k -> a -> b -> b) -> b -> (k, a) -> b #

ifoldl' :: (k -> b -> a -> b) -> b -> (k, a) -> b #

FoldableWithIndex i (Level i) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Level i a -> m #

ifolded :: IndexedFold i (Level i a) a #

ifoldr :: (i -> a -> b -> b) -> b -> Level i a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Level i a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Level i a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Level i a -> b #

Ix i => FoldableWithIndex i (Array i) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Array i a -> m #

ifolded :: IndexedFold i (Array i a) a #

ifoldr :: (i -> a -> b -> b) -> b -> Array i a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Array i a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Array i a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Array i a -> b #

FoldableWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> V1 a -> m #

ifolded :: IndexedFold Void (V1 a) a #

ifoldr :: (Void -> a -> b -> b) -> b -> V1 a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> V1 a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> V1 a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> V1 a -> b #

FoldableWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> U1 a -> m #

ifolded :: IndexedFold Void (U1 a) a #

ifoldr :: (Void -> a -> b -> b) -> b -> U1 a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> U1 a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> U1 a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> U1 a -> b #

FoldableWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Proxy a -> m #

ifolded :: IndexedFold Void (Proxy a) a #

ifoldr :: (Void -> a -> b -> b) -> b -> Proxy a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> Proxy a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> Proxy a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> Proxy a -> b #

FoldableWithIndex Int (V n) 
Instance details

Defined in Linear.V

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> V n a -> m #

ifolded :: IndexedFold Int (V n a) a #

ifoldr :: (Int -> a -> b -> b) -> b -> V n a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> V n a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> V n a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> V n a -> b #

FoldableWithIndex () (Tagged a) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (() -> a0 -> m) -> Tagged a a0 -> m #

ifolded :: IndexedFold () (Tagged a a0) a0 #

ifoldr :: (() -> a0 -> b -> b) -> b -> Tagged a a0 -> b #

ifoldl :: (() -> b -> a0 -> b) -> b -> Tagged a a0 -> b #

ifoldr' :: (() -> a0 -> b -> b) -> b -> Tagged a a0 -> b #

ifoldl' :: (() -> b -> a0 -> b) -> b -> Tagged a a0 -> b #

FoldableWithIndex i f => FoldableWithIndex i (Reverse f) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Reverse f a -> m #

ifolded :: IndexedFold i (Reverse f a) a #

ifoldr :: (i -> a -> b -> b) -> b -> Reverse f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Reverse f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Reverse f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Reverse f a -> b #

FoldableWithIndex i f => FoldableWithIndex i (Rec1 f) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Rec1 f a -> m #

ifolded :: IndexedFold i (Rec1 f a) a #

ifoldr :: (i -> a -> b -> b) -> b -> Rec1 f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Rec1 f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Rec1 f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Rec1 f a -> b #

FoldableWithIndex i m => FoldableWithIndex i (IdentityT m) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m0 => (i -> a -> m0) -> IdentityT m a -> m0 #

ifolded :: IndexedFold i (IdentityT m a) a #

ifoldr :: (i -> a -> b -> b) -> b -> IdentityT m a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> IdentityT m a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> IdentityT m a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> IdentityT m a -> b #

FoldableWithIndex i f => FoldableWithIndex i (Backwards f) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Backwards f a -> m #

ifolded :: IndexedFold i (Backwards f a) a #

ifoldr :: (i -> a -> b -> b) -> b -> Backwards f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Backwards f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Backwards f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Backwards f a -> b #

FoldableWithIndex i (Magma i t b) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Magma i t b a -> m #

ifolded :: IndexedFold i (Magma i t b a) a #

ifoldr :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldr' :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 #

ifoldl' :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 #

FoldableWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> K1 i c a -> m #

ifolded :: IndexedFold Void (K1 i c a) a #

ifoldr :: (Void -> a -> b -> b) -> b -> K1 i c a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> K1 i c a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> K1 i c a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> K1 i c a -> b #

FoldableWithIndex [Int] Tree 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => ([Int] -> a -> m) -> Tree a -> m #

ifolded :: IndexedFold [Int] (Tree a) a #

ifoldr :: ([Int] -> a -> b -> b) -> b -> Tree a -> b #

ifoldl :: ([Int] -> b -> a -> b) -> b -> Tree a -> b #

ifoldr' :: ([Int] -> a -> b -> b) -> b -> Tree a -> b #

ifoldl' :: ([Int] -> b -> a -> b) -> b -> Tree a -> b #

FoldableWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

ifoldMap :: Monoid m => (E V2 -> a -> m) -> V2 a -> m #

ifolded :: IndexedFold (E V2) (V2 a) a #

ifoldr :: (E V2 -> a -> b -> b) -> b -> V2 a -> b #

ifoldl :: (E V2 -> b -> a -> b) -> b -> V2 a -> b #

ifoldr' :: (E V2 -> a -> b -> b) -> b -> V2 a -> b #

ifoldl' :: (E V2 -> b -> a -> b) -> b -> V2 a -> b #

FoldableWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

ifoldMap :: Monoid m => (E V3 -> a -> m) -> V3 a -> m #

ifolded :: IndexedFold (E V3) (V3 a) a #

ifoldr :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #

ifoldl :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #

ifoldr' :: (E V3 -> a -> b -> b) -> b -> V3 a -> b #

ifoldl' :: (E V3 -> b -> a -> b) -> b -> V3 a -> b #

FoldableWithIndex (E Plucker) Plucker 
Instance details

Defined in Linear.Plucker

Methods

ifoldMap :: Monoid m => (E Plucker -> a -> m) -> Plucker a -> m #

ifolded :: IndexedFold (E Plucker) (Plucker a) a #

ifoldr :: (E Plucker -> a -> b -> b) -> b -> Plucker a -> b #

ifoldl :: (E Plucker -> b -> a -> b) -> b -> Plucker a -> b #

ifoldr' :: (E Plucker -> a -> b -> b) -> b -> Plucker a -> b #

ifoldl' :: (E Plucker -> b -> a -> b) -> b -> Plucker a -> b #

FoldableWithIndex (E Quaternion) Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

ifoldMap :: Monoid m => (E Quaternion -> a -> m) -> Quaternion a -> m #

ifolded :: IndexedFold (E Quaternion) (Quaternion a) a #

ifoldr :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b #

ifoldl :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b #

ifoldr' :: (E Quaternion -> a -> b -> b) -> b -> Quaternion a -> b #

ifoldl' :: (E Quaternion -> b -> a -> b) -> b -> Quaternion a -> b #

FoldableWithIndex (E V0) V0 
Instance details

Defined in Linear.V0

Methods

ifoldMap :: Monoid m => (E V0 -> a -> m) -> V0 a -> m #

ifolded :: IndexedFold (E V0) (V0 a) a #

ifoldr :: (E V0 -> a -> b -> b) -> b -> V0 a -> b #

ifoldl :: (E V0 -> b -> a -> b) -> b -> V0 a -> b #

ifoldr' :: (E V0 -> a -> b -> b) -> b -> V0 a -> b #

ifoldl' :: (E V0 -> b -> a -> b) -> b -> V0 a -> b #

FoldableWithIndex (E V4) V4 
Instance details

Defined in Linear.V4

Methods

ifoldMap :: Monoid m => (E V4 -> a -> m) -> V4 a -> m #

ifolded :: IndexedFold (E V4) (V4 a) a #

ifoldr :: (E V4 -> a -> b -> b) -> b -> V4 a -> b #

ifoldl :: (E V4 -> b -> a -> b) -> b -> V4 a -> b #

ifoldr' :: (E V4 -> a -> b -> b) -> b -> V4 a -> b #

ifoldl' :: (E V4 -> b -> a -> b) -> b -> V4 a -> b #

FoldableWithIndex (E V1) V1 
Instance details

Defined in Linear.V1

Methods

ifoldMap :: Monoid m => (E V1 -> a -> m) -> V1 a -> m #

ifolded :: IndexedFold (E V1) (V1 a) a #

ifoldr :: (E V1 -> a -> b -> b) -> b -> V1 a -> b #

ifoldl :: (E V1 -> b -> a -> b) -> b -> V1 a -> b #

ifoldr' :: (E V1 -> a -> b -> b) -> b -> V1 a -> b #

ifoldl' :: (E V1 -> b -> a -> b) -> b -> V1 a -> b #

FoldableWithIndex i f => FoldableWithIndex [i] (Free f) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => ([i] -> a -> m) -> Free f a -> m #

ifolded :: IndexedFold [i] (Free f a) a #

ifoldr :: ([i] -> a -> b -> b) -> b -> Free f a -> b #

ifoldl :: ([i] -> b -> a -> b) -> b -> Free f a -> b #

ifoldr' :: ([i] -> a -> b -> b) -> b -> Free f a -> b #

ifoldl' :: ([i] -> b -> a -> b) -> b -> Free f a -> b #

FoldableWithIndex i f => FoldableWithIndex [i] (Cofree f) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => ([i] -> a -> m) -> Cofree f a -> m #

ifolded :: IndexedFold [i] (Cofree f a) a #

ifoldr :: ([i] -> a -> b -> b) -> b -> Cofree f a -> b #

ifoldl :: ([i] -> b -> a -> b) -> b -> Cofree f a -> b #

ifoldr' :: ([i] -> a -> b -> b) -> b -> Cofree f a -> b #

ifoldl' :: ([i] -> b -> a -> b) -> b -> Cofree f a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (Sum f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> Sum f g a -> m #

ifolded :: IndexedFold (Either i j) (Sum f g a) a #

ifoldr :: (Either i j -> a -> b -> b) -> b -> Sum f g a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> Sum f g a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> Sum f g a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> Sum f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (Product f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> Product f g a -> m #

ifolded :: IndexedFold (Either i j) (Product f g a) a #

ifoldr :: (Either i j -> a -> b -> b) -> b -> Product f g a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> Product f g a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> Product f g a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> Product f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (f :+: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> (f :+: g) a -> m #

ifolded :: IndexedFold (Either i j) ((f :+: g) a) a #

ifoldr :: (Either i j -> a -> b -> b) -> b -> (f :+: g) a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> (f :+: g) a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> (f :+: g) a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> (f :+: g) a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (f :*: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> (f :*: g) a -> m #

ifolded :: IndexedFold (Either i j) ((f :*: g) a) a #

ifoldr :: (Either i j -> a -> b -> b) -> b -> (f :*: g) a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> (f :*: g) a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> (f :*: g) a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> (f :*: g) a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (i, j) (Compose f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => ((i, j) -> a -> m) -> Compose f g a -> m #

ifolded :: IndexedFold (i, j) (Compose f g a) a #

ifoldr :: ((i, j) -> a -> b -> b) -> b -> Compose f g a -> b #

ifoldl :: ((i, j) -> b -> a -> b) -> b -> Compose f g a -> b #

ifoldr' :: ((i, j) -> a -> b -> b) -> b -> Compose f g a -> b #

ifoldl' :: ((i, j) -> b -> a -> b) -> b -> Compose f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (i, j) (f :.: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

ifoldMap :: Monoid m => ((i, j) -> a -> m) -> (f :.: g) a -> m #

ifolded :: IndexedFold (i, j) ((f :.: g) a) a #

ifoldr :: ((i, j) -> a -> b -> b) -> b -> (f :.: g) a -> b #

ifoldl :: ((i, j) -> b -> a -> b) -> b -> (f :.: g) a -> b #

ifoldr' :: ((i, j) -> a -> b -> b) -> b -> (f :.: g) a -> b #

ifoldl' :: ((i, j) -> b -> a -> b) -> b -> (f :.: g) a -> b #

class Functor f => FunctorWithIndex i (f :: Type -> Type) | f -> i where #

A Functor with an additional index.

Instances must satisfy a modified form of the Functor laws:

imap f . imap g ≡ imap (\i -> f i . g i)
imap (\_ a -> a) ≡ id

Minimal complete definition

Nothing

Methods

imap :: (i -> a -> b) -> f a -> f b #

Map with access to the index.

imapped :: IndexedSetter i (f a) (f b) a b #

The IndexedSetter for a FunctorWithIndex.

If you don't need access to the index, then mapped is more flexible in what it accepts.

Instances
FunctorWithIndex Int []

The position in the list is available as the index.

Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Int -> a -> b) -> [a] -> [b] #

imapped :: IndexedSetter Int [a] [b] a b #

FunctorWithIndex Int ZipList

Same instance as for [].

Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Int -> a -> b) -> ZipList a -> ZipList b #

imapped :: IndexedSetter Int (ZipList a) (ZipList b) a b #

FunctorWithIndex Int NonEmpty 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Int -> a -> b) -> NonEmpty a -> NonEmpty b #

imapped :: IndexedSetter Int (NonEmpty a) (NonEmpty b) a b #

FunctorWithIndex Int Vector 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Int -> a -> b) -> Vector a -> Vector b #

imapped :: IndexedSetter Int (Vector a) (Vector b) a b #

FunctorWithIndex Int IntMap 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Int -> a -> b) -> IntMap a -> IntMap b #

imapped :: IndexedSetter Int (IntMap a) (IntMap b) a b #

FunctorWithIndex Int Seq

The position in the Seq is available as the index.

Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Int -> a -> b) -> Seq a -> Seq b #

imapped :: IndexedSetter Int (Seq a) (Seq b) a b #

FunctorWithIndex () Maybe 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (() -> a -> b) -> Maybe a -> Maybe b #

imapped :: IndexedSetter () (Maybe a) (Maybe b) a b #

FunctorWithIndex () Par1 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (() -> a -> b) -> Par1 a -> Par1 b #

imapped :: IndexedSetter () (Par1 a) (Par1 b) a b #

FunctorWithIndex () Identity 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (() -> a -> b) -> Identity a -> Identity b #

imapped :: IndexedSetter () (Identity a) (Identity b) a b #

FunctorWithIndex k (Map k) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (k -> a -> b) -> Map k a -> Map k b #

imapped :: IndexedSetter k (Map k a) (Map k b) a b #

FunctorWithIndex k (HashMap k) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (k -> a -> b) -> HashMap k a -> HashMap k b #

imapped :: IndexedSetter k (HashMap k a) (HashMap k b) a b #

FunctorWithIndex k ((,) k) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (k -> a -> b) -> (k, a) -> (k, b) #

imapped :: IndexedSetter k (k, a) (k, b) a b #

FunctorWithIndex i (Level i) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b) -> Level i a -> Level i b #

imapped :: IndexedSetter i (Level i a) (Level i b) a b #

Ix i => FunctorWithIndex i (Array i) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b) -> Array i a -> Array i b #

imapped :: IndexedSetter i (Array i a) (Array i b) a b #

FunctorWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Void -> a -> b) -> V1 a -> V1 b #

imapped :: IndexedSetter Void (V1 a) (V1 b) a b #

FunctorWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Void -> a -> b) -> U1 a -> U1 b #

imapped :: IndexedSetter Void (U1 a) (U1 b) a b #

FunctorWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Void -> a -> b) -> Proxy a -> Proxy b #

imapped :: IndexedSetter Void (Proxy a) (Proxy b) a b #

FunctorWithIndex Int (V n) 
Instance details

Defined in Linear.V

Methods

imap :: (Int -> a -> b) -> V n a -> V n b #

imapped :: IndexedSetter Int (V n a) (V n b) a b #

FunctorWithIndex () (Tagged a) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (() -> a0 -> b) -> Tagged a a0 -> Tagged a b #

imapped :: IndexedSetter () (Tagged a a0) (Tagged a b) a0 b #

FunctorWithIndex i f => FunctorWithIndex i (Reverse f) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b) -> Reverse f a -> Reverse f b #

imapped :: IndexedSetter i (Reverse f a) (Reverse f b) a b #

FunctorWithIndex i f => FunctorWithIndex i (Rec1 f) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b) -> Rec1 f a -> Rec1 f b #

imapped :: IndexedSetter i (Rec1 f a) (Rec1 f b) a b #

FunctorWithIndex i m => FunctorWithIndex i (IdentityT m) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b) -> IdentityT m a -> IdentityT m b #

imapped :: IndexedSetter i (IdentityT m a) (IdentityT m b) a b #

FunctorWithIndex i f => FunctorWithIndex i (Backwards f) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b) -> Backwards f a -> Backwards f b #

imapped :: IndexedSetter i (Backwards f a) (Backwards f b) a b #

FunctorWithIndex r ((->) r :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (r -> a -> b) -> (r -> a) -> r -> b #

imapped :: IndexedSetter r (r -> a) (r -> b) a b #

FunctorWithIndex i (Magma i t b) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (i -> a -> b0) -> Magma i t b a -> Magma i t b b0 #

imapped :: IndexedSetter i (Magma i t b a) (Magma i t b b0) a b0 #

FunctorWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Void -> a -> b) -> K1 i c a -> K1 i c b #

imapped :: IndexedSetter Void (K1 i c a) (K1 i c b) a b #

FunctorWithIndex [Int] Tree 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: ([Int] -> a -> b) -> Tree a -> Tree b #

imapped :: IndexedSetter [Int] (Tree a) (Tree b) a b #

FunctorWithIndex (E V2) V2 
Instance details

Defined in Linear.V2

Methods

imap :: (E V2 -> a -> b) -> V2 a -> V2 b #

imapped :: IndexedSetter (E V2) (V2 a) (V2 b) a b #

FunctorWithIndex (E V3) V3 
Instance details

Defined in Linear.V3

Methods

imap :: (E V3 -> a -> b) -> V3 a -> V3 b #

imapped :: IndexedSetter (E V3) (V3 a) (V3 b) a b #

FunctorWithIndex (E Plucker) Plucker 
Instance details

Defined in Linear.Plucker

Methods

imap :: (E Plucker -> a -> b) -> Plucker a -> Plucker b #

imapped :: IndexedSetter (E Plucker) (Plucker a) (Plucker b) a b #

FunctorWithIndex (E Quaternion) Quaternion 
Instance details

Defined in Linear.Quaternion

Methods

imap :: (E Quaternion -> a -> b) -> Quaternion a -> Quaternion b #

imapped :: IndexedSetter (E Quaternion) (Quaternion a) (Quaternion b) a b #

FunctorWithIndex (E V0) V0 
Instance details

Defined in Linear.V0

Methods

imap :: (E V0 -> a -> b) -> V0 a -> V0 b #

imapped :: IndexedSetter (E V0) (V0 a) (V0 b) a b #

FunctorWithIndex (E V4) V4 
Instance details

Defined in Linear.V4

Methods

imap :: (E V4 -> a -> b) -> V4 a -> V4 b #

imapped :: IndexedSetter (E V4) (V4 a) (V4 b) a b #

FunctorWithIndex (E V1) V1 
Instance details

Defined in Linear.V1

Methods

imap :: (E V1 -> a -> b) -> V1 a -> V1 b #

imapped :: IndexedSetter (E V1) (V1 a) (V1 b) a b #

FunctorWithIndex i f => FunctorWithIndex [i] (Free f) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: ([i] -> a -> b) -> Free f a -> Free f b #

imapped :: IndexedSetter [i] (Free f a) (Free f b) a b #

FunctorWithIndex i f => FunctorWithIndex [i] (Cofree f) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: ([i] -> a -> b) -> Cofree f a -> Cofree f b #

imapped :: IndexedSetter [i] (Cofree f a) (Cofree f b) a b #

FunctorWithIndex i w => FunctorWithIndex (s, i) (TracedT s w) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: ((s, i) -> a -> b) -> TracedT s w a -> TracedT s w b #

imapped :: IndexedSetter (s, i) (TracedT s w a) (TracedT s w b) a b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Sum f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Either i j -> a -> b) -> Sum f g a -> Sum f g b #

imapped :: IndexedSetter (Either i j) (Sum f g a) (Sum f g b) a b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Product f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Either i j -> a -> b) -> Product f g a -> Product f g b #

imapped :: IndexedSetter (Either i j) (Product f g a) (Product f g b) a b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :+: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Either i j -> a -> b) -> (f :+: g) a -> (f :+: g) b #

imapped :: IndexedSetter (Either i j) ((f :+: g) a) ((f :+: g) b) a b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :*: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: (Either i j -> a -> b) -> (f :*: g) a -> (f :*: g) b #

imapped :: IndexedSetter (Either i j) ((f :*: g) a) ((f :*: g) b) a b #

FunctorWithIndex i m => FunctorWithIndex (e, i) (ReaderT e m) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: ((e, i) -> a -> b) -> ReaderT e m a -> ReaderT e m b #

imapped :: IndexedSetter (e, i) (ReaderT e m a) (ReaderT e m b) a b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (Compose f g) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: ((i, j) -> a -> b) -> Compose f g a -> Compose f g b #

imapped :: IndexedSetter (i, j) (Compose f g a) (Compose f g b) a b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (f :.: g) 
Instance details

Defined in Control.Lens.Indexed

Methods

imap :: ((i, j) -> a -> b) -> (f :.: g) a -> (f :.: g) b #

imapped :: IndexedSetter (i, j) ((f :.: g) a) ((f :.: g) b) a b #

(<.) :: Indexable i p => (Indexed i s t -> r) -> ((a -> b) -> s -> t) -> p a b -> r infixr 9 #

Compose an Indexed function with a non-indexed function.

Mnemonically, the < points to the indexing we want to preserve.

>>> let nestedMap = (fmap Map.fromList . Map.fromList) [(1, [(10, "one,ten"), (20, "one,twenty")]), (2, [(30, "two,thirty"), (40,"two,forty")])]
>>> nestedMap^..(itraversed<.itraversed).withIndex
[(1,"one,ten"),(1,"one,twenty"),(2,"two,thirty"),(2,"two,forty")]

selfIndex :: Indexable a p => p a fb -> a -> fb #

Use a value itself as its own index. This is essentially an indexed version of id.

Note: When used to modify the value, this can break the index requirements assumed by indices and similar, so this is only properly an IndexedGetter, but it can be used as more.

selfIndex :: IndexedGetter a a b

reindexed :: Indexable j p => (i -> j) -> (Indexed i a b -> r) -> p a b -> r #

Remap the index.

icompose :: Indexable p c => (i -> j -> p) -> (Indexed i s t -> r) -> (Indexed j a b -> s -> t) -> c a b -> r #

Composition of Indexed functions with a user supplied function for combining indices.

index :: (Indexable i p, Eq i, Applicative f) => i -> Optical' p (Indexed i) f a a #

This allows you to filter an IndexedFold, IndexedGetter, IndexedTraversal or IndexedLens based on an index.

>>> ["hello","the","world","!!!"]^?traversed.index 2
Just "world"

iany :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

Return whether or not any element in a container satisfies a predicate, with access to the index i.

When you don't need access to the index then any is more flexible in what it accepts.

anyiany . const

iall :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

Return whether or not all elements in a container satisfy a predicate, with access to the index i.

When you don't need access to the index then all is more flexible in what it accepts.

alliall . const

inone :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Bool #

Return whether or not none of the elements in a container satisfy a predicate, with access to the index i.

When you don't need access to the index then none is more flexible in what it accepts.

noneinone . const
inone f ≡ not . iany f

itraverse_ :: (FoldableWithIndex i t, Applicative f) => (i -> a -> f b) -> t a -> f () #

Traverse elements with access to the index i, discarding the results.

When you don't need access to the index then traverse_ is more flexible in what it accepts.

traverse_ l = itraverse . const

ifor_ :: (FoldableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f () #

Traverse elements with access to the index i, discarding the results (with the arguments flipped).

ifor_flip itraverse_

When you don't need access to the index then for_ is more flexible in what it accepts.

for_ a ≡ ifor_ a . const

imapM_ :: (FoldableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results.

When you don't need access to the index then mapMOf_ is more flexible in what it accepts.

mapM_imapM . const

iforM_ :: (FoldableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m () #

Run monadic actions for each target of an IndexedFold or IndexedTraversal with access to the index, discarding the results (with the arguments flipped).

iforM_flip imapM_

When you don't need access to the index then forMOf_ is more flexible in what it accepts.

forMOf_ l a ≡ iforMOf l a . const

iconcatMap :: FoldableWithIndex i f => (i -> a -> [b]) -> f a -> [b] #

Concatenate the results of a function of the elements of an indexed container with access to the index.

When you don't need access to the index then concatMap is more flexible in what it accepts.

concatMapiconcatMap . const
iconcatMapifoldMap

ifind :: FoldableWithIndex i f => (i -> a -> Bool) -> f a -> Maybe (i, a) #

Searches a container with a predicate that is also supplied the index, returning the left-most element of the structure matching the predicate, or Nothing if there is no such element.

When you don't need access to the index then find is more flexible in what it accepts.

findifind . const

ifoldrM :: (FoldableWithIndex i f, Monad m) => (i -> a -> b -> m b) -> b -> f a -> m b #

Monadic fold right over the elements of a structure with an index.

When you don't need access to the index then foldrM is more flexible in what it accepts.

foldrMifoldrM . const

ifoldlM :: (FoldableWithIndex i f, Monad m) => (i -> b -> a -> m b) -> b -> f a -> m b #

Monadic fold over the elements of a structure with an index, associating to the left.

When you don't need access to the index then foldlM is more flexible in what it accepts.

foldlMifoldlM . const

itoList :: FoldableWithIndex i f => f a -> [(i, a)] #

Extract the key-value pairs from a structure.

When you don't need access to the indices in the result, then toList is more flexible in what it accepts.

toListmap snd . itoList

ifor :: (TraversableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f (t b) #

Traverse with an index (and the arguments flipped).

for a ≡ ifor a . const
iforflip itraverse

imapM :: (TraversableWithIndex i t, Monad m) => (i -> a -> m b) -> t a -> m (t b) #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results, with access the index.

When you don't need access to the index mapM is more liberal in what it can accept.

mapMimapM . const

iforM :: (TraversableWithIndex i t, Monad m) => t a -> (i -> a -> m b) -> m (t b) #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results, with access its position (and the arguments flipped).

forM a ≡ iforM a . const
iforMflip imapM

imapAccumR :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) #

Generalizes mapAccumR to add access to the index.

imapAccumROf accumulates state from right to left.

mapAccumRimapAccumR . const

imapAccumL :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) #

Generalizes mapAccumL to add access to the index.

imapAccumLOf accumulates state from left to right.

mapAccumLOfimapAccumL . const

ifoldMapBy :: FoldableWithIndex i t => (r -> r -> r) -> r -> (i -> a -> r) -> t a -> r #

ifoldMapByOf :: IndexedFold i t a -> (r -> r -> r) -> r -> (i -> a -> r) -> t -> r #

itraverseBy :: TraversableWithIndex i t => (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> t a -> f (t b) #

itraverseByOf :: IndexedTraversal i s t a b -> (forall x. x -> f x) -> (forall x y. f (x -> y) -> f x -> f y) -> (i -> a -> f b) -> s -> f t #

type AnEquality' (s :: k2) (a :: k2) = AnEquality s s a a #

type AnEquality (s :: k1) (t :: k2) (a :: k1) (b :: k2) = Identical a (Proxy b) a (Proxy b) -> Identical a (Proxy b) s (Proxy t) #

When you see this as an argument to a function, it expects an Equality.

data Identical (a :: k) (b :: k1) (s :: k) (t :: k1) :: forall k k1. k -> k1 -> k -> k1 -> Type where #

Provides witness that (s ~ a, b ~ t) holds.

Constructors

Identical :: forall k k1 (a :: k) (b :: k1) (s :: k) (t :: k1). Identical a b a b 

runEq :: AnEquality s t a b -> Identical s t a b #

Extract a witness of type Equality.

substEq :: AnEquality s t a b -> ((s ~ a) -> (t ~ b) -> r) -> r #

Substituting types with Equality.

mapEq :: AnEquality s t a b -> f s -> f a #

We can use Equality to do substitution into anything.

fromEq :: AnEquality s t a b -> Equality b a t s #

Equality is symmetric.

simply :: (Optic' p f s a -> r) -> Optic' p f s a -> r #

This is an adverb that can be used to modify many other Lens combinators to make them require simple lenses, simple traversals, simple prisms or simple isos as input.

simple :: Equality' a a #

Composition with this isomorphism is occasionally useful when your Lens, Traversal or Iso has a constraint on an unused argument to force that argument to agree with the type of a used argument and avoid ScopedTypeVariables or other ugliness.

class Strict lazy strict | lazy -> strict, strict -> lazy where #

Ad hoc conversion between "strict" and "lazy" versions of a structure, such as Text or ByteString.

Methods

strict :: Iso' lazy strict #

Instances
Strict ByteString ByteString 
Instance details

Defined in Control.Lens.Iso

Strict Text Text 
Instance details

Defined in Control.Lens.Iso

Methods

strict :: Iso' Text Text0 #

Strict (ST s a) (ST s a) 
Instance details

Defined in Control.Lens.Iso

Methods

strict :: Iso' (ST s a) (ST0 s a) #

Strict (WriterT w m a) (WriterT w m a) 
Instance details

Defined in Control.Lens.Iso

Methods

strict :: Iso' (WriterT0 w m a) (WriterT w m a) #

Strict (StateT s m a) (StateT s m a) 
Instance details

Defined in Control.Lens.Iso

Methods

strict :: Iso' (StateT s m a) (StateT0 s m a) #

Strict (RWST r w s m a) (RWST r w s m a) 
Instance details

Defined in Control.Lens.Iso

Methods

strict :: Iso' (RWST r w s m a) (RWST0 r w s m a) #

class Bifunctor p => Swapped (p :: Type -> Type -> Type) where #

This class provides for symmetric bifunctors.

Methods

swapped :: Iso (p a b) (p c d) (p b a) (p d c) #

swapped . swappedid
first f . swapped = swapped . second f
second g . swapped = swapped . first g
bimap f g . swapped = swapped . bimap g f
>>> (1,2)^.swapped
(2,1)
Instances
Swapped Either 
Instance details

Defined in Control.Lens.Iso

Methods

swapped :: Iso (Either a b) (Either c d) (Either b a) (Either d c) #

Swapped (,) 
Instance details

Defined in Control.Lens.Iso

Methods

swapped :: Iso (a, b) (c, d) (b, a) (d, c) #

type AnIso' s a = AnIso s s a a #

type AnIso s t a b = Exchange a b a (Identity b) -> Exchange a b s (Identity t) #

When you see this as an argument to a function, it expects an Iso.

pattern List :: forall l. IsList l => [Item l] -> l #

pattern Reversed :: forall t. Reversing t => t -> t #

pattern Swapped :: forall (p :: Type -> Type -> Type) c d. Swapped p => p d c -> p c d #

pattern Lazy :: forall t s. Strict t s => t -> s #

pattern Strict :: forall s t. Strict s t => t -> s #

iso :: (s -> a) -> (b -> t) -> Iso s t a b #

Build a simple isomorphism from a pair of inverse functions.

view (iso f g) ≡ f
view (from (iso f g)) ≡ g
over (iso f g) h ≡ g . h . f
over (from (iso f g)) h ≡ f . h . g

from :: AnIso s t a b -> Iso b a t s #

Invert an isomorphism.

from (from l) ≡ l

withIso :: AnIso s t a b -> ((s -> a) -> (b -> t) -> r) -> r #

Extract the two functions, one from s -> a and one from b -> t that characterize an Iso.

cloneIso :: AnIso s t a b -> Iso s t a b #

Convert from AnIso back to any Iso.

This is useful when you need to store an isomorphism as a data type inside a container and later reconstitute it as an overloaded function.

See cloneLens or cloneTraversal for more information on why you might want to do this.

au :: Functor f => AnIso s t a b -> ((b -> t) -> f s) -> f a #

Based on ala from Conor McBride's work on Epigram.

This version is generalized to accept any Iso, not just a newtype.

>>> au (_Wrapping Sum) foldMap [1,2,3,4]
10

You may want to think of this combinator as having the following, simpler type:

au :: AnIso s t a b -> ((b -> t) -> e -> s) -> e -> a

auf :: Optic (Costar f) g s t a b -> (f a -> g b) -> f s -> g t #

Based on ala' from Conor McBride's work on Epigram.

This version is generalized to accept any Iso, not just a newtype.

For a version you pass the name of the newtype constructor to, see alaf.

>>> auf (_Unwrapping Sum) (foldMapOf both) Prelude.length ("hello","world")
10

Mnemonically, the German auf plays a similar role to à la, and the combinator is au with an extra function argument:

auf :: Iso s t a b -> ((r ->  a) -> e -> b) -> (r -> s) -> e -> t

but the signature is general.

under :: AnIso s t a b -> (t -> s) -> b -> a #

The opposite of working over a Setter is working under an isomorphism.

underover . from
under :: Iso s t a b -> (t -> s) -> b -> a

enum :: Enum a => Iso' Int a #

This isomorphism can be used to convert to or from an instance of Enum.

>>> LT^.from enum
0
>>> 97^.enum :: Char
'a'

Note: this is only an isomorphism from the numeric range actually used and it is a bit of a pleasant fiction, since there are questionable Enum instances for Double, and Float that exist solely for [1.0 .. 4.0] sugar and the instances for those and Integer don't cover all values in their range.

mapping :: (Functor f, Functor g) => AnIso s t a b -> Iso (f s) (g t) (f a) (g b) #

This can be used to lift any Iso into an arbitrary Functor.

non :: Eq a => a -> Iso' (Maybe a) a #

If v is an element of a type a, and a' is a sans the element v, then non v is an isomorphism from Maybe a' to a.

nonnon' . only

Keep in mind this is only a real isomorphism if you treat the domain as being Maybe (a sans v).

This is practically quite useful when you want to have a Map where all the entries should have non-zero values.

>>> Map.fromList [("hello",1)] & at "hello" . non 0 +~ 2
fromList [("hello",3)]
>>> Map.fromList [("hello",1)] & at "hello" . non 0 -~ 1
fromList []
>>> Map.fromList [("hello",1)] ^. at "hello" . non 0
1
>>> Map.fromList [] ^. at "hello" . non 0
0

This combinator is also particularly useful when working with nested maps.

e.g. When you want to create the nested Map when it is missing:

>>> Map.empty & at "hello" . non Map.empty . at "world" ?~ "!!!"
fromList [("hello",fromList [("world","!!!")])]

and when have deleting the last entry from the nested Map mean that we should delete its entry from the surrounding one:

>>> fromList [("hello",fromList [("world","!!!")])] & at "hello" . non Map.empty . at "world" .~ Nothing
fromList []

It can also be used in reverse to exclude a given value:

>>> non 0 # rem 10 4
Just 2
>>> non 0 # rem 10 5
Nothing

non' :: APrism' a () -> Iso' (Maybe a) a #

non' p generalizes non (p # ()) to take any unit Prism

This function generates an isomorphism between Maybe (a | isn't p a) and a.

>>> Map.singleton "hello" Map.empty & at "hello" . non' _Empty . at "world" ?~ "!!!"
fromList [("hello",fromList [("world","!!!")])]
>>> fromList [("hello",fromList [("world","!!!")])] & at "hello" . non' _Empty . at "world" .~ Nothing
fromList []

anon :: a -> (a -> Bool) -> Iso' (Maybe a) a #

anon a p generalizes non a to take any value and a predicate.

This function assumes that p a holds True and generates an isomorphism between Maybe (a | not (p a)) and a.

>>> Map.empty & at "hello" . anon Map.empty Map.null . at "world" ?~ "!!!"
fromList [("hello",fromList [("world","!!!")])]
>>> fromList [("hello",fromList [("world","!!!")])] & at "hello" . anon Map.empty Map.null . at "world" .~ Nothing
fromList []

curried :: Iso ((a, b) -> c) ((d, e) -> f) (a -> b -> c) (d -> e -> f) #

The canonical isomorphism for currying and uncurrying a function.

curried = iso curry uncurry
>>> (fst^.curried) 3 4
3
>>> view curried fst 3 4
3

uncurried :: Iso (a -> b -> c) (d -> e -> f) ((a, b) -> c) ((d, e) -> f) #

The canonical isomorphism for uncurrying and currying a function.

uncurried = iso uncurry curry
uncurried = from curried
>>> ((+)^.uncurried) (1,2)
3

flipped :: Iso (a -> b -> c) (a' -> b' -> c') (b -> a -> c) (b' -> a' -> c') #

The isomorphism for flipping a function.

>>> ((,)^.flipped) 1 2
(2,1)

lazy :: Strict lazy strict => Iso' strict lazy #

An Iso between the strict variant of a structure and its lazy counterpart.

lazy = from strict

See http://hackage.haskell.org/package/strict-base-types for an example use.

reversed :: Reversing a => Iso' a a #

An Iso between a list, ByteString, Text fragment, etc. and its reversal.

>>> "live" ^. reversed
"evil"
>>> "live" & reversed %~ ('d':)
"lived"

involuted :: (a -> a) -> Iso' a a #

Given a function that is its own inverse, this gives you an Iso using it in both directions.

involutedjoin iso
>>> "live" ^. involuted reverse
"evil"
>>> "live" & involuted reverse %~ ('d':)
"lived"

magma :: LensLike (Mafic a b) s t a b -> Iso s u (Magma Int t b a) (Magma j u c c) #

This isomorphism can be used to inspect a Traversal to see how it associates the structure and it can also be used to bake the Traversal into a Magma so that you can traverse over it multiple times.

imagma :: Over (Indexed i) (Molten i a b) s t a b -> Iso s t' (Magma i t b a) (Magma j t' c c) #

This isomorphism can be used to inspect an IndexedTraversal to see how it associates the structure and it can also be used to bake the IndexedTraversal into a Magma so that you can traverse over it multiple times with access to the original indices.

contramapping :: Contravariant f => AnIso s t a b -> Iso (f a) (f b) (f s) (f t) #

Lift an Iso into a Contravariant functor.

contramapping :: Contravariant f => Iso s t a b -> Iso (f a) (f b) (f s) (f t)
contramapping :: Contravariant f => Iso' s a -> Iso' (f a) (f s)

dimapping :: (Profunctor p, Profunctor q) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (p a s') (q b t') (p s a') (q t b') #

Lift two Isos into both arguments of a Profunctor simultaneously.

dimapping :: Profunctor p => Iso s t a b -> Iso s' t' a' b' -> Iso (p a s') (p b t') (p s a') (p t b')
dimapping :: Profunctor p => Iso' s a -> Iso' s' a' -> Iso' (p a s') (p s a')

lmapping :: (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p a x) (q b y) (p s x) (q t y) #

Lift an Iso contravariantly into the left argument of a Profunctor.

lmapping :: Profunctor p => Iso s t a b -> Iso (p a x) (p b y) (p s x) (p t y)
lmapping :: Profunctor p => Iso' s a -> Iso' (p a x) (p s x)

rmapping :: (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p x s) (q y t) (p x a) (q y b) #

Lift an Iso covariantly into the right argument of a Profunctor.

rmapping :: Profunctor p => Iso s t a b -> Iso (p x s) (p y t) (p x a) (p y b)
rmapping :: Profunctor p => Iso' s a -> Iso' (p x s) (p x a)

bimapping :: (Bifunctor f, Bifunctor g) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (f s s') (g t t') (f a a') (g b b') #

Lift two Isos into both arguments of a Bifunctor.

bimapping :: Bifunctor p => Iso s t a b -> Iso s' t' a' b' -> Iso (p s s') (p t t') (p a a') (p b b')
bimapping :: Bifunctor p => Iso' s a -> Iso' s' a' -> Iso' (p s s') (p a a')

firsting :: (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f s x) (g t y) (f a x) (g b y) #

Lift an Iso into the first argument of a Bifunctor.

firsting :: Bifunctor p => Iso s t a b -> Iso (p s x) (p t y) (p a x) (p b y)
firsting :: Bifunctor p => Iso' s a -> Iso' (p s x) (p a x)

seconding :: (Bifunctor f, Bifunctor g) => AnIso s t a b -> Iso (f x s) (g y t) (f x a) (g y b) #

Lift an Iso into the second argument of a Bifunctor. This is essentially the same as mapping, but it takes a 'Bifunctor p' constraint instead of a 'Functor (p a)' one.

seconding :: Bifunctor p => Iso s t a b -> Iso (p x s) (p y t) (p x a) (p y b)
seconding :: Bifunctor p => Iso' s a -> Iso' (p x s) (p x a)

coerced :: (Coercible s a, Coercible t b) => Iso s t a b #

Data types that are representationally equal are isomorphic.

This is only available on GHC 7.8+

Since: lens-4.13

class AsEmpty a where #

Minimal complete definition

Nothing

Methods

_Empty :: Prism' a () #

>>> isn't _Empty [1,2,3]
True
Instances
AsEmpty Ordering 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' Ordering () #

AsEmpty () 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' () () #

AsEmpty ByteString 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' ByteString () #

AsEmpty ByteString 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' ByteString () #

AsEmpty Text 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' Text () #

AsEmpty Text 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' Text () #

AsEmpty Event 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' Event () #

AsEmpty All 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' All () #

AsEmpty Any 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' Any () #

AsEmpty IntSet 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' IntSet () #

AsEmpty [a] 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' [a] () #

AsEmpty (Maybe a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Maybe a) () #

AsEmpty (Set a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Set a) () #

AsEmpty (ZipList a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (ZipList a) () #

Storable a => AsEmpty (Vector a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Vector a) () #

AsEmpty (First a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (First a) () #

AsEmpty (Last a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Last a) () #

AsEmpty a => AsEmpty (Dual a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Dual a) () #

(Eq a, Num a) => AsEmpty (Sum a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Sum a) () #

(Eq a, Num a) => AsEmpty (Product a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Product a) () #

AsEmpty (Vector a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Vector a) () #

AsEmpty (IntMap a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (IntMap a) () #

AsEmpty (Seq a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Seq a) () #

Unbox a => AsEmpty (Vector a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Vector a) () #

AsEmpty (Clip n) 
Instance details

Defined in Diagrams.TwoD.Path

Methods

_Empty :: Prism' (Clip n) () #

AsEmpty (HashSet a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (HashSet a) () #

(AsEmpty a, AsEmpty b) => AsEmpty (a, b) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (a, b) () #

AsEmpty (Map k a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (Map k a) () #

AsEmpty (HashMap k a) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (HashMap k a) () #

AsEmpty (BoundingBox v n) 
Instance details

Defined in Diagrams.BoundingBox

Methods

_Empty :: Prism' (BoundingBox v n) () #

AsEmpty (Path v n) 
Instance details

Defined in Diagrams.Path

Methods

_Empty :: Prism' (Path v n) () #

(Metric v, OrderedField n) => AsEmpty (Trail v n) 
Instance details

Defined in Diagrams.Trail

Methods

_Empty :: Prism' (Trail v n) () #

(AsEmpty a, AsEmpty b, AsEmpty c) => AsEmpty (a, b, c) 
Instance details

Defined in Control.Lens.Empty

Methods

_Empty :: Prism' (a, b, c) () #

(Metric v, OrderedField n) => AsEmpty (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Methods

_Empty :: Prism' (Trail' Line v n) () #

pattern Empty :: forall s. AsEmpty s => s #

class Snoc s t a b | s -> a, t -> b, s b -> t, t a -> s where #

This class provides a way to attach or detach elements on the right side of a structure in a flexible manner.

Methods

_Snoc :: Prism s t (s, a) (t, b) #

_Snoc :: Prism [a] [b] ([a], a) ([b], b)
_Snoc :: Prism (Seq a) (Seq b) (Seq a, a) (Seq b, b)
_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b)
_Snoc :: Prism' String (String, Char)
_Snoc :: Prism' Text (Text, Char)
_Snoc :: Prism' ByteString (ByteString, Word8)
Instances
Snoc ByteString ByteString Word8 Word8 
Instance details

Defined in Control.Lens.Cons

Snoc ByteString ByteString Word8 Word8 
Instance details

Defined in Control.Lens.Cons

Snoc Text Text Char Char 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism Text Text (Text, Char) (Text, Char) #

Snoc Text Text Char Char 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism Text Text (Text, Char) (Text, Char) #

Snoc [a] [b] a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism [a] [b] ([a], a) ([b], b) #

Snoc (ZipList a) (ZipList b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism (ZipList a) (ZipList b) (ZipList a, a) (ZipList b, b) #

(Storable a, Storable b) => Snoc (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

Snoc (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

Snoc (Seq a) (Seq b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism (Seq a) (Seq b) (Seq a, a) (Seq b, b) #

(Unbox a, Unbox b) => Snoc (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

(Prim a, Prim b) => Snoc (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Snoc :: Prism (Vector a) (Vector b) (Vector a, a) (Vector b, b) #

Snoc (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Snoc :: Prism (Path v n) (Path v' n') (Path v n, Located (Trail v n)) (Path v' n', Located (Trail v' n')) #

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (SegTree v n) (SegTree u n') (SegTree v n, Segment Closed v n) (SegTree u n', Segment Closed u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Snoc (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Snoc :: Prism (Trail' Line v n) (Trail' Line u n') (Trail' Line v n, Segment Closed v n) (Trail' Line u n', Segment Closed u n') #

class Cons s t a b | s -> a, t -> b, s b -> t, t a -> s where #

This class provides a way to attach or detach elements on the left side of a structure in a flexible manner.

Methods

_Cons :: Prism s t (a, s) (b, t) #

_Cons :: Prism [a] [b] (a, [a]) (b, [b])
_Cons :: Prism (Seq a) (Seq b) (a, Seq a) (b, Seq b)
_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b)
_Cons :: Prism' String (Char, String)
_Cons :: Prism' Text (Char, Text)
_Cons :: Prism' ByteString (Word8, ByteString)
Instances
Cons ByteString ByteString Word8 Word8 
Instance details

Defined in Control.Lens.Cons

Cons ByteString ByteString Word8 Word8 
Instance details

Defined in Control.Lens.Cons

Cons Text Text Char Char 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism Text Text (Char, Text) (Char, Text) #

Cons Text Text Char Char 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism Text Text (Char, Text) (Char, Text) #

Cons [a] [b] a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism [a] [b] (a, [a]) (b, [b]) #

Cons (ZipList a) (ZipList b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism (ZipList a) (ZipList b) (a, ZipList a) (b, ZipList b) #

(Storable a, Storable b) => Cons (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

Cons (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

Cons (Seq a) (Seq b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism (Seq a) (Seq b) (a, Seq a) (b, Seq b) #

(Unbox a, Unbox b) => Cons (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

(Prim a, Prim b) => Cons (Vector a) (Vector b) a b 
Instance details

Defined in Control.Lens.Cons

Methods

_Cons :: Prism (Vector a) (Vector b) (a, Vector a) (b, Vector b) #

Cons (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

_Cons :: Prism (Path v n) (Path v' n') (Located (Trail v n), Path v n) (Located (Trail v' n'), Path v' n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (SegTree v n) (SegTree u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (SegTree v n) (SegTree u n') (Segment Closed v n, SegTree v n) (Segment Closed u n', SegTree u n') #

(Metric v, OrderedField n, Metric u, OrderedField n') => Cons (Trail' Line v n) (Trail' Line u n') (Segment Closed v n) (Segment Closed u n') 
Instance details

Defined in Diagrams.Trail

Methods

_Cons :: Prism (Trail' Line v n) (Trail' Line u n') (Segment Closed v n, Trail' Line v n) (Segment Closed u n', Trail' Line u n') #

pattern (:>) :: forall a b. Snoc a a b b => a -> b -> a infixl 5 #

pattern (:<) :: forall b a. Cons b b a a => a -> b -> b infixr 5 #

(<|) :: Cons s s a a => a -> s -> s infixr 5 #

cons an element onto a container.

This is an infix alias for cons.

>>> a <| []
[a]
>>> a <| [b, c]
[a,b,c]
>>> a <| Seq.fromList []
fromList [a]
>>> a <| Seq.fromList [b, c]
fromList [a,b,c]

cons :: Cons s s a a => a -> s -> s infixr 5 #

cons an element onto a container.

>>> cons a []
[a]
>>> cons a [b, c]
[a,b,c]
>>> cons a (Seq.fromList [])
fromList [a]
>>> cons a (Seq.fromList [b, c])
fromList [a,b,c]

uncons :: Cons s s a a => s -> Maybe (a, s) #

Attempt to extract the left-most element from a container, and a version of the container without that element.

>>> uncons []
Nothing
>>> uncons [a, b, c]
Just (a,[b,c])

_head :: Cons s s a a => Traversal' s a #

A Traversal reading and writing to the head of a non-empty container.

>>> [a,b,c]^? _head
Just a
>>> [a,b,c] & _head .~ d
[d,b,c]
>>> [a,b,c] & _head %~ f
[f a,b,c]
>>> [] & _head %~ f
[]
>>> [1,2,3]^?!_head
1
>>> []^?_head
Nothing
>>> [1,2]^?_head
Just 1
>>> [] & _head .~ 1
[]
>>> [0] & _head .~ 2
[2]
>>> [0,1] & _head .~ 2
[2,1]

This isn't limited to lists.

For instance you can also traverse the head of a Seq:

>>> Seq.fromList [a,b,c,d] & _head %~ f
fromList [f a,b,c,d]
>>> Seq.fromList [] ^? _head
Nothing
>>> Seq.fromList [a,b,c,d] ^? _head
Just a
_head :: Traversal' [a] a
_head :: Traversal' (Seq a) a
_head :: Traversal' (Vector a) a

_tail :: Cons s s a a => Traversal' s s #

A Traversal reading and writing to the tail of a non-empty container.

>>> [a,b] & _tail .~ [c,d,e]
[a,c,d,e]
>>> [] & _tail .~ [a,b]
[]
>>> [a,b,c,d,e] & _tail.traverse %~ f
[a,f b,f c,f d,f e]
>>> [1,2] & _tail .~ [3,4,5]
[1,3,4,5]
>>> [] & _tail .~ [1,2]
[]
>>> [a,b,c]^?_tail
Just [b,c]
>>> [1,2]^?!_tail
[2]
>>> "hello"^._tail
"ello"
>>> ""^._tail
""

This isn't limited to lists. For instance you can also traverse the tail of a Seq.

>>> Seq.fromList [a,b] & _tail .~ Seq.fromList [c,d,e]
fromList [a,c,d,e]
>>> Seq.fromList [a,b,c] ^? _tail
Just (fromList [b,c])
>>> Seq.fromList [] ^? _tail
Nothing
_tail :: Traversal' [a] [a]
_tail :: Traversal' (Seq a) (Seq a)
_tail :: Traversal' (Vector a) (Vector a)

_init :: Snoc s s a a => Traversal' s s #

A Traversal reading and replacing all but the a last element of a non-empty container.

>>> [a,b,c,d]^?_init
Just [a,b,c]
>>> []^?_init
Nothing
>>> [a,b] & _init .~ [c,d,e]
[c,d,e,b]
>>> [] & _init .~ [a,b]
[]
>>> [a,b,c,d] & _init.traverse %~ f
[f a,f b,f c,d]
>>> [1,2,3]^?_init
Just [1,2]
>>> [1,2,3,4]^?!_init
[1,2,3]
>>> "hello"^._init
"hell"
>>> ""^._init
""
_init :: Traversal' [a] [a]
_init :: Traversal' (Seq a) (Seq a)
_init :: Traversal' (Vector a) (Vector a)

_last :: Snoc s s a a => Traversal' s a #

A Traversal reading and writing to the last element of a non-empty container.

>>> [a,b,c]^?!_last
c
>>> []^?_last
Nothing
>>> [a,b,c] & _last %~ f
[a,b,f c]
>>> [1,2]^?_last
Just 2
>>> [] & _last .~ 1
[]
>>> [0] & _last .~ 2
[2]
>>> [0,1] & _last .~ 2
[0,2]

This Traversal is not limited to lists, however. We can also work with other containers, such as a Vector.

>>> Vector.fromList "abcde" ^? _last
Just 'e'
>>> Vector.empty ^? _last
Nothing
>>> (Vector.fromList "abcde" & _last .~ 'Q') == Vector.fromList "abcdQ"
True
_last :: Traversal' [a] a
_last :: Traversal' (Seq a) a
_last :: Traversal' (Vector a) a

(|>) :: Snoc s s a a => s -> a -> s infixl 5 #

snoc an element onto the end of a container.

This is an infix alias for snoc.

>>> Seq.fromList [] |> a
fromList [a]
>>> Seq.fromList [b, c] |> a
fromList [b,c,a]
>>> LazyT.pack "hello" |> '!'
"hello!"

snoc :: Snoc s s a a => s -> a -> s infixl 5 #

snoc an element onto the end of a container.

>>> snoc (Seq.fromList []) a
fromList [a]
>>> snoc (Seq.fromList [b, c]) a
fromList [b,c,a]
>>> snoc (LazyT.pack "hello") '!'
"hello!"

unsnoc :: Snoc s s a a => s -> Maybe (s, a) #

Attempt to extract the right-most element from a container, and a version of the container without that element.

>>> unsnoc (LazyT.pack "hello!")
Just ("hello",'!')
>>> unsnoc (LazyT.pack "")
Nothing
>>> unsnoc (Seq.fromList [b,c,a])
Just (fromList [b,c],a)
>>> unsnoc (Seq.fromList [])
Nothing

class (Rewrapped s t, Rewrapped t s) => Rewrapping s t #

Instances
(Rewrapped s t, Rewrapped t s) => Rewrapping s t 
Instance details

Defined in Control.Lens.Wrapped

class Wrapped s => Rewrapped s t #

Instances
t ~ PatternMatchFail => Rewrapped PatternMatchFail t 
Instance details

Defined in Control.Lens.Wrapped

t ~ RecSelError => Rewrapped RecSelError t 
Instance details

Defined in Control.Lens.Wrapped

t ~ RecConError => Rewrapped RecConError t 
Instance details

Defined in Control.Lens.Wrapped

t ~ RecUpdError => Rewrapped RecUpdError t 
Instance details

Defined in Control.Lens.Wrapped

t ~ NoMethodError => Rewrapped NoMethodError t 
Instance details

Defined in Control.Lens.Wrapped

t ~ TypeError => Rewrapped TypeError t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CDev t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CIno t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CMode t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped COff t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CPid t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CSsize t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CGid t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CNlink t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CUid t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CCc t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CSpeed t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CTcflag t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CRLim t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CBlkSize t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CBlkCnt t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CClockId t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CFsBlkCnt t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CFsFilCnt t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CId t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CKey t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CTimer t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped Fd t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped Errno t 
Instance details

Defined in Control.Lens.Wrapped

t ~ CompactionFailed => Rewrapped CompactionFailed t 
Instance details

Defined in Control.Lens.Wrapped

t ~ AssertionFailed => Rewrapped AssertionFailed t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ErrorCall => Rewrapped ErrorCall t 
Instance details

Defined in Control.Lens.Wrapped

t ~ All => Rewrapped All t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Any => Rewrapped Any t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CChar t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CSChar t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CUChar t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CShort t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CUShort t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CInt t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CUInt t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CLong t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CULong t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CLLong t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CULLong t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CBool t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CFloat t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CDouble t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CPtrdiff t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CSize t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CWchar t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CSigAtomic t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CClock t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CTime t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CUSeconds t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CSUSeconds t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CIntPtr t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CUIntPtr t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CIntMax t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped CUIntMax t 
Instance details

Defined in Control.Lens.Wrapped

t ~ IntSet => Rewrapped IntSet t

Use wrapping fromList. unwrapping returns a sorted list.

Instance details

Defined in Control.Lens.Wrapped

Rewrapped Name Name 
Instance details

Defined in Diagrams.Core.Names

Rewrapped SegCount SegCount 
Instance details

Defined in Diagrams.Segment

t ~ Par1 p' => Rewrapped (Par1 p) t 
Instance details

Defined in Control.Lens.Wrapped

(t ~ Set a', Ord a) => Rewrapped (Set a) t

Use wrapping fromList. unwrapping returns a sorted list.

Instance details

Defined in Control.Lens.Wrapped

t ~ Identity b => Rewrapped (Identity a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ZipList b => Rewrapped (ZipList a) t 
Instance details

Defined in Control.Lens.Wrapped

(Storable a, t ~ Vector a') => Rewrapped (Vector a) t 
Instance details

Defined in Control.Lens.Wrapped

Active a1 ~ t => Rewrapped (Active a2) t 
Instance details

Defined in Data.Active

Duration n1 ~ t => Rewrapped (Duration n2) t 
Instance details

Defined in Data.Active

Time n1 ~ t => Rewrapped (Time n2) t 
Instance details

Defined in Data.Active

t ~ Predicate b => Rewrapped (Predicate a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Comparison b => Rewrapped (Comparison a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Equivalence b => Rewrapped (Equivalence a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Min b => Rewrapped (Min a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Max b => Rewrapped (Max a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ First b => Rewrapped (First a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Last b => Rewrapped (Last a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WrappedMonoid b => Rewrapped (WrappedMonoid a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Option b => Rewrapped (Option a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ First b => Rewrapped (First a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Last b => Rewrapped (Last a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Dual b => Rewrapped (Dual a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Endo b => Rewrapped (Endo a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Sum b => Rewrapped (Sum a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Product b => Rewrapped (Product a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Down b => Rewrapped (Down a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ NonEmpty b => Rewrapped (NonEmpty a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Vector a' => Rewrapped (Vector a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ IntMap a' => Rewrapped (IntMap a) t

Use wrapping fromList. unwrapping returns a sorted list.

Instance details

Defined in Control.Lens.Wrapped

t ~ Seq a' => Rewrapped (Seq a) t 
Instance details

Defined in Control.Lens.Wrapped

(Unbox a, t ~ Vector a') => Rewrapped (Vector a) t 
Instance details

Defined in Control.Lens.Wrapped

Clip n1 ~ t => Rewrapped (Clip n2) t 
Instance details

Defined in Diagrams.TwoD.Path

(Prim a, t ~ Vector a') => Rewrapped (Vector a) t 
Instance details

Defined in Control.Lens.Wrapped

(t ~ HashSet a', Hashable a, Eq a) => Rewrapped (HashSet a) t

Use wrapping fromList. Unwrapping returns some permutation of the list.

Instance details

Defined in Control.Lens.Wrapped

Rewrapped (TransInv t) (TransInv t') 
Instance details

Defined in Diagrams.Core.Transform

Rewrapped (ArcLength n) (ArcLength n') 
Instance details

Defined in Diagrams.Segment

(t ~ Map k' a', Ord k) => Rewrapped (Map k a) t

Use wrapping fromList. unwrapping returns a sorted list.

Instance details

Defined in Control.Lens.Wrapped

t ~ WrappedMonad m' a' => Rewrapped (WrappedMonad m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Op a' b' => Rewrapped (Op a b) t 
Instance details

Defined in Control.Lens.Wrapped

(t ~ HashMap k' a', Hashable k, Eq k) => Rewrapped (HashMap k a) t

Use wrapping fromList. Unwrapping returns some permutation of the list.

Instance details

Defined in Control.Lens.Wrapped

t ~ ArrowMonad m' a' => Rewrapped (ArrowMonad m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Point g b => Rewrapped (Point f a) t 
Instance details

Defined in Linear.Affine

t ~ MaybeT n b => Rewrapped (MaybeT m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ CatchT m' a' => Rewrapped (CatchT m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ CoiterT w' a' => Rewrapped (CoiterT w a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ IterT m' a' => Rewrapped (IterT m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Alt f' a' => Rewrapped (Alt f a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ListT n b => Rewrapped (ListT m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WrappedApplicative f' a' => Rewrapped (WrappedApplicative f a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ MaybeApply f' a' => Rewrapped (MaybeApply f a) t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped (Envelope v n) (Envelope v' n') 
Instance details

Defined in Diagrams.Core.Envelope

Rewrapped (Trace v n) (Trace v' n') 
Instance details

Defined in Diagrams.Core.Trace

Rewrapped (Style v n) (Style v' n') 
Instance details

Defined in Diagrams.Core.Style

Rewrapped (Path v n) (Path v' n') 
Instance details

Defined in Diagrams.Path

Rewrapped (SegTree v n) (SegTree v' n') 
Instance details

Defined in Diagrams.Trail

Rewrapped (Trail v n) (Trail v' n') 
Instance details

Defined in Diagrams.Trail

Rewrapped (TotalOffset v n) (TotalOffset v' n') 
Instance details

Defined in Diagrams.Segment

t ~ Rec1 f' p' => Rewrapped (Rec1 f p) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ IdentityT n b => Rewrapped (IdentityT m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Const a' x' => Rewrapped (Const a x) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WrappedArrow a' b' c' => Rewrapped (WrappedArrow a b c) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Kleisli m' a' b' => Rewrapped (Kleisli m a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Ap g b => Rewrapped (Ap f a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Alt g b => Rewrapped (Alt f a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Join p' a' => Rewrapped (Join p a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Fix p' a' => Rewrapped (Fix p a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ TracedT m' w' a' => Rewrapped (TracedT m w a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Compose f' g' a' => Rewrapped (Compose f g a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ComposeFC f' g' a' => Rewrapped (ComposeFC f g a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ComposeCF f' g' a' => Rewrapped (ComposeCF f g a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ExceptT e' m' a' => Rewrapped (ExceptT e m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ FreeT f' m' a' => Rewrapped (FreeT f m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ CofreeT f' w' a' => Rewrapped (CofreeT f w a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ApT f' g' a' => Rewrapped (ApT f g a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ErrorT e' m' a' => Rewrapped (ErrorT e m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ StateT s' m' a' => Rewrapped (StateT s m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Backwards g b => Rewrapped (Backwards f a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WriterT w' m' a' => Rewrapped (WriterT w m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ StateT s' m' a' => Rewrapped (StateT s m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WriterT w' m' a' => Rewrapped (WriterT w m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Star f' d' c' => Rewrapped (Star f d c) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Costar f' d' c' => Rewrapped (Costar f d c) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WrappedArrow p' a' b' => Rewrapped (WrappedArrow p a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Forget r' a' b' => Rewrapped (Forget r a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Static f' a' b' => Rewrapped (Static f a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Tagged s' a' => Rewrapped (Tagged s a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Reverse g b => Rewrapped (Reverse f a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Constant a' b' => Rewrapped (Constant a b) t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped (Query v a m) (Query v' a' m') 
Instance details

Defined in Diagrams.Core.Query

Rewrapped (Trail' Line v n) (Trail' Line v' n') 
Instance details

Defined in Diagrams.Trail

t ~ K1 i' c' p' => Rewrapped (K1 i c p) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ReaderT s n b => Rewrapped (ReaderT r m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ ContT r' m' a' => Rewrapped (ContT r m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Cayley f' p' a' b' => Rewrapped (Cayley f p a b) t 
Instance details

Defined in Control.Lens.Wrapped

Rewrapped (QDiagram b v n m) (QDiagram b' v' n' m') 
Instance details

Defined in Diagrams.Core.Types

Rewrapped (SubMap b v n m) (SubMap b' v' n' m') 
Instance details

Defined in Diagrams.Core.Types

t ~ M1 i' c' f' p' => Rewrapped (M1 i c f p) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ (f' :.: g') p' => Rewrapped ((f :.: g) p) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Compose f' g' a' => Rewrapped (Compose f g a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WrappedBifunctor p' a' b' => Rewrapped (WrappedBifunctor p a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Joker g' a' b' => Rewrapped (Joker g a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Flip p' a' b' => Rewrapped (Flip p a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Clown f' a' b' => Rewrapped (Clown f a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ RWST r' w' s' m' a' => Rewrapped (RWST r w s m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ RWST r' w' s' m' a' => Rewrapped (RWST r w s m a) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Dual k' a' b' => Rewrapped (Dual k6 a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ WrappedCategory k' a' b' => Rewrapped (WrappedCategory k6 a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Semi m' a' b' => Rewrapped (Semi m a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Tannen f' p' a' b' => Rewrapped (Tannen f p a b) t 
Instance details

Defined in Control.Lens.Wrapped

t ~ Biff p' f' g' a' b' => Rewrapped (Biff p f g a b) t 
Instance details

Defined in Control.Lens.Wrapped

class Wrapped s where #

Wrapped provides isomorphisms to wrap and unwrap newtypes or data types with one constructor.

Minimal complete definition

Nothing

Associated Types

type Unwrapped s :: Type #

Methods

_Wrapped' :: Iso' s (Unwrapped s) #

An isomorphism between s and a.

If your type has a Generic instance, _Wrapped' will default to _GWrapped', and you can choose to not override it with your own definition.

Instances
Wrapped PatternMatchFail 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped PatternMatchFail :: Type #

Wrapped RecSelError 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped RecSelError :: Type #

Wrapped RecConError 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped RecConError :: Type #

Wrapped RecUpdError 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped RecUpdError :: Type #

Wrapped NoMethodError 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped NoMethodError :: Type #

Wrapped TypeError 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped TypeError :: Type #

Wrapped CDev 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CDev :: Type #

Wrapped CIno 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CIno :: Type #

Wrapped CMode 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CMode :: Type #

Wrapped COff 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped COff :: Type #

Wrapped CPid 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CPid :: Type #

Wrapped CSsize 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CSsize :: Type #

Wrapped CGid 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CGid :: Type #

Wrapped CNlink 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CNlink :: Type #

Wrapped CUid 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CUid :: Type #

Wrapped CCc 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CCc :: Type #

Wrapped CSpeed 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CSpeed :: Type #

Wrapped CTcflag 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CTcflag :: Type #

Wrapped CRLim 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CRLim :: Type #

Wrapped CBlkSize 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CBlkSize :: Type #

Wrapped CBlkCnt 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CBlkCnt :: Type #

Wrapped CClockId 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CClockId :: Type #

Wrapped CFsBlkCnt 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CFsBlkCnt :: Type #

Wrapped CFsFilCnt 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CFsFilCnt :: Type #

Wrapped CId 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CId :: Type #

Wrapped CKey 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CKey :: Type #

Wrapped CTimer 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CTimer :: Type #

Wrapped Fd 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped Fd :: Type #

Wrapped Errno 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped Errno :: Type #

Wrapped CompactionFailed 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CompactionFailed :: Type #

Wrapped AssertionFailed 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped AssertionFailed :: Type #

Wrapped ErrorCall 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped ErrorCall :: Type #

Wrapped All 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped All :: Type #

Wrapped Any 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped Any :: Type #

Wrapped CChar 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CChar :: Type #

Wrapped CSChar 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CSChar :: Type #

Wrapped CUChar 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CUChar :: Type #

Wrapped CShort 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CShort :: Type #

Wrapped CUShort 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CUShort :: Type #

Wrapped CInt 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CInt :: Type #

Wrapped CUInt 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CUInt :: Type #

Wrapped CLong 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CLong :: Type #

Wrapped CULong 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CULong :: Type #

Wrapped CLLong 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CLLong :: Type #

Wrapped CULLong 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CULLong :: Type #

Wrapped CBool 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CBool :: Type #

Wrapped CFloat 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CFloat :: Type #

Wrapped CDouble 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CDouble :: Type #

Wrapped CPtrdiff 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CPtrdiff :: Type #

Wrapped CSize 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CSize :: Type #

Wrapped CWchar 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CWchar :: Type #

Wrapped CSigAtomic 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CSigAtomic :: Type #

Wrapped CClock 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CClock :: Type #

Wrapped CTime 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CTime :: Type #

Wrapped CUSeconds 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CUSeconds :: Type #

Wrapped CSUSeconds 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CSUSeconds :: Type #

Wrapped CIntPtr 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CIntPtr :: Type #

Wrapped CUIntPtr 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CUIntPtr :: Type #

Wrapped CIntMax 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CIntMax :: Type #

Wrapped CUIntMax 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped CUIntMax :: Type #

Wrapped IntSet 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped IntSet :: Type #

Wrapped Name 
Instance details

Defined in Diagrams.Core.Names

Associated Types

type Unwrapped Name :: Type #

Wrapped SegCount 
Instance details

Defined in Diagrams.Segment

Associated Types

type Unwrapped SegCount :: Type #

Wrapped (Par1 p) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Par1 p) :: Type #

Methods

_Wrapped' :: Iso' (Par1 p) (Unwrapped (Par1 p)) #

Ord a => Wrapped (Set a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Set a) :: Type #

Methods

_Wrapped' :: Iso' (Set a) (Unwrapped (Set a)) #

Wrapped (Identity a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Identity a) :: Type #

Wrapped (ZipList a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ZipList a) :: Type #

Methods

_Wrapped' :: Iso' (ZipList a) (Unwrapped (ZipList a)) #

Storable a => Wrapped (Vector a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Vector a) :: Type #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Wrapped (Active a) 
Instance details

Defined in Data.Active

Associated Types

type Unwrapped (Active a) :: Type #

Methods

_Wrapped' :: Iso' (Active a) (Unwrapped (Active a)) #

Wrapped (Duration n) 
Instance details

Defined in Data.Active

Associated Types

type Unwrapped (Duration n) :: Type #

Wrapped (Time n) 
Instance details

Defined in Data.Active

Associated Types

type Unwrapped (Time n) :: Type #

Methods

_Wrapped' :: Iso' (Time n) (Unwrapped (Time n)) #

Wrapped (Predicate a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Predicate a) :: Type #

Wrapped (Comparison a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Comparison a) :: Type #

Wrapped (Equivalence a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Equivalence a) :: Type #

Wrapped (Min a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Min a) :: Type #

Methods

_Wrapped' :: Iso' (Min a) (Unwrapped (Min a)) #

Wrapped (Max a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Max a) :: Type #

Methods

_Wrapped' :: Iso' (Max a) (Unwrapped (Max a)) #

Wrapped (First a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (First a) :: Type #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Last a) :: Type #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (WrappedMonoid a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedMonoid a) :: Type #

Wrapped (Option a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Option a) :: Type #

Methods

_Wrapped' :: Iso' (Option a) (Unwrapped (Option a)) #

Wrapped (First a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (First a) :: Type #

Methods

_Wrapped' :: Iso' (First a) (Unwrapped (First a)) #

Wrapped (Last a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Last a) :: Type #

Methods

_Wrapped' :: Iso' (Last a) (Unwrapped (Last a)) #

Wrapped (Dual a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Dual a) :: Type #

Methods

_Wrapped' :: Iso' (Dual a) (Unwrapped (Dual a)) #

Wrapped (Endo a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Endo a) :: Type #

Methods

_Wrapped' :: Iso' (Endo a) (Unwrapped (Endo a)) #

Wrapped (Sum a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Sum a) :: Type #

Methods

_Wrapped' :: Iso' (Sum a) (Unwrapped (Sum a)) #

Wrapped (Product a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Product a) :: Type #

Methods

_Wrapped' :: Iso' (Product a) (Unwrapped (Product a)) #

Wrapped (Down a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Down a) :: Type #

Methods

_Wrapped' :: Iso' (Down a) (Unwrapped (Down a)) #

Wrapped (NonEmpty a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (NonEmpty a) :: Type #

Wrapped (Vector a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Vector a) :: Type #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Wrapped (IntMap a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (IntMap a) :: Type #

Methods

_Wrapped' :: Iso' (IntMap a) (Unwrapped (IntMap a)) #

Wrapped (Seq a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Seq a) :: Type #

Methods

_Wrapped' :: Iso' (Seq a) (Unwrapped (Seq a)) #

Wrapped (TransInv t) 
Instance details

Defined in Diagrams.Core.Transform

Associated Types

type Unwrapped (TransInv t) :: Type #

Unbox a => Wrapped (Vector a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Vector a) :: Type #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

Wrapped (Clip n) 
Instance details

Defined in Diagrams.TwoD.Path

Associated Types

type Unwrapped (Clip n) :: Type #

Methods

_Wrapped' :: Iso' (Clip n) (Unwrapped (Clip n)) #

Wrapped (ArcLength n) 
Instance details

Defined in Diagrams.Segment

Associated Types

type Unwrapped (ArcLength n) :: Type #

Prim a => Wrapped (Vector a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Vector a) :: Type #

Methods

_Wrapped' :: Iso' (Vector a) (Unwrapped (Vector a)) #

(Hashable a, Eq a) => Wrapped (HashSet a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (HashSet a) :: Type #

Methods

_Wrapped' :: Iso' (HashSet a) (Unwrapped (HashSet a)) #

Ord k => Wrapped (Map k a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Map k a) :: Type #

Methods

_Wrapped' :: Iso' (Map k a) (Unwrapped (Map k a)) #

Wrapped (WrappedMonad m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedMonad m a) :: Type #

Wrapped (Op a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Op a b) :: Type #

Methods

_Wrapped' :: Iso' (Op a b) (Unwrapped (Op a b)) #

(Hashable k, Eq k) => Wrapped (HashMap k a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (HashMap k a) :: Type #

Methods

_Wrapped' :: Iso' (HashMap k a) (Unwrapped (HashMap k a)) #

Wrapped (ArrowMonad m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ArrowMonad m a) :: Type #

Methods

_Wrapped' :: Iso' (ArrowMonad m a) (Unwrapped (ArrowMonad m a)) #

Wrapped (Envelope v n) 
Instance details

Defined in Diagrams.Core.Envelope

Associated Types

type Unwrapped (Envelope v n) :: Type #

Methods

_Wrapped' :: Iso' (Envelope v n) (Unwrapped (Envelope v n)) #

Wrapped (Trace v n) 
Instance details

Defined in Diagrams.Core.Trace

Associated Types

type Unwrapped (Trace v n) :: Type #

Methods

_Wrapped' :: Iso' (Trace v n) (Unwrapped (Trace v n)) #

Wrapped (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Associated Types

type Unwrapped (Style v n) :: Type #

Methods

_Wrapped' :: Iso' (Style v n) (Unwrapped (Style v n)) #

Wrapped (Point f a) 
Instance details

Defined in Linear.Affine

Associated Types

type Unwrapped (Point f a) :: Type #

Methods

_Wrapped' :: Iso' (Point f a) (Unwrapped (Point f a)) #

Wrapped (MaybeT m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (MaybeT m a) :: Type #

Methods

_Wrapped' :: Iso' (MaybeT m a) (Unwrapped (MaybeT m a)) #

Wrapped (Path v n) 
Instance details

Defined in Diagrams.Path

Associated Types

type Unwrapped (Path v n) :: Type #

Methods

_Wrapped' :: Iso' (Path v n) (Unwrapped (Path v n)) #

Wrapped (SegTree v n) 
Instance details

Defined in Diagrams.Trail

Associated Types

type Unwrapped (SegTree v n) :: Type #

Methods

_Wrapped' :: Iso' (SegTree v n) (Unwrapped (SegTree v n)) #

Wrapped (Trail v n) 
Instance details

Defined in Diagrams.Trail

Associated Types

type Unwrapped (Trail v n) :: Type #

Methods

_Wrapped' :: Iso' (Trail v n) (Unwrapped (Trail v n)) #

Wrapped (TotalOffset v n) 
Instance details

Defined in Diagrams.Segment

Associated Types

type Unwrapped (TotalOffset v n) :: Type #

Wrapped (CatchT m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (CatchT m a) :: Type #

Methods

_Wrapped' :: Iso' (CatchT m a) (Unwrapped (CatchT m a)) #

Wrapped (CoiterT w a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (CoiterT w a) :: Type #

Methods

_Wrapped' :: Iso' (CoiterT w a) (Unwrapped (CoiterT w a)) #

Wrapped (IterT m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (IterT m a) :: Type #

Methods

_Wrapped' :: Iso' (IterT m a) (Unwrapped (IterT m a)) #

Wrapped (Alt f a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Alt f a) :: Type #

Methods

_Wrapped' :: Iso' (Alt f a) (Unwrapped (Alt f a)) #

Wrapped (ListT m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ListT m a) :: Type #

Methods

_Wrapped' :: Iso' (ListT m a) (Unwrapped (ListT m a)) #

Wrapped (WrappedApplicative f a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedApplicative f a) :: Type #

Wrapped (MaybeApply f a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (MaybeApply f a) :: Type #

Methods

_Wrapped' :: Iso' (MaybeApply f a) (Unwrapped (MaybeApply f a)) #

Wrapped (Rec1 f p) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Rec1 f p) :: Type #

Methods

_Wrapped' :: Iso' (Rec1 f p) (Unwrapped (Rec1 f p)) #

Wrapped (IdentityT m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (IdentityT m a) :: Type #

Methods

_Wrapped' :: Iso' (IdentityT m a) (Unwrapped (IdentityT m a)) #

Wrapped (Const a x) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Const a x) :: Type #

Methods

_Wrapped' :: Iso' (Const a x) (Unwrapped (Const a x)) #

Wrapped (WrappedArrow a b c) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedArrow a b c) :: Type #

Methods

_Wrapped' :: Iso' (WrappedArrow a b c) (Unwrapped (WrappedArrow a b c)) #

Wrapped (Kleisli m a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Kleisli m a b) :: Type #

Methods

_Wrapped' :: Iso' (Kleisli m a b) (Unwrapped (Kleisli m a b)) #

Wrapped (Ap f a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Ap f a) :: Type #

Methods

_Wrapped' :: Iso' (Ap f a) (Unwrapped (Ap f a)) #

Wrapped (Alt f a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Alt f a) :: Type #

Methods

_Wrapped' :: Iso' (Alt f a) (Unwrapped (Alt f a)) #

Wrapped (Join p a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Join p a) :: Type #

Methods

_Wrapped' :: Iso' (Join p a) (Unwrapped (Join p a)) #

Wrapped (Fix p a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Fix p a) :: Type #

Methods

_Wrapped' :: Iso' (Fix p a) (Unwrapped (Fix p a)) #

Wrapped (TracedT m w a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (TracedT m w a) :: Type #

Methods

_Wrapped' :: Iso' (TracedT m w a) (Unwrapped (TracedT m w a)) #

Wrapped (Compose f g a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Compose f g a) :: Type #

Methods

_Wrapped' :: Iso' (Compose f g a) (Unwrapped (Compose f g a)) #

Wrapped (ComposeFC f g a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ComposeFC f g a) :: Type #

Methods

_Wrapped' :: Iso' (ComposeFC f g a) (Unwrapped (ComposeFC f g a)) #

Wrapped (ComposeCF f g a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ComposeCF f g a) :: Type #

Methods

_Wrapped' :: Iso' (ComposeCF f g a) (Unwrapped (ComposeCF f g a)) #

Wrapped (Query v n m) 
Instance details

Defined in Diagrams.Core.Query

Associated Types

type Unwrapped (Query v n m) :: Type #

Methods

_Wrapped' :: Iso' (Query v n m) (Unwrapped (Query v n m)) #

Wrapped (Trail' Line v n) 
Instance details

Defined in Diagrams.Trail

Associated Types

type Unwrapped (Trail' Line v n) :: Type #

Methods

_Wrapped' :: Iso' (Trail' Line v n) (Unwrapped (Trail' Line v n)) #

Wrapped (ExceptT e m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ExceptT e m a) :: Type #

Methods

_Wrapped' :: Iso' (ExceptT e m a) (Unwrapped (ExceptT e m a)) #

Wrapped (FreeT f m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (FreeT f m a) :: Type #

Methods

_Wrapped' :: Iso' (FreeT f m a) (Unwrapped (FreeT f m a)) #

Wrapped (CofreeT f w a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (CofreeT f w a) :: Type #

Methods

_Wrapped' :: Iso' (CofreeT f w a) (Unwrapped (CofreeT f w a)) #

Wrapped (ApT f g a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ApT f g a) :: Type #

Methods

_Wrapped' :: Iso' (ApT f g a) (Unwrapped (ApT f g a)) #

Wrapped (ErrorT e m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ErrorT e m a) :: Type #

Methods

_Wrapped' :: Iso' (ErrorT e m a) (Unwrapped (ErrorT e m a)) #

Wrapped (StateT s m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (StateT s m a) :: Type #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (Backwards f a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Backwards f a) :: Type #

Methods

_Wrapped' :: Iso' (Backwards f a) (Unwrapped (Backwards f a)) #

Wrapped (WriterT w m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WriterT w m a) :: Type #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (StateT s m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (StateT s m a) :: Type #

Methods

_Wrapped' :: Iso' (StateT s m a) (Unwrapped (StateT s m a)) #

Wrapped (WriterT w m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WriterT w m a) :: Type #

Methods

_Wrapped' :: Iso' (WriterT w m a) (Unwrapped (WriterT w m a)) #

Wrapped (Star f d c) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Star f d c) :: Type #

Methods

_Wrapped' :: Iso' (Star f d c) (Unwrapped (Star f d c)) #

Wrapped (Costar f d c) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Costar f d c) :: Type #

Methods

_Wrapped' :: Iso' (Costar f d c) (Unwrapped (Costar f d c)) #

Wrapped (WrappedArrow p a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedArrow p a b) :: Type #

Methods

_Wrapped' :: Iso' (WrappedArrow p a b) (Unwrapped (WrappedArrow p a b)) #

Wrapped (Forget r a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Forget r a b) :: Type #

Methods

_Wrapped' :: Iso' (Forget r a b) (Unwrapped (Forget r a b)) #

Wrapped (Static f a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Static f a b) :: Type #

Methods

_Wrapped' :: Iso' (Static f a b) (Unwrapped (Static f a b)) #

Wrapped (Tagged s a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Tagged s a) :: Type #

Methods

_Wrapped' :: Iso' (Tagged s a) (Unwrapped (Tagged s a)) #

Wrapped (Reverse f a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Reverse f a) :: Type #

Methods

_Wrapped' :: Iso' (Reverse f a) (Unwrapped (Reverse f a)) #

Wrapped (Constant a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Constant a b) :: Type #

Methods

_Wrapped' :: Iso' (Constant a b) (Unwrapped (Constant a b)) #

Wrapped (K1 i c p) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (K1 i c p) :: Type #

Methods

_Wrapped' :: Iso' (K1 i c p) (Unwrapped (K1 i c p)) #

Wrapped (QDiagram b v n m) 
Instance details

Defined in Diagrams.Core.Types

Associated Types

type Unwrapped (QDiagram b v n m) :: Type #

Methods

_Wrapped' :: Iso' (QDiagram b v n m) (Unwrapped (QDiagram b v n m)) #

Wrapped (SubMap b v n m) 
Instance details

Defined in Diagrams.Core.Types

Associated Types

type Unwrapped (SubMap b v n m) :: Type #

Methods

_Wrapped' :: Iso' (SubMap b v n m) (Unwrapped (SubMap b v n m)) #

Wrapped (ReaderT r m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ReaderT r m a) :: Type #

Methods

_Wrapped' :: Iso' (ReaderT r m a) (Unwrapped (ReaderT r m a)) #

Wrapped (ContT r m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (ContT r m a) :: Type #

Methods

_Wrapped' :: Iso' (ContT r m a) (Unwrapped (ContT r m a)) #

Wrapped (Cayley f p a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Cayley f p a b) :: Type #

Methods

_Wrapped' :: Iso' (Cayley f p a b) (Unwrapped (Cayley f p a b)) #

Wrapped (M1 i c f p) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (M1 i c f p) :: Type #

Methods

_Wrapped' :: Iso' (M1 i c f p) (Unwrapped (M1 i c f p)) #

Wrapped ((f :.: g) p) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped ((f :.: g) p) :: Type #

Methods

_Wrapped' :: Iso' ((f :.: g) p) (Unwrapped ((f :.: g) p)) #

Wrapped (Compose f g a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Compose f g a) :: Type #

Methods

_Wrapped' :: Iso' (Compose f g a) (Unwrapped (Compose f g a)) #

Wrapped (WrappedBifunctor p a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedBifunctor p a b) :: Type #

Wrapped (Joker g a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Joker g a b) :: Type #

Methods

_Wrapped' :: Iso' (Joker g a b) (Unwrapped (Joker g a b)) #

Wrapped (Flip p a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Flip p a b) :: Type #

Methods

_Wrapped' :: Iso' (Flip p a b) (Unwrapped (Flip p a b)) #

Wrapped (Clown f a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Clown f a b) :: Type #

Methods

_Wrapped' :: Iso' (Clown f a b) (Unwrapped (Clown f a b)) #

Wrapped (RWST r w s m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (RWST r w s m a) :: Type #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

Wrapped (RWST r w s m a) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (RWST r w s m a) :: Type #

Methods

_Wrapped' :: Iso' (RWST r w s m a) (Unwrapped (RWST r w s m a)) #

Wrapped (Dual k3 a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Dual k3 a b) :: Type #

Methods

_Wrapped' :: Iso' (Dual k3 a b) (Unwrapped (Dual k3 a b)) #

Wrapped (WrappedCategory k3 a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (WrappedCategory k3 a b) :: Type #

Wrapped (Semi m a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Semi m a b) :: Type #

Methods

_Wrapped' :: Iso' (Semi m a b) (Unwrapped (Semi m a b)) #

Wrapped (Tannen f p a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Tannen f p a b) :: Type #

Methods

_Wrapped' :: Iso' (Tannen f p a b) (Unwrapped (Tannen f p a b)) #

Wrapped (Biff p f g a b) 
Instance details

Defined in Control.Lens.Wrapped

Associated Types

type Unwrapped (Biff p f g a b) :: Type #

Methods

_Wrapped' :: Iso' (Biff p f g a b) (Unwrapped (Biff p f g a b)) #

pattern Unwrapped :: forall t. Rewrapped t t => t -> Unwrapped t #

pattern Wrapped :: forall s. Rewrapped s s => Unwrapped s -> s #

_GWrapped' :: (Generic s, D1 d (C1 c (S1 s' (Rec0 a))) ~ Rep s, Unwrapped s ~ GUnwrapped (Rep s)) => Iso' s (Unwrapped s) #

Implement the _Wrapped operation for a type using its Generic instance.

_Wrapped :: Rewrapping s t => Iso s t (Unwrapped s) (Unwrapped t) #

Work under a newtype wrapper.

>>> Const "hello" & _Wrapped %~ Prelude.length & getConst
5
_Wrappedfrom _Unwrapped
_Unwrappedfrom _Wrapped

op :: Wrapped s => (Unwrapped s -> s) -> s -> Unwrapped s #

Given the constructor for a Wrapped type, return a deconstructor that is its inverse.

Assuming the Wrapped instance is legal, these laws hold:

op f . f ≡ id
f . op f ≡ id
>>> op Identity (Identity 4)
4
>>> op Const (Const "hello")
"hello"

_Wrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' s (Unwrapped s) #

This is a convenient version of _Wrapped with an argument that's ignored.

The user supplied function is ignored, merely its type is used.

_Unwrapping' :: Wrapped s => (Unwrapped s -> s) -> Iso' (Unwrapped s) s #

This is a convenient version of _Wrapped with an argument that's ignored.

The user supplied function is ignored, merely its type is used.

_Wrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t) #

This is a convenient version of _Wrapped with an argument that's ignored.

The user supplied function is ignored, merely its types are used.

_Unwrapping :: Rewrapping s t => (Unwrapped s -> s) -> Iso (Unwrapped t) (Unwrapped s) t s #

This is a convenient version of _Unwrapped with an argument that's ignored.

The user supplied function is ignored, merely its types are used.

ala :: (Functor f, Rewrapping s t) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s) #

This combinator is based on ala from Conor McBride's work on Epigram.

As with _Wrapping, the user supplied function for the newtype is ignored.

>>> ala Sum foldMap [1,2,3,4]
10
>>> ala All foldMap [True,True]
True
>>> ala All foldMap [True,False]
False
>>> ala Any foldMap [False,False]
False
>>> ala Any foldMap [True,False]
True
>>> ala Product foldMap [1,2,3,4]
24

You may want to think of this combinator as having the following, simpler, type.

ala :: Rewrapping s t => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> e -> s) -> e -> Unwrapped s

alaf :: (Functor f, Functor g, Rewrapping s t) => (Unwrapped s -> s) -> (f t -> g s) -> f (Unwrapped t) -> g (Unwrapped s) #

This combinator is based on ala' from Conor McBride's work on Epigram.

As with _Wrapping, the user supplied function for the newtype is ignored.

alaf :: Rewrapping s t => (Unwrapped s -> s) -> ((r ->  t) -> e -> s) -> (r -> Unwrapped t) -> e -> Unwrapped s
>>> alaf Sum foldMap Prelude.length ["hello","world"]
10

class (Magnified m ~ Magnified n, MonadReader b m, MonadReader a n) => Magnify (m :: Type -> Type) (n :: Type -> Type) b a | m -> b, n -> a, m a -> n, n b -> m where #

This class allows us to use magnify part of the environment, changing the environment supplied by many different Monad transformers. Unlike zoom this can change the environment of a deeply nested Monad transformer.

Also, unlike zoom, this can be used with any valid Getter, but cannot be used with a Traversal or Fold.

Methods

magnify :: LensLike' (Magnified m c) a b -> m c -> n c infixr 2 #

Run a monadic action in a larger environment than it was defined in, using a Getter.

This acts like local, but can in many cases change the type of the environment as well.

This is commonly used to lift actions in a simpler Reader Monad into a Monad with a larger environment type.

This can be used to edit pretty much any Monad transformer stack with an environment in it:

>>> (1,2) & magnify _2 (+1)
3
>>> flip Reader.runReader (1,2) $ magnify _1 Reader.ask
1
>>> flip Reader.runReader (1,2,[10..20]) $ magnify (_3._tail) Reader.ask
[11,12,13,14,15,16,17,18,19,20]
magnify :: Getter s a -> (a -> r) -> s -> r
magnify :: Monoid r => Fold s a   -> (a -> r) -> s -> r
magnify :: Monoid w                 => Getter s t -> RWS t w st c -> RWS s w st c
magnify :: (Monoid w, Monoid c) => Fold s a   -> RWS a w st c -> RWS s w st c
...
Instances
Magnify m n b a => Magnify (IdentityT m) (IdentityT n) b a 
Instance details

Defined in Control.Lens.Zoom

Methods

magnify :: LensLike' (Magnified (IdentityT m) c) a b -> IdentityT m c -> IdentityT n c #

Magnify ((->) b :: Type -> Type) ((->) a :: Type -> Type) b a
magnify = views
Instance details

Defined in Control.Lens.Zoom

Methods

magnify :: LensLike' (Magnified ((->) b) c) a b -> (b -> c) -> a -> c #

Monad m => Magnify (ReaderT b m) (ReaderT a m) b a 
Instance details

Defined in Control.Lens.Zoom

Methods

magnify :: LensLike' (Magnified (ReaderT b m) c) a b -> ReaderT b m c -> ReaderT a m c #

(Monad m, Monoid w) => Magnify (RWST b w s m) (RWST a w s m) b a 
Instance details

Defined in Control.Lens.Zoom

Methods

magnify :: LensLike' (Magnified (RWST b w s m) c) a b -> RWST b w s m c -> RWST a w s m c #

(Monad m, Monoid w) => Magnify (RWST b w s m) (RWST a w s m) b a 
Instance details

Defined in Control.Lens.Zoom

Methods

magnify :: LensLike' (Magnified (RWST b w s m) c) a b -> RWST b w s m c -> RWST a w s m c #

class (MonadState s m, MonadState t n) => Zoom (m :: Type -> Type) (n :: Type -> Type) s t | m -> s, n -> t, m t -> n, n s -> m where #

This class allows us to use zoom in, changing the State supplied by many different Monad transformers, potentially quite deep in a Monad transformer stack.

Methods

zoom :: LensLike' (Zoomed m c) t s -> m c -> n c infixr 2 #

Run a monadic action in a larger State than it was defined in, using a Lens' or Traversal'.

This is commonly used to lift actions in a simpler State Monad into a State Monad with a larger State type.

When applied to a Traversal' over multiple values, the actions for each target are executed sequentially and the results are aggregated.

This can be used to edit pretty much any Monad transformer stack with a State in it!

>>> flip State.evalState (a,b) $ zoom _1 $ use id
a
>>> flip State.execState (a,b) $ zoom _1 $ id .= c
(c,b)
>>> flip State.execState [(a,b),(c,d)] $ zoom traverse $ _2 %= f
[(a,f b),(c,f d)]
>>> flip State.runState [(a,b),(c,d)] $ zoom traverse $ _2 <%= f
(f b <> f d <> mempty,[(a,f b),(c,f d)])
>>> flip State.evalState (a,b) $ zoom both (use id)
a <> b
zoom :: Monad m             => Lens' s t      -> StateT t m a -> StateT s m a
zoom :: (Monad m, Monoid c) => Traversal' s t -> StateT t m c -> StateT s m c
zoom :: (Monad m, Monoid w)             => Lens' s t      -> RWST r w t m c -> RWST r w s m c
zoom :: (Monad m, Monoid w, Monoid c) => Traversal' s t -> RWST r w t m c -> RWST r w s m c
zoom :: (Monad m, Monoid w, Error e)  => Lens' s t      -> ErrorT e (RWST r w t m) c -> ErrorT e (RWST r w s m) c
zoom :: (Monad m, Monoid w, Monoid c, Error e) => Traversal' s t -> ErrorT e (RWST r w t m) c -> ErrorT e (RWST r w s m) c
...
Instances
Zoom m n s t => Zoom (MaybeT m) (MaybeT n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (MaybeT m) c) t s -> MaybeT m c -> MaybeT n c #

Zoom m n s t => Zoom (ListT m) (ListT n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (ListT m) c) t s -> ListT m c -> ListT n c #

Zoom m n s t => Zoom (IdentityT m) (IdentityT n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (IdentityT m) c) t s -> IdentityT m c -> IdentityT n c #

Zoom m n s t => Zoom (ExceptT e m) (ExceptT e n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (ExceptT e m) c) t s -> ExceptT e m c -> ExceptT e n c #

(Functor f, Zoom m n s t) => Zoom (FreeT f m) (FreeT f n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (FreeT f m) c) t s -> FreeT f m c -> FreeT f n c #

(Error e, Zoom m n s t) => Zoom (ErrorT e m) (ErrorT e n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (ErrorT e m) c) t s -> ErrorT e m c -> ErrorT e n c #

Monad z => Zoom (StateT s z) (StateT t z) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (StateT s z) c) t s -> StateT s z c -> StateT t z c #

(Monoid w, Zoom m n s t) => Zoom (WriterT w m) (WriterT w n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (WriterT w m) c) t s -> WriterT w m c -> WriterT w n c #

Monad z => Zoom (StateT s z) (StateT t z) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (StateT s z) c) t s -> StateT s z c -> StateT t z c #

(Monoid w, Zoom m n s t) => Zoom (WriterT w m) (WriterT w n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (WriterT w m) c) t s -> WriterT w m c -> WriterT w n c #

Zoom m n s t => Zoom (ReaderT e m) (ReaderT e n) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (ReaderT e m) c) t s -> ReaderT e m c -> ReaderT e n c #

(Monoid w, Monad z) => Zoom (RWST r w s z) (RWST r w t z) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (RWST r w s z) c) t s -> RWST r w s z c -> RWST r w t z c #

(Monoid w, Monad z) => Zoom (RWST r w s z) (RWST r w t z) s t 
Instance details

Defined in Control.Lens.Zoom

Methods

zoom :: LensLike' (Zoomed (RWST r w s z) c) t s -> RWST r w s z c -> RWST r w t z c #

type family Magnified (m :: Type -> Type) :: Type -> Type -> Type #

This type family is used by Magnify to describe the common effect type.

Instances
type Magnified (IdentityT m) 
Instance details

Defined in Control.Lens.Zoom

type Magnified ((->) b :: Type -> Type) 
Instance details

Defined in Control.Lens.Zoom

type Magnified ((->) b :: Type -> Type) = (Const :: Type -> Type -> Type)
type Magnified (ReaderT b m) 
Instance details

Defined in Control.Lens.Zoom

type Magnified (ReaderT b m) = Effect m
type Magnified (RWST a w s m) 
Instance details

Defined in Control.Lens.Zoom

type Magnified (RWST a w s m) = EffectRWS w s m
type Magnified (RWST a w s m) 
Instance details

Defined in Control.Lens.Zoom

type Magnified (RWST a w s m) = EffectRWS w s m

type family Zoomed (m :: Type -> Type) :: Type -> Type -> Type #

This type family is used by Zoom to describe the common effect type.

Instances
type Zoomed (MaybeT m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (ListT m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (ListT m) = FocusingOn [] (Zoomed m)
type Zoomed (IdentityT m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (IdentityT m) = Zoomed m
type Zoomed (ExceptT e m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (ExceptT e m) = FocusingErr e (Zoomed m)
type Zoomed (FreeT f m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (FreeT f m) = FocusingFree f m (Zoomed m)
type Zoomed (ErrorT e m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (ErrorT e m) = FocusingErr e (Zoomed m)
type Zoomed (StateT s z) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (StateT s z) = Focusing z
type Zoomed (WriterT w m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m)
type Zoomed (StateT s z) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (StateT s z) = Focusing z
type Zoomed (WriterT w m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m)
type Zoomed (ReaderT e m) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (ReaderT e m) = Zoomed m
type Zoomed (RWST r w s z) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (RWST r w s z) = FocusingWith w z
type Zoomed (RWST r w s z) 
Instance details

Defined in Control.Lens.Zoom

type Zoomed (RWST r w s z) = FocusingWith w z

class GPlated1 (f :: k -> Type) (g :: k -> Type) #

Minimal complete definition

gplate1'

Instances
GPlated1 (f :: k -> Type) (V1 :: k -> Type)

ignored

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (V1 a) (f a)

GPlated1 (f :: k -> Type) (U1 :: k -> Type)

ignored

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (U1 a) (f a)

GPlated1 (f :: k -> Type) (URec a :: k -> Type)

ignored

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (URec a a0) (f a0)

GPlated1 (f :: k -> Type) (Rec1 f :: k -> Type)

match

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (Rec1 f a) (f a)

GPlated1 (f :: k -> Type) (Rec1 g :: k -> Type)

ignored

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (Rec1 g a) (f a)

GPlated1 (f :: k -> Type) (K1 i a :: k -> Type)

ignored

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (K1 i a a0) (f a0)

(GPlated1 f g, GPlated1 f h) => GPlated1 (f :: k -> Type) (g :+: h :: k -> Type)

recursive match

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' ((g :+: h) a) (f a)

(GPlated1 f g, GPlated1 f h) => GPlated1 (f :: k -> Type) (g :*: h :: k -> Type)

recursive match

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' ((g :*: h) a) (f a)

GPlated1 f g => GPlated1 (f :: k -> Type) (M1 i c g :: k -> Type)

recursive match

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (M1 i c g a) (f a)

(Traversable t, GPlated1 f g) => GPlated1 (f :: k1 -> Type) (t :.: g :: k1 -> Type)

recursive match under outer Traversable instance

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' ((t :.: g) a) (f a)

GPlated1 (f :: Type -> Type) Par1

ignored

Instance details

Defined in Control.Lens.Plated

Methods

gplate1' :: Traversal' (Par1 a) (f a)

class GPlated a (g :: k -> Type) #

Minimal complete definition

gplate'

Instances
GPlated a (V1 :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' (V1 p) a

GPlated a (U1 :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' (U1 p) a

GPlated a (URec b :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' (URec b p) a

GPlated a (K1 i a :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' (K1 i a p) a

GPlated a (K1 i b :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' (K1 i b p) a

(GPlated a f, GPlated a g) => GPlated a (f :+: g :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' ((f :+: g) p) a

(GPlated a f, GPlated a g) => GPlated a (f :*: g :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' ((f :*: g) p) a

GPlated a f => GPlated a (M1 i c f :: k -> Type) 
Instance details

Defined in Control.Lens.Plated

Methods

gplate' :: Traversal' (M1 i c f p) a

class Plated a where #

A Plated type is one where we know how to extract its immediate self-similar children.

Example 1:

import Control.Applicative
import Control.Lens
import Control.Lens.Plated
import Data.Data
import Data.Data.Lens (uniplate)
data Expr
  = Val Int
  | Neg Expr
  | Add Expr Expr
  deriving (Eq,Ord,Show,Read,Data,Typeable)
instance Plated Expr where
  plate f (Neg e) = Neg <$> f e
  plate f (Add a b) = Add <$> f a <*> f b
  plate _ a = pure a

or

instance Plated Expr where
  plate = uniplate

Example 2:

import Control.Applicative
import Control.Lens
import Control.Lens.Plated
import Data.Data
import Data.Data.Lens (uniplate)
data Tree a
  = Bin (Tree a) (Tree a)
  | Tip a
  deriving (Eq,Ord,Show,Read,Data,Typeable)
instance Plated (Tree a) where
  plate f (Bin l r) = Bin <$> f l <*> f r
  plate _ t = pure t

or

instance Data a => Plated (Tree a) where
  plate = uniplate

Note the big distinction between these two implementations.

The former will only treat children directly in this tree as descendents, the latter will treat trees contained in the values under the tips also as descendants!

When in doubt, pick a Traversal and just use the various ...Of combinators rather than pollute Plated with orphan instances!

If you want to find something unplated and non-recursive with biplate use the ...OnOf variant with ignored, though those usecases are much better served in most cases by using the existing Lens combinators! e.g.

toListOf biplateuniverseOnOf biplate ignored

This same ability to explicitly pass the Traversal in question is why there is no analogue to uniplate's Biplate.

Moreover, since we can allow custom traversals, we implement reasonable defaults for polymorphic data types, that only traverse into themselves, and not their polymorphic arguments.

Minimal complete definition

Nothing

Methods

plate :: Traversal' a a #

Traversal of the immediate children of this structure.

If you're using GHC 7.2 or newer and your type has a Data instance, plate will default to uniplate and you can choose to not override it with your own definition.

Instances
Plated Exp 
Instance details

Defined in Control.Lens.Plated

Plated Pat 
Instance details

Defined in Control.Lens.Plated

Plated Type 
Instance details

Defined in Control.Lens.Plated

Plated Dec 
Instance details

Defined in Control.Lens.Plated

Plated Con 
Instance details

Defined in Control.Lens.Plated

Plated Stmt 
Instance details

Defined in Control.Lens.Plated

Plated [a] 
Instance details

Defined in Control.Lens.Plated

Methods

plate :: Traversal' [a] [a] #

Plated (Tree a) 
Instance details

Defined in Control.Lens.Plated

Methods

plate :: Traversal' (Tree a) (Tree a) #

Traversable f => Plated (Cofree f a) 
Instance details

Defined in Control.Lens.Plated

Methods

plate :: Traversal' (Cofree f a) (Cofree f a) #

Traversable f => Plated (F f a) 
Instance details

Defined in Control.Lens.Plated

Methods

plate :: Traversal' (F f a) (F f a) #

Traversable f => Plated (Free f a) 
Instance details

Defined in Control.Lens.Plated

Methods

plate :: Traversal' (Free f a) (Free f a) #

(Traversable f, Traversable m) => Plated (FreeT f m a) 
Instance details

Defined in Control.Lens.Plated

Methods

plate :: Traversal' (FreeT f m a) (FreeT f m a) #

(Traversable f, Traversable w) => Plated (CofreeT f w a) 
Instance details

Defined in Control.Lens.Plated

Methods

plate :: Traversal' (CofreeT f w a) (CofreeT f w a) #

deep :: (Conjoined p, Applicative f, Plated s) => Traversing p f s s a b -> Over p f s s a b #

Try to apply a traversal to all transitive descendants of a Plated container, but do not recurse through matching descendants.

deep :: Plated s => Fold s a                 -> Fold s a
deep :: Plated s => IndexedFold s a          -> IndexedFold s a
deep :: Plated s => Traversal s s a b        -> Traversal s s a b
deep :: Plated s => IndexedTraversal s s a b -> IndexedTraversal s s a b

rewrite :: Plated a => (a -> Maybe a) -> a -> a #

Rewrite by applying a rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result:

propRewrite r x = all (isNothing . r) (universe (rewrite r x))

Usually transform is more appropriate, but rewrite can give better compositionality. Given two single transformations f and g, you can construct \a -> f a <|> g a which performs both rewrites until a fixed point.

rewriteOf :: ASetter a b a b -> (b -> Maybe a) -> a -> b #

Rewrite by applying a rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result:

propRewriteOf l r x = all (isNothing . r) (universeOf l (rewriteOf l r x))

Usually transformOf is more appropriate, but rewriteOf can give better compositionality. Given two single transformations f and g, you can construct \a -> f a <|> g a which performs both rewrites until a fixed point.

rewriteOf :: Iso' a a       -> (a -> Maybe a) -> a -> a
rewriteOf :: Lens' a a      -> (a -> Maybe a) -> a -> a
rewriteOf :: Traversal' a a -> (a -> Maybe a) -> a -> a
rewriteOf :: Setter' a a    -> (a -> Maybe a) -> a -> a

rewriteOn :: Plated a => ASetter s t a a -> (a -> Maybe a) -> s -> t #

Rewrite recursively over part of a larger structure.

rewriteOn :: Plated a => Iso' s a       -> (a -> Maybe a) -> s -> s
rewriteOn :: Plated a => Lens' s a      -> (a -> Maybe a) -> s -> s
rewriteOn :: Plated a => Traversal' s a -> (a -> Maybe a) -> s -> s
rewriteOn :: Plated a => ASetter' s a   -> (a -> Maybe a) -> s -> s

rewriteOnOf :: ASetter s t a b -> ASetter a b a b -> (b -> Maybe a) -> s -> t #

Rewrite recursively over part of a larger structure using a specified Setter.

rewriteOnOf :: Iso' s a       -> Iso' a a       -> (a -> Maybe a) -> s -> s
rewriteOnOf :: Lens' s a      -> Lens' a a      -> (a -> Maybe a) -> s -> s
rewriteOnOf :: Traversal' s a -> Traversal' a a -> (a -> Maybe a) -> s -> s
rewriteOnOf :: Setter' s a    -> Setter' a a    -> (a -> Maybe a) -> s -> s

rewriteM :: (Monad m, Plated a) => (a -> m (Maybe a)) -> a -> m a #

Rewrite by applying a monadic rule everywhere you can. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOf :: Monad m => LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> a -> m b #

Rewrite by applying a monadic rule everywhere you recursing with a user-specified Traversal. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOn :: (Monad m, Plated a) => LensLike (WrappedMonad m) s t a a -> (a -> m (Maybe a)) -> s -> m t #

Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified Traversal. Ensures that the rule cannot be applied anywhere in the result.

rewriteMOnOf :: Monad m => LensLike (WrappedMonad m) s t a b -> LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> s -> m t #

Rewrite by applying a monadic rule everywhere inside of a structure located by a user-specified Traversal, using a user-specified Traversal for recursion. Ensures that the rule cannot be applied anywhere in the result.

universe :: Plated a => a -> [a] #

Retrieve all of the transitive descendants of a Plated container, including itself.

universeOf :: Getting [a] a a -> a -> [a] #

Given a Fold that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself.

universeOf :: Fold a a -> a -> [a]

universeOn :: Plated a => Getting [a] s a -> s -> [a] #

Given a Fold that knows how to find Plated parts of a container retrieve them and all of their descendants, recursively.

universeOnOf :: Getting [a] s a -> Getting [a] a a -> s -> [a] #

Given a Fold that knows how to locate immediate children, retrieve all of the transitive descendants of a node, including itself that lie in a region indicated by another Fold.

toListOf l ≡ universeOnOf l ignored

cosmos :: Plated a => Fold a a #

Fold over all transitive descendants of a Plated container, including itself.

cosmosOf :: (Applicative f, Contravariant f) => LensLike' f a a -> LensLike' f a a #

Given a Fold that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself.

cosmosOf :: Fold a a -> Fold a a

cosmosOn :: (Applicative f, Contravariant f, Plated a) => LensLike' f s a -> LensLike' f s a #

Given a Fold that knows how to find Plated parts of a container fold them and all of their descendants, recursively.

cosmosOn :: Plated a => Fold s a -> Fold s a

cosmosOnOf :: (Applicative f, Contravariant f) => LensLike' f s a -> LensLike' f a a -> LensLike' f s a #

Given a Fold that knows how to locate immediate children, fold all of the transitive descendants of a node, including itself that lie in a region indicated by another Fold.

cosmosOnOf :: Fold s a -> Fold a a -> Fold s a

transformOn :: Plated a => ASetter s t a a -> (a -> a) -> s -> t #

Transform every element in the tree in a bottom-up manner over a region indicated by a Setter.

transformOn :: Plated a => Traversal' s a -> (a -> a) -> s -> s
transformOn :: Plated a => Setter' s a    -> (a -> a) -> s -> s

transformOf :: ASetter a b a b -> (b -> b) -> a -> b #

Transform every element by recursively applying a given Setter in a bottom-up manner.

transformOf :: Traversal' a a -> (a -> a) -> a -> a
transformOf :: Setter' a a    -> (a -> a) -> a -> a

transformOnOf :: ASetter s t a b -> ASetter a b a b -> (b -> b) -> s -> t #

Transform every element in a region indicated by a Setter by recursively applying another Setter in a bottom-up manner.

transformOnOf :: Setter' s a -> Traversal' a a -> (a -> a) -> s -> s
transformOnOf :: Setter' s a -> Setter' a a    -> (a -> a) -> s -> s

transformM :: (Monad m, Plated a) => (a -> m a) -> a -> m a #

Transform every element in the tree, in a bottom-up manner, monadically.

transformMOn :: (Monad m, Plated a) => LensLike (WrappedMonad m) s t a a -> (a -> m a) -> s -> m t #

Transform every element in the tree in a region indicated by a supplied Traversal, in a bottom-up manner, monadically.

transformMOn :: (Monad m, Plated a) => Traversal' s a -> (a -> m a) -> s -> m s

transformMOf :: Monad m => LensLike (WrappedMonad m) a b a b -> (b -> m b) -> a -> m b #

Transform every element in a tree using a user supplied Traversal in a bottom-up manner with a monadic effect.

transformMOf :: Monad m => Traversal' a a -> (a -> m a) -> a -> m a

transformMOnOf :: Monad m => LensLike (WrappedMonad m) s t a b -> LensLike (WrappedMonad m) a b a b -> (b -> m b) -> s -> m t #

Transform every element in a tree that lies in a region indicated by a supplied Traversal, walking with a user supplied Traversal in a bottom-up manner with a monadic effect.

transformMOnOf :: Monad m => Traversal' s a -> Traversal' a a -> (a -> m a) -> s -> m s

contexts :: Plated a => a -> [Context a a a] #

Return a list of all of the editable contexts for every location in the structure, recursively.

propUniverse x = universe x == map pos (contexts x)
propId x = all (== x) [extract w | w <- contexts x]
contextscontextsOf plate

contextsOf :: ATraversal' a a -> a -> [Context a a a] #

Return a list of all of the editable contexts for every location in the structure, recursively, using a user-specified Traversal to walk each layer.

propUniverse l x = universeOf l x == map pos (contextsOf l x)
propId l x = all (== x) [extract w | w <- contextsOf l x]
contextsOf :: Traversal' a a -> a -> [Context a a a]

contextsOn :: Plated a => ATraversal s t a a -> s -> [Context a a t] #

Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied Traversal, recursively using plate.

contextsOn b ≡ contextsOnOf b plate
contextsOn :: Plated a => Traversal' s a -> s -> [Context a a s]

contextsOnOf :: ATraversal s t a a -> ATraversal' a a -> s -> [Context a a t] #

Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied Traversal, recursively using another user-supplied Traversal to walk each layer.

contextsOnOf :: Traversal' s a -> Traversal' a a -> s -> [Context a a s]

holes :: Plated a => a -> [Pretext ((->) :: Type -> Type -> Type) a a a] #

The one-level version of context. This extracts a list of the immediate children as editable contexts.

Given a context you can use pos to see the values, peek at what the structure would be like with an edited result, or simply extract the original structure.

propChildren x = children l x == map pos (holes l x)
propId x = all (== x) [extract w | w <- holes l x]
holes = holesOf plate

holesOn :: Conjoined p => Over p (Bazaar p a a) s t a a -> s -> [Pretext p a a t] #

An alias for holesOf, provided for consistency with the other combinators.

holesOnholesOf
holesOn :: Iso' s a                -> s -> [Pretext (->) a a s]
holesOn :: Lens' s a               -> s -> [Pretext (->) a a s]
holesOn :: Traversal' s a          -> s -> [Pretext (->) a a s]
holesOn :: IndexedLens' i s a      -> s -> [Pretext (Indexed i) a a s]
holesOn :: IndexedTraversal' i s a -> s -> [Pretext (Indexed i) a a s]

holesOnOf :: Conjoined p => LensLike (Bazaar p r r) s t a b -> Over p (Bazaar p r r) a b r r -> s -> [Pretext p r r t] #

Extract one level of holes from a container in a region specified by one Traversal, using another.

holesOnOf b l ≡ holesOf (b . l)
holesOnOf :: Iso' s a       -> Iso' a a                -> s -> [Pretext (->) a a s]
holesOnOf :: Lens' s a      -> Lens' a a               -> s -> [Pretext (->) a a s]
holesOnOf :: Traversal' s a -> Traversal' a a          -> s -> [Pretext (->) a a s]
holesOnOf :: Lens' s a      -> IndexedLens' i a a      -> s -> [Pretext (Indexed i) a a s]
holesOnOf :: Traversal' s a -> IndexedTraversal' i a a -> s -> [Pretext (Indexed i) a a s]

paraOf :: Getting (Endo [a]) a a -> (a -> [r] -> r) -> a -> r #

Perform a fold-like computation on each value, technically a paramorphism.

paraOf :: Fold a a -> (a -> [r] -> r) -> a -> r

para :: Plated a => (a -> [r] -> r) -> a -> r #

Perform a fold-like computation on each value, technically a paramorphism.

paraparaOf plate

composOpFold :: Plated a => b -> (b -> b -> b) -> (a -> b) -> a -> b #

Fold the immediate children of a Plated container.

composOpFold z c f = foldrOf plate (c . f) z

parts :: Plated a => Lens' a [a] #

The original uniplate combinator, implemented in terms of Plated as a Lens.

partspartsOf plate

The resulting Lens is safer to use as it ignores 'over-application' and deals gracefully with under-application, but it is only a proper Lens if you don't change the list length!

gplate :: (Generic a, GPlated a (Rep a)) => Traversal' a a #

Implement plate operation for a type using its Generic instance.

gplate1 :: (Generic1 f, GPlated1 f (Rep1 f)) => Traversal' (f a) (f a) #

Implement plate operation for a type using its Generic1 instance.

class Each s t a b | s -> a, t -> b, s b -> t, t a -> s where #

Extract each element of a (potentially monomorphic) container.

Notably, when applied to a tuple, this generalizes both to arbitrary homogeneous tuples.

>>> (1,2,3) & each *~ 10
(10,20,30)

It can also be used on monomorphic containers like Text or ByteString.

>>> over each Char.toUpper ("hello"^.Text.packed)
"HELLO"
>>> ("hello","world") & each.each %~ Char.toUpper
("HELLO","WORLD")

Minimal complete definition

Nothing

Methods

each :: Traversal s t a b #

Instances
(a ~ Word8, b ~ Word8) => Each ByteString ByteString a b
each :: Traversal ByteString ByteString Word8 Word8
Instance details

Defined in Control.Lens.Each

(a ~ Word8, b ~ Word8) => Each ByteString ByteString a b
each :: Traversal ByteString ByteString Word8 Word8
Instance details

Defined in Control.Lens.Each

(a ~ Char, b ~ Char) => Each Text Text a b
each :: Traversal Text Text Char Char
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal Text Text a b #

(a ~ Char, b ~ Char) => Each Text Text a b
each :: Traversal Text Text Char Char
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal Text Text a b #

Each Name Name AName AName 
Instance details

Defined in Diagrams.Core.Names

Each [a] [b] a b
each :: Traversal [a] [b] a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal [a] [b] a b #

Each (Maybe a) (Maybe b) a b
each :: Traversal (Maybe a) (Maybe b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Maybe a) (Maybe b) a b #

Each (Identity a) (Identity b) a b
each :: Traversal (Identity a) (Identity b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Identity a) (Identity b) a b #

(Storable a, Storable b) => Each (Vector a) (Vector b) a b
each :: (Storable a, Storable b) => Traversal (Vector a) (Vector b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Vector a) (Vector b) a b #

Each (Complex a) (Complex b) a b
each :: (RealFloat a, RealFloat b) => Traversal (Complex a) (Complex b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Complex a) (Complex b) a b #

Each (NonEmpty a) (NonEmpty b) a b
each :: Traversal (NonEmpty a) (NonEmpty b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (NonEmpty a) (NonEmpty b) a b #

Each (Vector a) (Vector b) a b
each :: Traversal (Vector a) (Vector b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Vector a) (Vector b) a b #

Each (IntMap a) (IntMap b) a b
each :: Traversal (Map c a) (Map c b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (IntMap a) (IntMap b) a b #

Each (Tree a) (Tree b) a b
each :: Traversal (Tree a) (Tree b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Tree a) (Tree b) a b #

Each (Seq a) (Seq b) a b
each :: Traversal (Seq a) (Seq b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Seq a) (Seq b) a b #

(Unbox a, Unbox b) => Each (Vector a) (Vector b) a b
each :: (Unbox a, Unbox b) => Traversal (Vector a) (Vector b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Vector a) (Vector b) a b #

Each (V2 a) (V2 b) a b 
Instance details

Defined in Linear.V2

Methods

each :: Traversal (V2 a) (V2 b) a b #

Each (V3 a) (V3 b) a b 
Instance details

Defined in Linear.V3

Methods

each :: Traversal (V3 a) (V3 b) a b #

(Prim a, Prim b) => Each (Vector a) (Vector b) a b
each :: (Prim a, Prim b) => Traversal (Vector a) (Vector b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Vector a) (Vector b) a b #

Each (Plucker a) (Plucker b) a b 
Instance details

Defined in Linear.Plucker

Methods

each :: Traversal (Plucker a) (Plucker b) a b #

Each (Quaternion a) (Quaternion b) a b 
Instance details

Defined in Linear.Quaternion

Methods

each :: Traversal (Quaternion a) (Quaternion b) a b #

Each (V0 a) (V0 b) a b 
Instance details

Defined in Linear.V0

Methods

each :: Traversal (V0 a) (V0 b) a b #

Each (V4 a) (V4 b) a b 
Instance details

Defined in Linear.V4

Methods

each :: Traversal (V4 a) (V4 b) a b #

Each (V1 a) (V1 b) a b 
Instance details

Defined in Linear.V1

Methods

each :: Traversal (V1 a) (V1 b) a b #

(a ~ a', b ~ b') => Each (a, a') (b, b') a b
each :: Traversal (a,a) (b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a') (b, b') a b #

c ~ d => Each (Map c a) (Map d b) a b
each :: Traversal (Map c a) (Map c b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Map c a) (Map d b) a b #

c ~ d => Each (HashMap c a) (HashMap d b) a b
each :: Traversal (HashMap c a) (HashMap c b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (HashMap c a) (HashMap d b) a b #

(Ix i, IArray UArray a, IArray UArray b, i ~ j) => Each (UArray i a) (UArray j b) a b
each :: (Ix i, IArray UArray a, IArray UArray b) => Traversal (Array i a) (Array i b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (UArray i a) (UArray j b) a b #

(Ix i, i ~ j) => Each (Array i a) (Array j b) a b
each :: Ix i => Traversal (Array i a) (Array i b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (Array i a) (Array j b) a b #

Traversable f => Each (Point f a) (Point f b) a b 
Instance details

Defined in Linear.Affine

Methods

each :: Traversal (Point f a) (Point f b) a b #

Each (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) 
Instance details

Defined in Diagrams.Path

Methods

each :: Traversal (Path v n) (Path v' n') (Located (Trail v n)) (Located (Trail v' n')) #

Each (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') 
Instance details

Defined in Diagrams.Core.Style

Methods

each :: Traversal (Style v n) (Style v' n') (Attribute v n) (Attribute v' n') #

(Additive v', Foldable v', Ord n') => Each (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n')

Only valid if the second point is not smaller than the first.

Instance details

Defined in Diagrams.BoundingBox

Methods

each :: Traversal (BoundingBox v n) (BoundingBox v' n') (Point v n) (Point v' n') #

Each (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') 
Instance details

Defined in Diagrams.Segment

Methods

each :: Traversal (FixedSegment v n) (FixedSegment v' n') (Point v n) (Point v' n') #

(a ~ a2, a ~ a3, b ~ b2, b ~ b3) => Each (a, a2, a3) (b, b2, b3) a b
each :: Traversal (a,a,a) (b,b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a2, a3) (b, b2, b3) a b #

Each (V n a) (V n b) a b 
Instance details

Defined in Linear.V

Methods

each :: Traversal (V n a) (V n b) a b #

Each (Offset c v n) (Offset c v' n') (v n) (v' n') 
Instance details

Defined in Diagrams.Segment

Methods

each :: Traversal (Offset c v n) (Offset c v' n') (v n) (v' n') #

Each (Segment c v n) (Segment c v' n') (v n) (v' n') 
Instance details

Defined in Diagrams.Segment

Methods

each :: Traversal (Segment c v n) (Segment c v' n') (v n) (v' n') #

(a ~ a2, a ~ a3, a ~ a4, b ~ b2, b ~ b3, b ~ b4) => Each (a, a2, a3, a4) (b, b2, b3, b4) a b
each :: Traversal (a,a,a,a) (b,b,b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a2, a3, a4) (b, b2, b3, b4) a b #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, b ~ b2, b ~ b3, b ~ b4, b ~ b5) => Each (a, a2, a3, a4, a5) (b, b2, b3, b4, b5) a b
each :: Traversal (a,a,a,a,a) (b,b,b,b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a2, a3, a4, a5) (b, b2, b3, b4, b5) a b #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6) => Each (a, a2, a3, a4, a5, a6) (b, b2, b3, b4, b5, b6) a b
each :: Traversal (a,a,a,a,a,a) (b,b,b,b,b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a2, a3, a4, a5, a6) (b, b2, b3, b4, b5, b6) a b #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6, b ~ b7) => Each (a, a2, a3, a4, a5, a6, a7) (b, b2, b3, b4, b5, b6, b7) a b
each :: Traversal (a,a,a,a,a,a,a) (b,b,b,b,b,b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a2, a3, a4, a5, a6, a7) (b, b2, b3, b4, b5, b6, b7) a b #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6, b ~ b7, b ~ b8) => Each (a, a2, a3, a4, a5, a6, a7, a8) (b, b2, b3, b4, b5, b6, b7, b8) a b
each :: Traversal (a,a,a,a,a,a,a,a) (b,b,b,b,b,b,b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a2, a3, a4, a5, a6, a7, a8) (b, b2, b3, b4, b5, b6, b7, b8) a b #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8, a ~ a9, b ~ b2, b ~ b3, b ~ b4, b ~ b5, b ~ b6, b ~ b7, b ~ b8, b ~ b9) => Each (a, a2, a3, a4, a5, a6, a7, a8, a9) (b, b2, b3, b4, b5, b6, b7, b8, b9) a b
each :: Traversal (a,a,a,a,a,a,a,a,a) (b,b,b,b,b,b,b,b,b) a b
Instance details

Defined in Control.Lens.Each

Methods

each :: Traversal (a, a2, a3, a4, a5, a6, a7, a8, a9) (b, b2, b3, b4, b5, b6, b7, b8, b9) a b #

class Ixed m => At m #

At provides a Lens that can be used to read, write or delete the value associated with a key in a Map-like container on an ad hoc basis.

An instance of At should satisfy:

ix k ≡ at k . traverse

Minimal complete definition

at

Instances
At IntSet 
Instance details

Defined in Control.Lens.At

At (Maybe a) 
Instance details

Defined in Control.Lens.At

Methods

at :: Index (Maybe a) -> Lens' (Maybe a) (Maybe (IxValue (Maybe a))) #

Ord k => At (Set k) 
Instance details

Defined in Control.Lens.At

Methods

at :: Index (Set k) -> Lens' (Set k) (Maybe (IxValue (Set k))) #

At (IntMap a) 
Instance details

Defined in Control.Lens.At

Methods

at :: Index (IntMap a) -> Lens' (IntMap a) (Maybe (IxValue (IntMap a))) #

(Eq k, Hashable k) => At (HashSet k) 
Instance details

Defined in Control.Lens.At

Methods

at :: Index (HashSet k) -> Lens' (HashSet k) (Maybe (IxValue (HashSet k))) #

Ord k => At (Map k a) 
Instance details

Defined in Control.Lens.At

Methods

at :: Index (Map k a) -> Lens' (Map k a) (Maybe (IxValue (Map k a))) #

(Eq k, Hashable k) => At (HashMap k a) 
Instance details

Defined in Control.Lens.At

Methods

at :: Index (HashMap k a) -> Lens' (HashMap k a) (Maybe (IxValue (HashMap k a))) #

At (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

at :: Index (Style v n) -> Lens' (Style v n) (Maybe (IxValue (Style v n))) #

class Ixed m where #

Provides a simple Traversal lets you traverse the value at a given key in a Map or element at an ordinal position in a list or Seq.

Minimal complete definition

Nothing

Methods

ix :: Index m -> Traversal' m (IxValue m) #

NB: Setting the value of this Traversal will only set the value in at if it is already present.

If you want to be able to insert missing values, you want at.

>>> Seq.fromList [a,b,c,d] & ix 2 %~ f
fromList [a,b,f c,d]
>>> Seq.fromList [a,b,c,d] & ix 2 .~ e
fromList [a,b,e,d]
>>> Seq.fromList [a,b,c,d] ^? ix 2
Just c
>>> Seq.fromList [] ^? ix 2
Nothing
Instances
Ixed ByteString 
Instance details

Defined in Control.Lens.At

Ixed ByteString 
Instance details

Defined in Control.Lens.At

Ixed Text 
Instance details

Defined in Control.Lens.At

Ixed Text 
Instance details

Defined in Control.Lens.At

Ixed IntSet 
Instance details

Defined in Control.Lens.At

Ixed [a] 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index [a] -> Traversal' [a] (IxValue [a]) #

Ixed (Maybe a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Maybe a) -> Traversal' (Maybe a) (IxValue (Maybe a)) #

Ord k => Ixed (Set k) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Set k) -> Traversal' (Set k) (IxValue (Set k)) #

Ixed (Identity a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Identity a) -> Traversal' (Identity a) (IxValue (Identity a)) #

Storable a => Ixed (Vector a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Ixed (NonEmpty a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (NonEmpty a) -> Traversal' (NonEmpty a) (IxValue (NonEmpty a)) #

Ixed (Vector a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Ixed (IntMap a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (IntMap a) -> Traversal' (IntMap a) (IxValue (IntMap a)) #

Ixed (Tree a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Tree a) -> Traversal' (Tree a) (IxValue (Tree a)) #

Ixed (Seq a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Seq a) -> Traversal' (Seq a) (IxValue (Seq a)) #

Unbox a => Ixed (Vector a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

Ixed (V2 a) 
Instance details

Defined in Linear.V2

Methods

ix :: Index (V2 a) -> Traversal' (V2 a) (IxValue (V2 a)) #

Ixed (V3 a) 
Instance details

Defined in Linear.V3

Methods

ix :: Index (V3 a) -> Traversal' (V3 a) (IxValue (V3 a)) #

Prim a => Ixed (Vector a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Vector a) -> Traversal' (Vector a) (IxValue (Vector a)) #

(Eq k, Hashable k) => Ixed (HashSet k) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (HashSet k) -> Traversal' (HashSet k) (IxValue (HashSet k)) #

Ixed (Plucker a) 
Instance details

Defined in Linear.Plucker

Methods

ix :: Index (Plucker a) -> Traversal' (Plucker a) (IxValue (Plucker a)) #

Ixed (Quaternion a) 
Instance details

Defined in Linear.Quaternion

Ixed (V0 a) 
Instance details

Defined in Linear.V0

Methods

ix :: Index (V0 a) -> Traversal' (V0 a) (IxValue (V0 a)) #

Ixed (V4 a) 
Instance details

Defined in Linear.V4

Methods

ix :: Index (V4 a) -> Traversal' (V4 a) (IxValue (V4 a)) #

Ixed (V1 a) 
Instance details

Defined in Linear.V1

Methods

ix :: Index (V1 a) -> Traversal' (V1 a) (IxValue (V1 a)) #

Eq e => Ixed (e -> a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (e -> a) -> Traversal' (e -> a) (IxValue (e -> a)) #

a ~ a2 => Ixed (a, a2) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2) -> Traversal' (a, a2) (IxValue (a, a2)) #

Ord k => Ixed (Map k a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Map k a) -> Traversal' (Map k a) (IxValue (Map k a)) #

(Eq k, Hashable k) => Ixed (HashMap k a) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (HashMap k a) -> Traversal' (HashMap k a) (IxValue (HashMap k a)) #

(IArray UArray e, Ix i) => Ixed (UArray i e)
arr ! i ≡ arr ^. ix i
arr // [(i,e)] ≡ ix i .~ e $ arr
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (UArray i e) -> Traversal' (UArray i e) (IxValue (UArray i e)) #

Ix i => Ixed (Array i e)
arr ! i ≡ arr ^. ix i
arr // [(i,e)] ≡ ix i .~ e $ arr
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (Array i e) -> Traversal' (Array i e) (IxValue (Array i e)) #

Ixed (Style v n) 
Instance details

Defined in Diagrams.Core.Style

Methods

ix :: Index (Style v n) -> Traversal' (Style v n) (IxValue (Style v n)) #

Ixed (f a) => Ixed (Point f a) 
Instance details

Defined in Linear.Affine

Methods

ix :: Index (Point f a) -> Traversal' (Point f a) (IxValue (Point f a)) #

(a ~ a2, a ~ a3) => Ixed (a, a2, a3) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2, a3) -> Traversal' (a, a2, a3) (IxValue (a, a2, a3)) #

Ixed (V n a) 
Instance details

Defined in Linear.V

Methods

ix :: Index (V n a) -> Traversal' (V n a) (IxValue (V n a)) #

(a ~ a2, a ~ a3, a ~ a4) => Ixed (a, a2, a3, a4) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2, a3, a4) -> Traversal' (a, a2, a3, a4) (IxValue (a, a2, a3, a4)) #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5) => Ixed (a, a2, a3, a4, a5) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2, a3, a4, a5) -> Traversal' (a, a2, a3, a4, a5) (IxValue (a, a2, a3, a4, a5)) #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6) => Ixed (a, a2, a3, a4, a5, a6) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2, a3, a4, a5, a6) -> Traversal' (a, a2, a3, a4, a5, a6) (IxValue (a, a2, a3, a4, a5, a6)) #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7) => Ixed (a, a2, a3, a4, a5, a6, a7) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7) -> Traversal' (a, a2, a3, a4, a5, a6, a7) (IxValue (a, a2, a3, a4, a5, a6, a7)) #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8) => Ixed (a, a2, a3, a4, a5, a6, a7, a8) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7, a8) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8) (IxValue (a, a2, a3, a4, a5, a6, a7, a8)) #

(a ~ a2, a ~ a3, a ~ a4, a ~ a5, a ~ a6, a ~ a7, a ~ a8, a ~ a9) => Ixed (a, a2, a3, a4, a5, a6, a7, a8, a9) 
Instance details

Defined in Control.Lens.At

Methods

ix :: Index (a, a2, a3, a4, a5, a6, a7, a8, a9) -> Traversal' (a, a2, a3, a4, a5, a6, a7, a8, a9) (IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9)) #

type family IxValue m :: Type #

This provides a common notion of a value at an index that is shared by both Ixed and At.

Instances
type IxValue ByteString 
Instance details

Defined in Control.Lens.At

type IxValue ByteString 
Instance details

Defined in Control.Lens.At

type IxValue Text 
Instance details

Defined in Control.Lens.At

type IxValue Text 
Instance details

Defined in Control.Lens.At

type IxValue IntSet 
Instance details

Defined in Control.Lens.At

type IxValue IntSet = ()
type IxValue [a] 
Instance details

Defined in Control.Lens.At

type IxValue [a] = a
type IxValue (Maybe a) 
Instance details

Defined in Control.Lens.At

type IxValue (Maybe a) = a
type IxValue (Set k) 
Instance details

Defined in Control.Lens.At

type IxValue (Set k) = ()
type IxValue (Identity a) 
Instance details

Defined in Control.Lens.At

type IxValue (Identity a) = a
type IxValue (Vector a) 
Instance details

Defined in Control.Lens.At

type IxValue (Vector a) = a
type IxValue (NonEmpty a) 
Instance details

Defined in Control.Lens.At

type IxValue (NonEmpty a) = a
type IxValue (Vector a) 
Instance details

Defined in Control.Lens.At

type IxValue (Vector a) = a
type IxValue (IntMap a) 
Instance details

Defined in Control.Lens.At

type IxValue (IntMap a) = a
type IxValue (Tree a) 
Instance details

Defined in Control.Lens.At

type IxValue (Tree a) = a
type IxValue (Seq a) 
Instance details

Defined in Control.Lens.At

type IxValue (Seq a) = a
type IxValue (Vector a) 
Instance details

Defined in Control.Lens.At

type IxValue (Vector a) = a
type IxValue (V2 a) 
Instance details

Defined in Linear.V2

type IxValue (V2 a) = a
type IxValue (V3 a) 
Instance details

Defined in Linear.V3

type IxValue (V3 a) = a
type IxValue (Vector a) 
Instance details

Defined in Control.Lens.At

type IxValue (Vector a) = a
type IxValue (HashSet k) 
Instance details

Defined in Control.Lens.At

type IxValue (HashSet k) = ()
type IxValue (Plucker a) 
Instance details

Defined in Linear.Plucker

type IxValue (Plucker a) = a
type IxValue (Quaternion a) 
Instance details

Defined in Linear.Quaternion

type IxValue (Quaternion a) = a
type IxValue (V0 a) 
Instance details

Defined in Linear.V0

type IxValue (V0 a) = a
type IxValue (V4 a) 
Instance details

Defined in Linear.V4

type IxValue (V4 a) = a
type IxValue (V1 a) 
Instance details

Defined in Linear.V1

type IxValue (V1 a) = a
type IxValue (e -> a) 
Instance details

Defined in Control.Lens.At

type IxValue (e -> a) = a
type IxValue (a, a2)
ix :: Int -> Traversal' (a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2) = a
type IxValue (Map k a) 
Instance details

Defined in Control.Lens.At

type IxValue (Map k a) = a
type IxValue (HashMap k a) 
Instance details

Defined in Control.Lens.At

type IxValue (HashMap k a) = a
type IxValue (UArray i e) 
Instance details

Defined in Control.Lens.At

type IxValue (UArray i e) = e
type IxValue (Array i e) 
Instance details

Defined in Control.Lens.At

type IxValue (Array i e) = e
type IxValue (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type IxValue (Style v n) = Attribute v n
type IxValue (Point f a) 
Instance details

Defined in Linear.Affine

type IxValue (Point f a) = IxValue (f a)
type IxValue (a, a2, a3)
ix :: Int -> Traversal' (a,a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2, a3) = a
type IxValue (V n a) 
Instance details

Defined in Linear.V

type IxValue (V n a) = a
type IxValue (a, a2, a3, a4)
ix :: Int -> Traversal' (a,a,a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2, a3, a4) = a
type IxValue (a, a2, a3, a4, a5)
ix :: Int -> Traversal' (a,a,a,a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2, a3, a4, a5) = a
type IxValue (a, a2, a3, a4, a5, a6)
ix :: Int -> Traversal' (a,a,a,a,a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2, a3, a4, a5, a6) = a
type IxValue (a, a2, a3, a4, a5, a6, a7)
ix :: Int -> Traversal' (a,a,a,a,a,a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2, a3, a4, a5, a6, a7) = a
type IxValue (a, a2, a3, a4, a5, a6, a7, a8)
ix :: Int -> Traversal' (a,a,a,a,a,a,a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2, a3, a4, a5, a6, a7, a8) = a
type IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9)
ix :: Int -> Traversal' (a,a,a,a,a,a,a,a,a) a
Instance details

Defined in Control.Lens.At

type IxValue (a, a2, a3, a4, a5, a6, a7, a8, a9) = a

class Contains m #

This class provides a simple Lens that lets you view (and modify) information about whether or not a container contains a given Index.

Minimal complete definition

contains

Instances
Contains IntSet 
Instance details

Defined in Control.Lens.At

Ord a => Contains (Set a) 
Instance details

Defined in Control.Lens.At

Methods

contains :: Index (Set a) -> Lens' (Set a) Bool #

(Eq a, Hashable a) => Contains (HashSet a) 
Instance details

Defined in Control.Lens.At

Methods

contains :: Index (HashSet a) -> Lens' (HashSet a) Bool #

type family Index s :: Type #

Instances
type Index ByteString 
Instance details

Defined in Control.Lens.At

type Index ByteString 
Instance details

Defined in Control.Lens.At

type Index Text 
Instance details

Defined in Control.Lens.At

type Index Text = Int
type Index Text 
Instance details

Defined in Control.Lens.At

type Index IntSet 
Instance details

Defined in Control.Lens.At

type Index [a] 
Instance details

Defined in Control.Lens.At

type Index [a] = Int
type Index (Maybe a) 
Instance details

Defined in Control.Lens.At

type Index (Maybe a) = ()
type Index (Set a) 
Instance details

Defined in Control.Lens.At

type Index (Set a) = a
type Index (Identity a) 
Instance details

Defined in Control.Lens.At

type Index (Identity a) = ()
type Index (Vector a) 
Instance details

Defined in Control.Lens.At

type Index (Vector a) = Int
type Index (Complex a) 
Instance details

Defined in Control.Lens.At

type Index (Complex a) = Int
type Index (NonEmpty a) 
Instance details

Defined in Control.Lens.At

type Index (NonEmpty a) = Int
type Index (Vector a) 
Instance details

Defined in Control.Lens.At

type Index (Vector a) = Int
type Index (IntMap a) 
Instance details

Defined in Control.Lens.At

type Index (IntMap a) = Int
type Index (Tree a) 
Instance details

Defined in Control.Lens.At

type Index (Tree a) = [Int]
type Index (Seq a) 
Instance details

Defined in Control.Lens.At

type Index (Seq a) = Int
type Index (Vector a) 
Instance details

Defined in Control.Lens.At

type Index (Vector a) = Int
type Index (V2 a) 
Instance details

Defined in Linear.V2

type Index (V2 a) = E V2
type Index (V3 a) 
Instance details

Defined in Linear.V3

type Index (V3 a) = E V3
type Index (Vector a) 
Instance details

Defined in Control.Lens.At

type Index (Vector a) = Int
type Index (HashSet a) 
Instance details

Defined in Control.Lens.At

type Index (HashSet a) = a
type Index (Plucker a) 
Instance details

Defined in Linear.Plucker

type Index (Plucker a) = E Plucker
type Index (Quaternion a) 
Instance details

Defined in Linear.Quaternion

type Index (V0 a) 
Instance details

Defined in Linear.V0

type Index (V0 a) = E V0
type Index (V4 a) 
Instance details

Defined in Linear.V4

type Index (V4 a) = E V4
type Index (V1 a) 
Instance details

Defined in Linear.V1

type Index (V1 a) = E V1
type Index (e -> a) 
Instance details

Defined in Control.Lens.At

type Index (e -> a) = e
type Index (a, b) 
Instance details

Defined in Control.Lens.At

type Index (a, b) = Int
type Index (Map k a) 
Instance details

Defined in Control.Lens.At

type Index (Map k a) = k
type Index (HashMap k a) 
Instance details

Defined in Control.Lens.At

type Index (HashMap k a) = k
type Index (UArray i e) 
Instance details

Defined in Control.Lens.At

type Index (UArray i e) = i
type Index (Array i e) 
Instance details

Defined in Control.Lens.At

type Index (Array i e) = i
type Index (Style v n) 
Instance details

Defined in Diagrams.Core.Style

type Index (Style v n) = TypeRep
type Index (Point f a) 
Instance details

Defined in Linear.Affine

type Index (Point f a) = Index (f a)
type Index (a, b, c) 
Instance details

Defined in Control.Lens.At

type Index (a, b, c) = Int
type Index (V n a) 
Instance details

Defined in Linear.V

type Index (V n a) = Int
type Index (a, b, c, d) 
Instance details

Defined in Control.Lens.At

type Index (a, b, c, d) = Int
type Index (a, b, c, d, e) 
Instance details

Defined in Control.Lens.At

type Index (a, b, c, d, e) = Int
type Index (a, b, c, d, e, f) 
Instance details

Defined in Control.Lens.At

type Index (a, b, c, d, e, f) = Int
type Index (a, b, c, d, e, f, g) 
Instance details

Defined in Control.Lens.At

type Index (a, b, c, d, e, f, g) = Int
type Index (a, b, c, d, e, f, g, h) 
Instance details

Defined in Control.Lens.At

type Index (a, b, c, d, e, f, g, h) = Int
type Index (a, b, c, d, e, f, g, h, i) 
Instance details

Defined in Control.Lens.At

type Index (a, b, c, d, e, f, g, h, i) = Int

icontains :: Contains m => Index m -> IndexedLens' (Index m) m Bool #

An indexed version of contains.

>>> IntSet.fromList [1,2,3,4] ^@. icontains 3
(3,True)
>>> IntSet.fromList [1,2,3,4] ^@. icontains 5
(5,False)
>>> IntSet.fromList [1,2,3,4] & icontains 3 %@~ \i x -> if odd i then not x else x
fromList [1,2,4]
>>> IntSet.fromList [1,2,3,4] & icontains 3 %@~ \i x -> if even i then not x else x
fromList [1,2,3,4]

iix :: Ixed m => Index m -> IndexedTraversal' (Index m) m (IxValue m) #

An indexed version of ix.

>>> Seq.fromList [a,b,c,d] & iix 2 %@~ f'
fromList [a,b,f' 2 c,d]
>>> Seq.fromList [a,b,c,d] & iix 2 .@~ h
fromList [a,b,h 2,d]
>>> Seq.fromList [a,b,c,d] ^@? iix 2
Just (2,c)
>>> Seq.fromList [] ^@? iix 2
Nothing

ixAt :: At m => Index m -> Traversal' m (IxValue m) #

A definition of ix for types with an At instance. This is the default if you don't specify a definition for ix.

sans :: At m => Index m -> m -> m #

Delete the value associated with a key in a Map-like container

sans k = at k .~ Nothing

iat :: At m => Index m -> IndexedLens' (Index m) m (Maybe (IxValue m)) #

An indexed version of at.

>>> Map.fromList [(1,"world")] ^@. iat 1
(1,Just "world")
>>> iat 1 %@~ (\i x -> if odd i then Just "hello" else Nothing) $ Map.empty
fromList [(1,"hello")]
>>> iat 2 %@~ (\i x -> if odd i then Just "hello" else Nothing) $ Map.empty
fromList []

makePrisms #

Arguments

:: Name

Type constructor name

-> DecsQ 

Generate a Prism for each constructor of a data type. Isos generated when possible. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

data FooBarBaz a
  = Foo Int
  | Bar a
  | Baz Int Char
makePrisms ''FooBarBaz

will create

_Foo :: Prism' (FooBarBaz a) Int
_Bar :: Prism (FooBarBaz a) (FooBarBaz b) a b
_Baz :: Prism' (FooBarBaz a) (Int, Char)

makeClassyPrisms #

Arguments

:: Name

Type constructor name

-> DecsQ 

Generate a Prism for each constructor of a data type and combine them into a single class. No Isos are created. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

data FooBarBaz a
  = Foo Int
  | Bar a
  | Baz Int Char
makeClassyPrisms ''FooBarBaz

will create

class AsFooBarBaz s a | s -> a where
  _FooBarBaz :: Prism' s (FooBarBaz a)
  _Foo :: Prism' s Int
  _Bar :: Prism' s a
  _Baz :: Prism' s (Int,Char)

  _Foo = _FooBarBaz . _Foo
  _Bar = _FooBarBaz . _Bar
  _Baz = _FooBarBaz . _Baz

instance AsFooBarBaz (FooBarBaz a) a

Generate an As class of prisms. Names are selected by prefixing the constructor name with an underscore. Constructors with multiple fields will construct Prisms to tuples of those fields.

type ClassyNamer #

Arguments

 = Name

Name of the data type that lenses are being generated for.

-> Maybe (Name, Name)

Names of the class and the main method it generates, respectively.

The optional rule to create a class and method around a monomorphic data type. If this naming convention is provided, it generates a "classy" lens.

data DefName #

Name to give to generated field optics.

Constructors

TopName Name

Simple top-level definiton name

MethodName Name Name

makeFields-style class name and method name

Instances
Eq DefName 
Instance details

Defined in Control.Lens.Internal.FieldTH

Methods

(==) :: DefName -> DefName -> Bool #

(/=) :: DefName -> DefName -> Bool #

Ord DefName 
Instance details

Defined in Control.Lens.Internal.FieldTH

Show DefName 
Instance details

Defined in Control.Lens.Internal.FieldTH

type FieldNamer #

Arguments

 = Name

Name of the data type that lenses are being generated for.

-> [Name]

Names of all fields (including the field being named) in the data type.

-> Name

Name of the field being named.

-> [DefName]

Name(s) of the lens functions. If empty, no lens is created for that field.

The rule to create function names of lenses for data fields.

Although it's sometimes useful, you won't need the first two arguments most of the time.

data LensRules #

Rules to construct lenses for data fields.

simpleLenses :: Lens' LensRules Bool #

Generate "simple" optics even when type-changing optics are possible. (e.g. Lens' instead of Lens)

generateSignatures :: Lens' LensRules Bool #

Indicate whether or not to supply the signatures for the generated lenses.

Disabling this can be useful if you want to provide a more restricted type signature or if you want to supply hand-written haddocks.

generateUpdateableOptics :: Lens' LensRules Bool #

Generate "updateable" optics when True. When False, Folds will be generated instead of Traversals and Getters will be generated instead of Lenses. This mode is intended to be used for types with invariants which must be maintained by "smart" constructors.

generateLazyPatterns :: Lens' LensRules Bool #

Generate optics using lazy pattern matches. This can allow fields of an undefined value to be initialized with lenses:

data Foo = Foo {_x :: Int, _y :: Bool}
  deriving Show

makeLensesWith (lensRules & generateLazyPatterns .~ True) ''Foo
> undefined & x .~ 8 & y .~ True
Foo {_x = 8, _y = True}

The downside of this flag is that it can lead to space-leaks and code-size/compile-time increases when generated for large records. By default this flag is turned off, and strict optics are generated.

When using lazy optics the strict optic can be recovered by composing with $!:

strictOptic = ($!) . lazyOptic

createClass :: Lens' LensRules Bool #

Create the class if the constructor is Simple and the lensClass rule matches.

lensField :: Lens' LensRules FieldNamer #

Lens' to access the convention for naming fields in our LensRules.

lensClass :: Lens' LensRules ClassyNamer #

Lens' to access the option for naming "classy" lenses.

lensRules :: LensRules #

Rules for making fairly simple partial lenses, ignoring the special cases for isomorphisms and traversals, and not making any classes. It uses underscoreNoPrefixNamer.

underscoreNoPrefixNamer :: FieldNamer #

A FieldNamer that strips the _ off of the field name, lowercases the name, and skips the field if it doesn't start with an '_'.

lensRulesFor #

Arguments

:: [(String, String)]
(Field Name, Definition Name)
-> LensRules 

Construct a LensRules value for generating top-level definitions using the given map from field names to definition names.

lookingupNamer :: [(String, String)] -> FieldNamer #

Create a FieldNamer from explicit pairings of (fieldName, lensName).

mappingNamer #

Arguments

:: (String -> [String])

A function that maps a fieldName to lensNames.

-> FieldNamer 

Create a FieldNamer from a mapping function. If the function returns [], it creates no lens for the field.

classyRules :: LensRules #

Rules for making lenses and traversals that precompose another Lens.

makeLenses :: Name -> DecsQ #

Build lenses (and traversals) with a sensible default configuration.

e.g.

data FooBar
  = Foo { _x, _y :: Int }
  | Bar { _x :: Int }
makeLenses ''FooBar

will create

x :: Lens' FooBar Int
x f (Foo a b) = (\a' -> Foo a' b) <$> f a
x f (Bar a)   = Bar <$> f a
y :: Traversal' FooBar Int
y f (Foo a b) = (\b' -> Foo a  b') <$> f b
y _ c@(Bar _) = pure c
makeLenses = makeLensesWith lensRules

makeClassy :: Name -> DecsQ #

Make lenses and traversals for a type, and create a class when the type has no arguments.

e.g.

data Foo = Foo { _fooX, _fooY :: Int }
makeClassy ''Foo

will create

class HasFoo t where
  foo :: Lens' t Foo
  fooX :: Lens' t Int
  fooX = foo . go where go f (Foo x y) = (\x' -> Foo x' y) <$> f x
  fooY :: Lens' t Int
  fooY = foo . go where go f (Foo x y) = (\y' -> Foo x y') <$> f y
instance HasFoo Foo where
  foo = id
makeClassy = makeLensesWith classyRules

makeClassy_ :: Name -> DecsQ #

Make lenses and traversals for a type, and create a class when the type has no arguments. Works the same as makeClassy except that (a) it expects that record field names do not begin with an underscore, (b) all record fields are made into lenses, and (c) the resulting lens is prefixed with an underscore.

makeLensesFor :: [(String, String)] -> Name -> DecsQ #

Derive lenses and traversals, specifying explicit pairings of (fieldName, lensName).

If you map multiple names to the same label, and it is present in the same constructor then this will generate a Traversal.

e.g.

makeLensesFor [("_foo", "fooLens"), ("baz", "lbaz")] ''Foo
makeLensesFor [("_barX", "bar"), ("_barY", "bar")] ''Bar

makeClassyFor :: String -> String -> [(String, String)] -> Name -> DecsQ #

Derive lenses and traversals, using a named wrapper class, and specifying explicit pairings of (fieldName, traversalName).

Example usage:

makeClassyFor "HasFoo" "foo" [("_foo", "fooLens"), ("bar", "lbar")] ''Foo

makeLensesWith :: LensRules -> Name -> DecsQ #

Build lenses with a custom configuration.

declareLenses :: DecsQ -> DecsQ #

Make lenses for all records in the given declaration quote. All record syntax in the input will be stripped off.

e.g.

declareLenses [d|
  data Foo = Foo { fooX, fooY :: Int }
    deriving Show
  |]

will create

data Foo = Foo Int Int deriving Show
fooX, fooY :: Lens' Foo Int

declareLensesFor :: [(String, String)] -> DecsQ -> DecsQ #

Similar to makeLensesFor, but takes a declaration quote.

declareClassy :: DecsQ -> DecsQ #

For each record in the declaration quote, make lenses and traversals for it, and create a class when the type has no arguments. All record syntax in the input will be stripped off.

e.g.

declareClassy [d|
  data Foo = Foo { fooX, fooY :: Int }
    deriving Show
  |]

will create

data Foo = Foo Int Int deriving Show
class HasFoo t where
  foo :: Lens' t Foo
instance HasFoo Foo where foo = id
fooX, fooY :: HasFoo t => Lens' t Int

declareClassyFor :: [(String, (String, String))] -> [(String, String)] -> DecsQ -> DecsQ #

Similar to makeClassyFor, but takes a declaration quote.

declarePrisms :: DecsQ -> DecsQ #

Generate a Prism for each constructor of each data type.

e.g.

declarePrisms [d|
  data Exp = Lit Int | Var String | Lambda{ bound::String, body::Exp }
  |]

will create

data Exp = Lit Int | Var String | Lambda { bound::String, body::Exp }
_Lit :: Prism' Exp Int
_Var :: Prism' Exp String
_Lambda :: Prism' Exp (String, Exp)

declareWrapped :: DecsQ -> DecsQ #

Build Wrapped instance for each newtype.

declareLensesWith :: LensRules -> DecsQ -> DecsQ #

Declare lenses for each records in the given declarations, using the specified LensRules. Any record syntax in the input will be stripped off.

makeWrapped :: Name -> DecsQ #

Build Wrapped instance for a given newtype

underscoreFields :: LensRules #

Field rules for fields in the form _prefix_fieldname

camelCaseFields :: LensRules #

Field rules for fields in the form prefixFieldname or _prefixFieldname If you want all fields to be lensed, then there is no reason to use an _ before the prefix. If any of the record fields leads with an _ then it is assume a field without an _ should not have a lens created.

Note: The prefix must be the same as the typename (with the first letter lowercased). This is a change from lens versions before lens 4.5. If you want the old behaviour, use makeLensesWith abbreviatedFields

classUnderscoreNoPrefixFields :: LensRules #

Field rules for fields in the form _fieldname (the leading underscore is mandatory).

Note: The primary difference to camelCaseFields is that for classUnderscoreNoPrefixFields the field names are not expected to be prefixed with the type name. This might be the desired behaviour when the DuplicateRecordFields extension is enabled.

abbreviatedFields :: LensRules #

Field rules fields in the form prefixFieldname or _prefixFieldname If you want all fields to be lensed, then there is no reason to use an _ before the prefix. If any of the record fields leads with an _ then it is assume a field without an _ should not have a lens created.

Note that prefix may be any string of characters that are not uppercase letters. (In particular, it may be arbitrary string of lowercase letters and numbers) This is the behavior that defaultFieldRules had in lens 4.4 and earlier.

makeFields :: Name -> DecsQ #

Generate overloaded field accessors.

e.g

data Foo a = Foo { _fooX :: Int, _fooY :: a }
newtype Bar = Bar { _barX :: Char }
makeFields ''Foo
makeFields ''Bar

will create

_fooXLens :: Lens' (Foo a) Int
_fooYLens :: Lens (Foo a) (Foo b) a b
class HasX s a | s -> a where
  x :: Lens' s a
instance HasX (Foo a) Int where
  x = _fooXLens
class HasY s a | s -> a where
  y :: Lens' s a
instance HasY (Foo a) a where
  y = _fooYLens
_barXLens :: Iso' Bar Char
instance HasX Bar Char where
  x = _barXLens

For details, see camelCaseFields.

makeFields = makeLensesWith defaultFieldRules

makeFieldsNoPrefix :: Name -> DecsQ #

Generate overloaded field accessors based on field names which are only prefixed with an underscore (e.g. _name), not additionally with the type name (e.g. _fooName).

This might be the desired behaviour in case the DuplicateRecordFields language extension is used in order to get rid of the necessity to prefix each field name with the type name.

As an example:

data Foo a  = Foo { _x :: Int, _y :: a }
newtype Bar = Bar { _x :: Char }
makeFieldsNoPrefix ''Foo
makeFieldsNoPrefix ''Bar

will create classes

class HasX s a | s -> a where
  x :: Lens' s a
class HasY s a | s -> a where
  y :: Lens' s a

together with instances

instance HasX (Foo a) Int
instance HasY (Foo a) a where
instance HasX Bar Char where

For details, see classUnderscoreNoPrefixFields.

makeFieldsNoPrefix = makeLensesWith classUnderscoreNoPrefixFields

class Profunctor (p :: Type -> Type -> Type) where #

Formally, the class Profunctor represents a profunctor from Hask -> Hask.

Intuitively it is a bifunctor where the first argument is contravariant and the second argument is covariant.

You can define a Profunctor by either defining dimap or by defining both lmap and rmap.

If you supply dimap, you should ensure that:

dimap id idid

If you supply lmap and rmap, ensure:

lmap idid
rmap idid

If you supply both, you should also ensure:

dimap f g ≡ lmap f . rmap g

These ensure by parametricity:

dimap (f . g) (h . i) ≡ dimap g h . dimap f i
lmap (f . g) ≡ lmap g . lmap f
rmap (f . g) ≡ rmap f . rmap g

Minimal complete definition

dimap | lmap, rmap

Methods

dimap :: (a -> b) -> (c -> d) -> p b c -> p a d #

Map over both arguments at the same time.

dimap f g ≡ lmap f . rmap g

lmap :: (a -> b) -> p b c -> p a c #

Map the first argument contravariantly.

lmap f ≡ dimap f id

rmap :: (b -> c) -> p a b -> p a c #

Map the second argument covariantly.

rmapdimap id
Instances
Profunctor Measured 
Instance details

Defined in Diagrams.Core.Measure

Methods

dimap :: (a -> b) -> (c -> d) -> Measured b c -> Measured a d #

lmap :: (a -> b) -> Measured b c -> Measured a c #

rmap :: (b -> c) -> Measured a b -> Measured a c #

(#.) :: Coercible c b => q b c -> Measured a b -> Measured a c #

(.#) :: Coercible b a => Measured b c -> q a b -> Measured a c #

Profunctor ReifiedFold 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(#.) :: Coercible c b => q b c -> ReifiedFold a b -> ReifiedFold a c #

(.#) :: Coercible b a => ReifiedFold b c -> q a b -> ReifiedFold a c #

Profunctor ReifiedGetter 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(#.) :: Coercible c b => q b c -> ReifiedGetter a b -> ReifiedGetter a c #

(.#) :: Coercible b a => ReifiedGetter b c -> q a b -> ReifiedGetter a c #

Monad m => Profunctor (Kleisli m) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d #

lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c #

rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c #

(#.) :: Coercible c b => q b c -> Kleisli m a b -> Kleisli m a c #

(.#) :: Coercible b a => Kleisli m b c -> q a b -> Kleisli m a c #

Functor h => Profunctor (OneColonnade h) 
Instance details

Defined in Colonnade.Encode

Methods

dimap :: (a -> b) -> (c -> d) -> OneColonnade h b c -> OneColonnade h a d #

lmap :: (a -> b) -> OneColonnade h b c -> OneColonnade h a c #

rmap :: (b -> c) -> OneColonnade h a b -> OneColonnade h a c #

(#.) :: Coercible c b => q b c -> OneColonnade h a b -> OneColonnade h a c #

(.#) :: Coercible b a => OneColonnade h b c -> q a b -> OneColonnade h a c #

Functor h => Profunctor (Colonnade h) 
Instance details

Defined in Colonnade.Encode

Methods

dimap :: (a -> b) -> (c -> d) -> Colonnade h b c -> Colonnade h a d #

lmap :: (a -> b) -> Colonnade h b c -> Colonnade h a c #

rmap :: (b -> c) -> Colonnade h a b -> Colonnade h a c #

(#.) :: Coercible c b => q b c -> Colonnade h a b -> Colonnade h a c #

(.#) :: Coercible b a => Colonnade h b c -> q a b -> Colonnade h a c #

Functor v => Profunctor (Query v) 
Instance details

Defined in Diagrams.Core.Query

Methods

dimap :: (a -> b) -> (c -> d) -> Query v b c -> Query v a d #

lmap :: (a -> b) -> Query v b c -> Query v a c #

rmap :: (b -> c) -> Query v a b -> Query v a c #

(#.) :: Coercible c b => q b c -> Query v a b -> Query v a c #

(.#) :: Coercible b a => Query v b c -> q a b -> Query v a c #

Profunctor (Indexed i) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

dimap :: (a -> b) -> (c -> d) -> Indexed i b c -> Indexed i a d #

lmap :: (a -> b) -> Indexed i b c -> Indexed i a c #

rmap :: (b -> c) -> Indexed i a b -> Indexed i a c #

(#.) :: Coercible c b => q b c -> Indexed i a b -> Indexed i a c #

(.#) :: Coercible b a => Indexed i b c -> q a b -> Indexed i a c #

Profunctor (ReifiedIndexedFold i) 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(#.) :: Coercible c b => q b c -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(.#) :: Coercible b a => ReifiedIndexedFold i b c -> q a b -> ReifiedIndexedFold i a c #

Profunctor (ReifiedIndexedGetter i) 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(#.) :: Coercible c b => q b c -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(.#) :: Coercible b a => ReifiedIndexedGetter i b c -> q a b -> ReifiedIndexedGetter i a c #

Profunctor p => Profunctor (TambaraSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> TambaraSum p b c -> TambaraSum p a d #

lmap :: (a -> b) -> TambaraSum p b c -> TambaraSum p a c #

rmap :: (b -> c) -> TambaraSum p a b -> TambaraSum p a c #

(#.) :: Coercible c b => q b c -> TambaraSum p a b -> TambaraSum p a c #

(.#) :: Coercible b a => TambaraSum p b c -> q a b -> TambaraSum p a c #

Profunctor (PastroSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> PastroSum p b c -> PastroSum p a d #

lmap :: (a -> b) -> PastroSum p b c -> PastroSum p a c #

rmap :: (b -> c) -> PastroSum p a b -> PastroSum p a c #

(#.) :: Coercible c b => q b c -> PastroSum p a b -> PastroSum p a c #

(.#) :: Coercible b a => PastroSum p b c -> q a b -> PastroSum p a c #

Profunctor (CotambaraSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> CotambaraSum p b c -> CotambaraSum p a d #

lmap :: (a -> b) -> CotambaraSum p b c -> CotambaraSum p a c #

rmap :: (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c #

(#.) :: Coercible c b => q b c -> CotambaraSum p a b -> CotambaraSum p a c #

(.#) :: Coercible b a => CotambaraSum p b c -> q a b -> CotambaraSum p a c #

Profunctor (CopastroSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (a -> b) -> (c -> d) -> CopastroSum p b c -> CopastroSum p a d #

lmap :: (a -> b) -> CopastroSum p b c -> CopastroSum p a c #

rmap :: (b -> c) -> CopastroSum p a b -> CopastroSum p a c #

(#.) :: Coercible c b => q b c -> CopastroSum p a b -> CopastroSum p a c #

(.#) :: Coercible b a => CopastroSum p b c -> q a b -> CopastroSum p a c #

Profunctor p => Profunctor (Tambara p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Tambara p b c -> Tambara p a d #

lmap :: (a -> b) -> Tambara p b c -> Tambara p a c #

rmap :: (b -> c) -> Tambara p a b -> Tambara p a c #

(#.) :: Coercible c b => q b c -> Tambara p a b -> Tambara p a c #

(.#) :: Coercible b a => Tambara p b c -> q a b -> Tambara p a c #

Profunctor (Pastro p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Pastro p b c -> Pastro p a d #

lmap :: (a -> b) -> Pastro p b c -> Pastro p a c #

rmap :: (b -> c) -> Pastro p a b -> Pastro p a c #

(#.) :: Coercible c b => q b c -> Pastro p a b -> Pastro p a c #

(.#) :: Coercible b a => Pastro p b c -> q a b -> Pastro p a c #

Profunctor (Cotambara p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Cotambara p b c -> Cotambara p a d #

lmap :: (a -> b) -> Cotambara p b c -> Cotambara p a c #

rmap :: (b -> c) -> Cotambara p a b -> Cotambara p a c #

(#.) :: Coercible c b => q b c -> Cotambara p a b -> Cotambara p a c #

(.#) :: Coercible b a => Cotambara p b c -> q a b -> Cotambara p a c #

Profunctor (Copastro p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (a -> b) -> (c -> d) -> Copastro p b c -> Copastro p a d #

lmap :: (a -> b) -> Copastro p b c -> Copastro p a c #

rmap :: (b -> c) -> Copastro p a b -> Copastro p a c #

(#.) :: Coercible c b => q b c -> Copastro p a b -> Copastro p a c #

(.#) :: Coercible b a => Copastro p b c -> q a b -> Copastro p a c #

Functor f => Profunctor (Star f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d #

lmap :: (a -> b) -> Star f b c -> Star f a c #

rmap :: (b -> c) -> Star f a b -> Star f a c #

(#.) :: Coercible c b => q b c -> Star f a b -> Star f a c #

(.#) :: Coercible b a => Star f b c -> q a b -> Star f a c #

Functor f => Profunctor (Costar f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d #

lmap :: (a -> b) -> Costar f b c -> Costar f a c #

rmap :: (b -> c) -> Costar f a b -> Costar f a c #

(#.) :: Coercible c b => q b c -> Costar f a b -> Costar f a c #

(.#) :: Coercible b a => Costar f b c -> q a b -> Costar f a c #

Arrow p => Profunctor (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> WrappedArrow p b c -> WrappedArrow p a d #

lmap :: (a -> b) -> WrappedArrow p b c -> WrappedArrow p a c #

rmap :: (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c #

(#.) :: Coercible c b => q b c -> WrappedArrow p a b -> WrappedArrow p a c #

(.#) :: Coercible b a => WrappedArrow p b c -> q a b -> WrappedArrow p a c #

Profunctor (Forget r) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d #

lmap :: (a -> b) -> Forget r b c -> Forget r a c #

rmap :: (b -> c) -> Forget r a b -> Forget r a c #

(#.) :: Coercible c b => q b c -> Forget r a b -> Forget r a c #

(.#) :: Coercible b a => Forget r b c -> q a b -> Forget r a c #

Profunctor (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Tagged b c -> Tagged a d #

lmap :: (a -> b) -> Tagged b c -> Tagged a c #

rmap :: (b -> c) -> Tagged a b -> Tagged a c #

(#.) :: Coercible c b => q b c -> Tagged a b -> Tagged a c #

(.#) :: Coercible b a => Tagged b c -> q a b -> Tagged a c #

Profunctor ((->) :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> (b -> c) -> a -> d #

lmap :: (a -> b) -> (b -> c) -> a -> c #

rmap :: (b -> c) -> (a -> b) -> a -> c #

(#.) :: Coercible c b => q b c -> (a -> b) -> a -> c #

(.#) :: Coercible b a => (b -> c) -> q a b -> a -> c #

Functor h => Profunctor (Cornice h p) 
Instance details

Defined in Colonnade.Encode

Methods

dimap :: (a -> b) -> (c -> d) -> Cornice h p b c -> Cornice h p a d #

lmap :: (a -> b) -> Cornice h p b c -> Cornice h p a c #

rmap :: (b -> c) -> Cornice h p a b -> Cornice h p a c #

(#.) :: Coercible c b => q b c -> Cornice h p a b -> Cornice h p a c #

(.#) :: Coercible b a => Cornice h p b c -> q a b -> Cornice h p a c #

Functor w => Profunctor (Cokleisli w) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Cokleisli w b c -> Cokleisli w a d #

lmap :: (a -> b) -> Cokleisli w b c -> Cokleisli w a c #

rmap :: (b -> c) -> Cokleisli w a b -> Cokleisli w a c #

(#.) :: Coercible c b => q b c -> Cokleisli w a b -> Cokleisli w a c #

(.#) :: Coercible b a => Cokleisli w b c -> q a b -> Cokleisli w a c #

Profunctor (Exchange a b) 
Instance details

Defined in Control.Lens.Internal.Iso

Methods

dimap :: (a0 -> b0) -> (c -> d) -> Exchange a b b0 c -> Exchange a b a0 d #

lmap :: (a0 -> b0) -> Exchange a b b0 c -> Exchange a b a0 c #

rmap :: (b0 -> c) -> Exchange a b a0 b0 -> Exchange a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> Exchange a b a0 b0 -> Exchange a b a0 c #

(.#) :: Coercible b0 a0 => Exchange a b b0 c -> q a0 b0 -> Exchange a b a0 c #

(Profunctor p, Profunctor q) => Profunctor (Procompose p q) 
Instance details

Defined in Data.Profunctor.Composition

Methods

dimap :: (a -> b) -> (c -> d) -> Procompose p q b c -> Procompose p q a d #

lmap :: (a -> b) -> Procompose p q b c -> Procompose p q a c #

rmap :: (b -> c) -> Procompose p q a b -> Procompose p q a c #

(#.) :: Coercible c b => q0 b c -> Procompose p q a b -> Procompose p q a c #

(.#) :: Coercible b a => Procompose p q b c -> q0 a b -> Procompose p q a c #

(Profunctor p, Profunctor q) => Profunctor (Rift p q) 
Instance details

Defined in Data.Profunctor.Composition

Methods

dimap :: (a -> b) -> (c -> d) -> Rift p q b c -> Rift p q a d #

lmap :: (a -> b) -> Rift p q b c -> Rift p q a c #

rmap :: (b -> c) -> Rift p q a b -> Rift p q a c #

(#.) :: Coercible c b => q0 b c -> Rift p q a b -> Rift p q a c #

(.#) :: Coercible b a => Rift p q b c -> q0 a b -> Rift p q a c #

Functor f => Profunctor (Joker f :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Joker f b c -> Joker f a d #

lmap :: (a -> b) -> Joker f b c -> Joker f a c #

rmap :: (b -> c) -> Joker f a b -> Joker f a c #

(#.) :: Coercible c b => q b c -> Joker f a b -> Joker f a c #

(.#) :: Coercible b a => Joker f b c -> q a b -> Joker f a c #

Contravariant f => Profunctor (Clown f :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Clown f b c -> Clown f a d #

lmap :: (a -> b) -> Clown f b c -> Clown f a c #

rmap :: (b -> c) -> Clown f a b -> Clown f a c #

(#.) :: Coercible c b => q b c -> Clown f a b -> Clown f a c #

(.#) :: Coercible b a => Clown f b c -> q a b -> Clown f a c #

(Profunctor p, Profunctor q) => Profunctor (Sum p q) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Sum p q b c -> Sum p q a d #

lmap :: (a -> b) -> Sum p q b c -> Sum p q a c #

rmap :: (b -> c) -> Sum p q a b -> Sum p q a c #

(#.) :: Coercible c b => q0 b c -> Sum p q a b -> Sum p q a c #

(.#) :: Coercible b a => Sum p q b c -> q0 a b -> Sum p q a c #

(Profunctor p, Profunctor q) => Profunctor (Product p q) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Product p q b c -> Product p q a d #

lmap :: (a -> b) -> Product p q b c -> Product p q a c #

rmap :: (b -> c) -> Product p q a b -> Product p q a c #

(#.) :: Coercible c b => q0 b c -> Product p q a b -> Product p q a c #

(.#) :: Coercible b a => Product p q b c -> q0 a b -> Product p q a c #

(Functor f, Profunctor p) => Profunctor (Tannen f p) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Tannen f p b c -> Tannen f p a d #

lmap :: (a -> b) -> Tannen f p b c -> Tannen f p a c #

rmap :: (b -> c) -> Tannen f p a b -> Tannen f p a c #

(#.) :: Coercible c b => q b c -> Tannen f p a b -> Tannen f p a c #

(.#) :: Coercible b a => Tannen f p b c -> q a b -> Tannen f p a c #

(Profunctor p, Functor f, Functor g) => Profunctor (Biff p f g) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Biff p f g b c -> Biff p f g a d #

lmap :: (a -> b) -> Biff p f g b c -> Biff p f g a c #

rmap :: (b -> c) -> Biff p f g a b -> Biff p f g a c #

(#.) :: Coercible c b => q b c -> Biff p f g a b -> Biff p f g a c #

(.#) :: Coercible b a => Biff p f g b c -> q a b -> Biff p f g a c #

aspect :: (CameraLens l, Floating n) => l n -> n #

The natural aspect ratio of the projection.