| Maintainer | hapytexeu+gh@gmail.com |
|---|---|
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Dep.Utils
Description
This module defines utility functions that are used elsewhere in the software package.
Synopsis
- toList' :: Foldable f => f a -> [a] -> [a]
- zipWithLast :: (a -> a -> a) -> [a] -> [a] -> [a]
- applyExp :: Foldable f => Name -> f (Q Exp) -> Q Exp
- applyExp' :: (Lift a, Foldable f) => Name -> f a -> Q Exp
- unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
- udiv :: Integral i => i -> i -> i
- type Raster a = [[a]]
- toRaster :: a -> Raster b -> Raster (a, b)
- flatRaster :: (b -> Bool) -> [(a, Raster b)] -> Raster (a, b)
- flatRaster' :: (a -> Bool) -> [Raster a] -> Raster a
- type Operator a = (a, a) -> a
List processing
Arguments
| :: Foldable f | |
| => f a | The |
| -> [a] | The list of items that will follow after the items of the |
| -> [a] | A list of items from the |
Convert the given Foldable object to a list where one can specify a tail list.
Arguments
| :: (a -> a -> a) | The given merge function. |
| -> [a] | The first given list of items. |
| -> [a] | The second given list of items. |
| -> [a] | The result of zipping the two lists until one of the lists is exhausted and then return the remaining items of the other list. |
Perform a zipWith, but when one of the lists is exhausted
the remaining elements of the other list are returned.
Lifting objects
Arguments
| :: Foldable f | |
| => Name | The name of the function to call. |
| -> f (Q Exp) | The |
| -> Q Exp | An expression where a function with the given name is applied to the given |
A function that create an expression by calling the function with the given name
and a Foldable of parameters that are applied.
Maybe utils
Upperbound of a division
Arguments
| :: Integral i | |
| => i | The given numerator. |
| -> i | The given denominator. |
| -> i | The corresponding division rounded up. |
Divide the numerator by the denominator and round up.
Raster functions
type Raster a = [[a]] Source #
A Raster is a list of lists of items. This is for example used
to render an image with Bricks where there are multiple layers.
Arguments
| :: (b -> Bool) | The predicate that returns |
| -> [(a, Raster b)] | A list of annotated |
| -> Raster (a, b) | A single |
Arguments
| :: (a -> Bool) | The given predicate that returns |
| -> [Raster a] | The list of |
| -> Raster a | The resulting |
Convert the given Rasters to a raster where the given predicate
decides if we retain the upper or lower layer.