Hoogle Search
Within LTS Haskell 24.58 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
setMatrix :: Matrix -> Render ()cairo Graphics.Rendering.Cairo Modifies the current transformation matrix (CTM) by setting it equal to matrix.
module Graphics.Rendering.Cairo.
Matrix Matrix math
-
cairo Graphics.Rendering.Cairo.Matrix Representation of a 2-D affine transformation. The Matrix type represents a 2x2 transformation matrix along with a translation vector. Matrix a1 a2 b1 b2 c1 c2 describes the transformation of a point with coordinates x,y that is defined by
/ x' \ = / a1 b1 \ / x \ + / c1 \ \ y' / \ a2 b2 / \ y / \ c2 /
orx' = a1 * x + b1 * y + c1 y' = a2 * x + b2 * y + c2
Matrix :: Double -> Double -> Double -> Double -> Double -> Double -> Matrixcairo Graphics.Rendering.Cairo.Matrix No documentation available.
-
cairo Graphics.Rendering.Cairo.Matrix No documentation available.
-
Fixpoint data types Fixpoint types and recursion schemes. If you define your AST as fixpoint type, you get fold and unfold operations for free. Thanks for contribution to: Matej Kollar, Herbert Valerio Riedel
-
Fixed points of a functor. Type f should be a Functor if you want to use simple recursion schemes or Traversable if you want to use monadic recursion schemes. This style allows you to express recursive functions in non-recursive manner. You can imagine that a non-recursive function holds values of the previous iteration. An example: First we define a base functor. The arguments b are recursion points.
>>> data ListF a b = Nil | Cons a b deriving (Show, Functor)
The list is then a fixed point of ListF>>> type List a = Fix (ListF a)
We can write length function. Note that the function we give to foldFix is not recursive. Instead the results of recursive calls are in b positions, and we need to deal only with one layer of the structure.>>> :{ let length :: List a -> Int length = foldFix $ \x -> case x of Nil -> 0 Cons _ n -> n + 1 :}If you already have recursive type, like '[Int]', you can first convert it to `Fix (ListF a)` and then foldFix. Alternatively you can use recursion-schemes combinators which work directly on recursive types. newtype
Fix (f :: Type -> Type)data-fix Data.Fix A fix-point type.
Fix :: f (Fix f) -> Fix (f :: Type -> Type)data-fix Data.Fix No documentation available.
foldFix :: Functor f => (f a -> a) -> Fix f -> adata-fix Data.Fix Fold Fix.
>>> let fp = unfoldFix (\i -> if i < 4 then Cons i (i + 1) else Nil) (0 :: Int) >>> foldFix (elimListF 0 (+)) fp 6