-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Manage and abstract your packer configurations. -- -- Kerry is a library for representing and rendering packer -- definitions. -- -- To get started quickly, see the example. @package kerry @version 0.1 module Kerry.Internal.Prelude -- | Append two lists, i.e., -- --
-- [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] -- [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...] ---- -- If the first list is not finite, the result is the first list. (++) :: () => [a] -> [a] -> [a] infixr 5 ++ -- | The value of seq a b is bottom if a is bottom, and -- otherwise equal to b. In other words, it evaluates the first -- argument a to weak head normal form (WHNF). seq is -- usually introduced to improve performance by avoiding unneeded -- laziness. -- -- A note on evaluation order: the expression seq a b does -- not guarantee that a will be evaluated before -- b. The only guarantee given by seq is that the both -- a and b will be evaluated before seq -- returns a value. In particular, this means that b may be -- evaluated before a. If you need to guarantee a specific order -- of evaluation, you must use the function pseq from the -- "parallel" package. seq :: () => a -> b -> b -- | filter, applied to a predicate and a list, returns the list of -- those elements that satisfy the predicate; i.e., -- --
-- filter p xs = [ x | x <- xs, p x] --filter :: () => (a -> Bool) -> [a] -> [a] -- | zip takes two lists and returns a list of corresponding pairs. -- --
-- zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')] ---- -- If one input list is short, excess elements of the longer list are -- discarded: -- --
-- zip [1] ['a', 'b'] = [(1, 'a')] -- zip [1, 2] ['a'] = [(1, 'a')] ---- -- zip is right-lazy: -- --
-- zip [] _|_ = [] -- zip _|_ [] = _|_ --zip :: () => [a] -> [b] -> [(a, b)] -- | The print function outputs a value of any printable type to the -- standard output device. Printable types are those that are instances -- of class Show; print converts values to strings for -- output using the show operation and adds a newline. -- -- For example, a program to print the first 20 integers and their powers -- of 2 could be written as: -- --
-- main = print ([(n, 2^n) | n <- [0..19]]) --print :: Show a => a -> IO () -- | Extract the first component of a pair. fst :: () => (a, b) -> a -- | Extract the second component of a pair. snd :: () => (a, b) -> b -- | otherwise is defined as the value True. It helps to make -- guards more readable. eg. -- --
-- f x | x < 0 = ... -- | otherwise = ... --otherwise :: Bool -- | map f xs is the list obtained by applying f -- to each element of xs, i.e., -- --
-- map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] -- map f [x1, x2, ...] == [f x1, f x2, ...] --map :: () => (a -> b) -> [a] -> [b] -- | Application operator. This operator is redundant, since ordinary -- application (f x) means the same as (f $ x). -- However, $ has low, right-associative binding precedence, so it -- sometimes allows parentheses to be omitted; for example: -- --
-- f $ g $ h x = f (g (h x)) ---- -- It is also useful in higher-order situations, such as map -- ($ 0) xs, or zipWith ($) fs xs. -- -- Note that ($) is levity-polymorphic in its result type, so -- that foo $ True where foo :: Bool -> Int# is well-typed ($) :: () => (a -> b) -> a -> b infixr 0 $ -- | general coercion from integral types fromIntegral :: (Integral a, Num b) => a -> b -- | general coercion to fractional types realToFrac :: (Real a, Fractional b) => a -> b -- | Conditional failure of Alternative computations. Defined by -- --
-- guard True = pure () -- guard False = empty ---- --
-- >>> safeDiv 4 0 -- Nothing -- >>> safeDiv 4 2 -- Just 2 ---- -- A definition of safeDiv using guards, but not guard: -- --
-- safeDiv :: Int -> Int -> Maybe Int -- safeDiv x y | y /= 0 = Just (x `div` y) -- | otherwise = Nothing ---- -- A definition of safeDiv using guard and Monad -- do-notation: -- --
-- safeDiv :: Int -> Int -> Maybe Int -- safeDiv x y = do -- guard (y /= 0) -- return (x `div` y) --guard :: Alternative f => Bool -> f () -- | The join function is the conventional monad join operator. It -- is used to remove one level of monadic structure, projecting its bound -- argument into the outer level. -- --
-- atomically :: STM a -> IO a ---- -- is used to run STM transactions atomically. So, by specializing -- the types of atomically and join to -- --
-- atomically :: STM (IO b) -> IO (IO b) -- join :: IO (IO b) -> IO b ---- -- we can compose them as -- --
-- join . atomically :: STM (IO b) -> IO b ---- -- to run an STM transaction and the IO action it returns. join :: Monad m => m (m a) -> m a -- | The Bounded class is used to name the upper and lower limits of -- a type. Ord is not a superclass of Bounded since types -- that are not totally ordered may also have upper and lower bounds. -- -- The Bounded class may be derived for any enumeration type; -- minBound is the first constructor listed in the data -- declaration and maxBound is the last. Bounded may also -- be derived for single-constructor datatypes whose constituent types -- are in Bounded. class Bounded a minBound :: Bounded a => a maxBound :: Bounded a => a -- | Class Enum defines operations on sequentially ordered types. -- -- The enumFrom... methods are used in Haskell's translation of -- arithmetic sequences. -- -- Instances of Enum may be derived for any enumeration type -- (types whose constructors have no fields). The nullary constructors -- are assumed to be numbered left-to-right by fromEnum from -- 0 through n-1. See Chapter 10 of the Haskell -- Report for more details. -- -- For any type that is an instance of class Bounded as well as -- Enum, the following should hold: -- --
-- enumFrom x = enumFromTo x maxBound -- enumFromThen x y = enumFromThenTo x y bound -- where -- bound | fromEnum y >= fromEnum x = maxBound -- | otherwise = minBound --class Enum a -- | the successor of a value. For numeric types, succ adds 1. succ :: Enum a => a -> a -- | the predecessor of a value. For numeric types, pred subtracts -- 1. pred :: Enum a => a -> a -- | Convert from an Int. toEnum :: Enum a => Int -> a -- | Convert to an Int. It is implementation-dependent what -- fromEnum returns when applied to a value that is too large to -- fit in an Int. fromEnum :: Enum a => a -> Int -- | Used in Haskell's translation of [n..] with [n..] = -- enumFrom n, a possible implementation being enumFrom n = n : -- enumFrom (succ n). For example: -- --
enumFrom 4 :: [Integer] = [4,5,6,7,...]
enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: -- Int]
enumFromThen 4 6 :: [Integer] = [4,6,8,10...]
enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: -- Int]
enumFromTo 6 10 :: [Int] = [6,7,8,9,10]
enumFromTo 42 1 :: [Integer] = []
enumFromThenTo 4 2 -6 :: [Integer] = -- [4,2,0,-2,-4,-6]
enumFromThenTo 6 8 2 :: [Int] = []
-- (x `quot` y)*y + (x `rem` y) == x --rem :: Integral a => a -> a -> a -- | integer division truncated toward negative infinity div :: Integral a => a -> a -> a -- | integer modulus, satisfying -- --
-- (x `div` y)*y + (x `mod` y) == x --mod :: Integral a => a -> a -> a -- | simultaneous quot and rem quotRem :: Integral a => a -> a -> (a, a) -- | simultaneous div and mod divMod :: Integral a => a -> a -> (a, a) -- | conversion to Integer toInteger :: Integral a => a -> Integer infixl 7 `quot` infixl 7 `rem` infixl 7 `div` infixl 7 `mod` -- | The Monad class defines the basic operations over a -- monad, a concept from a branch of mathematics known as -- category theory. From the perspective of a Haskell programmer, -- however, it is best to think of a monad as an abstract datatype -- of actions. Haskell's do expressions provide a convenient -- syntax for writing monadic expressions. -- -- Instances of Monad should satisfy the following laws: -- -- -- -- Furthermore, the Monad and Applicative operations should -- relate as follows: -- -- -- -- The above laws imply: -- -- -- -- and that pure and (<*>) satisfy the applicative -- functor laws. -- -- The instances of Monad for lists, Maybe and IO -- defined in the Prelude satisfy these laws. class Applicative m => Monad (m :: Type -> Type) -- | Sequentially compose two actions, passing any value produced by the -- first as an argument to the second. (>>=) :: Monad m => m a -> (a -> m b) -> m b -- | Sequentially compose two actions, discarding any value produced by the -- first, like sequencing operators (such as the semicolon) in imperative -- languages. (>>) :: Monad m => m a -> m b -> m b -- | Inject a value into the monadic type. return :: Monad m => a -> m a -- | Fail with a message. This operation is not part of the mathematical -- definition of a monad, but is invoked on pattern-match failure in a -- do expression. -- -- As part of the MonadFail proposal (MFP), this function is moved to its -- own class MonadFail (see Control.Monad.Fail for more -- details). The definition here will be removed in a future release. fail :: Monad m => String -> m a infixl 1 >>= infixl 1 >> -- | The Functor class is used for types that can be mapped over. -- Instances of Functor should satisfy the following laws: -- --
-- fmap id == id -- fmap (f . g) == fmap f . fmap g ---- -- The instances of Functor for lists, Maybe and IO -- satisfy these laws. class Functor (f :: Type -> Type) fmap :: Functor f => (a -> b) -> f a -> f b -- | 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. (<$) :: Functor f => a -> f b -> f a infixl 4 <$ -- | Basic numeric class. -- -- The Haskell Report defines no laws for Num. However, '(+)' and -- '(*)' are customarily expected to define a ring and have the following -- properties: -- --
-- abs x * signum x == x ---- -- For real numbers, the signum is either -1 (negative), -- 0 (zero) or 1 (positive). signum :: Num a => a -> a -- | Conversion from an Integer. An integer literal represents the -- application of the function fromInteger to the appropriate -- value of type Integer, so such literals have type -- (Num a) => a. fromInteger :: Num a => Integer -> a infixl 6 + infixl 7 * infixl 6 - -- | The Ord class is used for totally ordered datatypes. -- -- Instances of Ord can be derived for any user-defined datatype -- whose constituent types are in Ord. The declared order of the -- constructors in the data declaration determines the ordering in -- derived Ord instances. The Ordering datatype allows a -- single comparison to determine the precise ordering of two objects. -- -- The Haskell Report defines no laws for Ord. However, -- <= is customarily expected to implement a non-strict partial -- order and have the following properties: -- --
-- infixr 5 :^: -- data Tree a = Leaf a | Tree a :^: Tree a ---- -- the derived instance of Read in Haskell 2010 is equivalent to -- --
-- instance (Read a) => Read (Tree a) where
--
-- readsPrec d r = readParen (d > app_prec)
-- (\r -> [(Leaf m,t) |
-- ("Leaf",s) <- lex r,
-- (m,t) <- readsPrec (app_prec+1) s]) r
--
-- ++ readParen (d > up_prec)
-- (\r -> [(u:^:v,w) |
-- (u,s) <- readsPrec (up_prec+1) r,
-- (":^:",t) <- lex s,
-- (v,w) <- readsPrec (up_prec+1) t]) r
--
-- where app_prec = 10
-- up_prec = 5
--
--
-- Note that right-associativity of :^: is unused.
--
-- The derived instance in GHC is equivalent to
--
-- -- instance (Read a) => Read (Tree a) where -- -- readPrec = parens $ (prec app_prec $ do -- Ident "Leaf" <- lexP -- m <- step readPrec -- return (Leaf m)) -- -- +++ (prec up_prec $ do -- u <- step readPrec -- Symbol ":^:" <- lexP -- v <- step readPrec -- return (u :^: v)) -- -- where app_prec = 10 -- up_prec = 5 -- -- readListPrec = readListPrecDefault ---- -- Why do both readsPrec and readPrec exist, and why does -- GHC opt to implement readPrec in derived Read instances -- instead of readsPrec? The reason is that readsPrec is -- based on the ReadS type, and although ReadS is mentioned -- in the Haskell 2010 Report, it is not a very efficient parser data -- structure. -- -- readPrec, on the other hand, is based on a much more efficient -- ReadPrec datatype (a.k.a "new-style parsers"), but its -- definition relies on the use of the RankNTypes language -- extension. Therefore, readPrec (and its cousin, -- readListPrec) are marked as GHC-only. Nevertheless, it is -- recommended to use readPrec instead of readsPrec -- whenever possible for the efficiency improvements it brings. -- -- As mentioned above, derived Read instances in GHC will -- implement readPrec instead of readsPrec. The default -- implementations of readsPrec (and its cousin, readList) -- will simply use readPrec under the hood. If you are writing a -- Read instance by hand, it is recommended to write it like so: -- --
-- instance Read T where -- readPrec = ... -- readListPrec = readListPrecDefault --class Read a -- | attempts to parse a value from the front of the string, returning a -- list of (parsed value, remaining string) pairs. If there is no -- successful parse, the returned list is empty. -- -- Derived instances of Read and Show satisfy the -- following: -- -- -- -- That is, readsPrec parses the string produced by -- showsPrec, and delivers the value that showsPrec started -- with. readsPrec :: Read a => Int -> ReadS a -- | The method readList is provided to allow the programmer to give -- a specialised way of parsing lists of values. For example, this is -- used by the predefined Read instance of the Char type, -- where values of type String should be are expected to use -- double quotes, rather than square brackets. readList :: Read a => ReadS [a] class (Num a, Ord a) => Real a -- | the rational equivalent of its real argument with full precision toRational :: Real a => a -> Rational -- | Efficient, machine-independent access to the components of a -- floating-point number. class (RealFrac a, Floating a) => RealFloat a -- | a constant function, returning the radix of the representation (often -- 2) floatRadix :: RealFloat a => a -> Integer -- | a constant function, returning the number of digits of -- floatRadix in the significand floatDigits :: RealFloat a => a -> Int -- | a constant function, returning the lowest and highest values the -- exponent may assume floatRange :: RealFloat a => a -> (Int, Int) -- | The function decodeFloat applied to a real floating-point -- number returns the significand expressed as an Integer and an -- appropriately scaled exponent (an Int). If -- decodeFloat x yields (m,n), then x -- is equal in value to m*b^^n, where b is the -- floating-point radix, and furthermore, either m and -- n are both zero or else b^(d-1) <= abs m < -- b^d, where d is the value of floatDigits -- x. In particular, decodeFloat 0 = (0,0). If the -- type contains a negative zero, also decodeFloat (-0.0) = -- (0,0). The result of decodeFloat x is -- unspecified if either of isNaN x or -- isInfinite x is True. decodeFloat :: RealFloat a => a -> (Integer, Int) -- | encodeFloat performs the inverse of decodeFloat in the -- sense that for finite x with the exception of -0.0, -- uncurry encodeFloat (decodeFloat x) = -- x. encodeFloat m n is one of the two closest -- representable floating-point numbers to m*b^^n (or -- ±Infinity if overflow occurs); usually the closer, but if -- m contains too many bits, the result may be rounded in the -- wrong direction. encodeFloat :: RealFloat a => Integer -> Int -> a -- | exponent corresponds to the second component of -- decodeFloat. exponent 0 = 0 and for finite -- nonzero x, exponent x = snd (decodeFloat x) -- + floatDigits x. If x is a finite floating-point -- number, it is equal in value to significand x * b ^^ -- exponent x, where b is the floating-point radix. -- The behaviour is unspecified on infinite or NaN values. exponent :: RealFloat a => a -> Int -- | The first component of decodeFloat, scaled to lie in the open -- interval (-1,1), either 0.0 or of absolute -- value >= 1/b, where b is the floating-point -- radix. The behaviour is unspecified on infinite or NaN -- values. significand :: RealFloat a => a -> a -- | multiplies a floating-point number by an integer power of the radix scaleFloat :: RealFloat a => Int -> a -> a -- | True if the argument is an IEEE "not-a-number" (NaN) value isNaN :: RealFloat a => a -> Bool -- | True if the argument is an IEEE infinity or negative infinity isInfinite :: RealFloat a => a -> Bool -- | True if the argument is too small to be represented in -- normalized format isDenormalized :: RealFloat a => a -> Bool -- | True if the argument is an IEEE negative zero isNegativeZero :: RealFloat a => a -> Bool -- | True if the argument is an IEEE floating point number isIEEE :: RealFloat a => a -> Bool -- | a version of arctangent taking two real floating-point arguments. For -- real floating x and y, atan2 y x -- computes the angle (from the positive x-axis) of the vector from the -- origin to the point (x,y). atan2 y x returns -- a value in the range [-pi, pi]. It follows the -- Common Lisp semantics for the origin when signed zeroes are supported. -- atan2 y 1, with y in a type that is -- RealFloat, should return the same value as atan -- y. A default definition of atan2 is provided, but -- implementors can provide a more accurate implementation. atan2 :: RealFloat a => a -> a -> a -- | Extracting components of fractions. class (Real a, Fractional a) => RealFrac a -- | The function properFraction takes a real fractional number -- x and returns a pair (n,f) such that x = -- n+f, and: -- --
-- infixr 5 :^: -- data Tree a = Leaf a | Tree a :^: Tree a ---- -- the derived instance of Show is equivalent to -- --
-- instance (Show a) => Show (Tree a) where -- -- showsPrec d (Leaf m) = showParen (d > app_prec) $ -- showString "Leaf " . showsPrec (app_prec+1) m -- where app_prec = 10 -- -- showsPrec d (u :^: v) = showParen (d > up_prec) $ -- showsPrec (up_prec+1) u . -- showString " :^: " . -- showsPrec (up_prec+1) v -- where up_prec = 5 ---- -- Note that right-associativity of :^: is ignored. For example, -- --
-- showsPrec d x r ++ s == showsPrec d x (r ++ s) ---- -- Derived instances of Read and Show satisfy the -- following: -- -- -- -- That is, readsPrec parses the string produced by -- showsPrec, and delivers the value that showsPrec started -- with. showsPrec :: Show a => Int -> a -> ShowS -- | A specialised variant of showsPrec, using precedence context -- zero, and returning an ordinary String. show :: Show a => a -> String -- | The method showList is provided to allow the programmer to give -- a specialised way of showing lists of values. For example, this is -- used by the predefined Show instance of the Char type, -- where values of type String should be shown in double quotes, -- rather than between square brackets. showList :: Show a => [a] -> ShowS -- | A functor with application, providing operations to -- --
-- (<*>) = liftA2 id ---- --
-- liftA2 f x y = f <$> x <*> y ---- -- Further, any definition must satisfy the following: -- --
pure id <*> -- v = v
pure (.) <*> u -- <*> v <*> w = u <*> (v -- <*> w)
pure f <*> -- pure x = pure (f x)
u <*> pure y = -- pure ($ y) <*> u
-- 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). class Functor f => Applicative (f :: Type -> Type) -- | Lift a value. pure :: Applicative f => a -> f a -- | Sequential application. -- -- A few functors support an implementation of <*> that is -- more efficient than the default one. (<*>) :: Applicative f => f (a -> b) -> f a -> f b -- | 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 <*>. liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c -- | Sequence actions, discarding the value of the first argument. (*>) :: Applicative f => f a -> f b -> f b -- | Sequence actions, discarding the value of the second argument. (<*) :: Applicative f => f a -> f b -> f a infixl 4 <*> infixl 4 *> infixl 4 <* -- | Data structures that can be folded. -- -- For example, given a data type -- --
-- data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) ---- -- a suitable instance would be -- --
-- instance Foldable Tree where -- foldMap f Empty = mempty -- foldMap f (Leaf x) = f x -- foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r ---- -- This is suitable even for abstract types, as the monoid is assumed to -- satisfy the monoid laws. Alternatively, one could define -- foldr: -- --
-- instance Foldable Tree where -- foldr f z Empty = z -- foldr f z (Leaf x) = f x z -- foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l ---- -- Foldable instances are expected to satisfy the following -- laws: -- --
-- foldr f z t = appEndo (foldMap (Endo . f) t ) z ---- --
-- foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z ---- --
-- fold = foldMap id ---- --
-- length = getSum . foldMap (Sum . const 1) ---- -- sum, product, maximum, and minimum -- should all be essentially equivalent to foldMap forms, such -- as -- --
-- sum = getSum . foldMap Sum ---- -- but may be less defined. -- -- If the type is also a Functor instance, it should satisfy -- --
-- foldMap f = fold . fmap f ---- -- which implies that -- --
-- foldMap f . fmap g = foldMap (f . g) --class Foldable (t :: Type -> Type) -- | Map each element of the structure to a monoid, and combine the -- results. foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m -- | Right-associative fold of a structure. -- -- In the case of lists, foldr, when applied to a binary operator, -- a starting value (typically the right-identity of the operator), and a -- list, reduces the list using the binary operator, from right to left: -- --
-- foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...) ---- -- Note that, since the head of the resulting expression is produced by -- an application of the operator to the first element of the list, -- foldr can produce a terminating expression from an infinite -- list. -- -- For a general Foldable structure this should be semantically -- identical to, -- --
-- foldr f z = foldr f z . toList --foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b -- | Left-associative fold of a structure. -- -- In the case of lists, foldl, when applied to a binary operator, -- a starting value (typically the left-identity of the operator), and a -- list, reduces the list using the binary operator, from left to right: -- --
-- foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn ---- -- Note that to produce the outermost application of the operator the -- entire input list must be traversed. This means that foldl' -- will diverge if given an infinite list. -- -- Also note that if you want an efficient left-fold, you probably want -- to use foldl' instead of foldl. The reason for this is -- that latter does not force the "inner" results (e.g. z f -- x1 in the above example) before applying them to the operator -- (e.g. to (f x2)). This results in a thunk chain -- O(n) elements long, which then must be evaluated from the -- outside-in. -- -- For a general Foldable structure this should be semantically -- identical to, -- --
-- foldl f z = foldl f z . toList --foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b -- | A variant of foldr that has no base case, and thus may only be -- applied to non-empty structures. -- --
-- foldr1 f = foldr1 f . toList --foldr1 :: Foldable t => (a -> a -> a) -> t a -> a -- | A variant of foldl that has no base case, and thus may only be -- applied to non-empty structures. -- --
-- foldl1 f = foldl1 f . toList --foldl1 :: Foldable t => (a -> a -> a) -> t a -> a -- | Test whether the structure is empty. The default implementation is -- optimized for structures that are similar to cons-lists, because there -- is no general way to do better. null :: Foldable t => t a -> Bool -- | Returns the size/length of a finite structure as an Int. The -- default implementation is optimized for structures that are similar to -- cons-lists, because there is no general way to do better. length :: Foldable t => t a -> Int -- | Does the element occur in the structure? elem :: (Foldable t, Eq a) => a -> t a -> Bool -- | The largest element of a non-empty structure. maximum :: (Foldable t, Ord a) => t a -> a -- | The least element of a non-empty structure. minimum :: (Foldable t, Ord a) => t a -> a -- | The sum function computes the sum of the numbers of a -- structure. sum :: (Foldable t, Num a) => t a -> a -- | The product function computes the product of the numbers of a -- structure. product :: (Foldable t, Num a) => t a -> a infix 4 `elem` -- | Functors representing data structures that can be traversed from left -- to right. -- -- A definition of traverse must satisfy the following laws: -- --
-- 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: -- --
x <> mempty = x
mempty <> x = x
mconcat = foldr '(<>)' -- mempty
-- >>> let s = Left "foo" :: Either String Int -- -- >>> s -- Left "foo" -- -- >>> let n = Right 3 :: Either String Int -- -- >>> n -- Right 3 -- -- >>> :type s -- s :: Either String Int -- -- >>> :type n -- n :: Either String Int ---- -- The fmap from our Functor instance will ignore -- Left values, but will apply the supplied function to values -- contained in a Right: -- --
-- >>> let s = Left "foo" :: Either String Int -- -- >>> let n = Right 3 :: Either String Int -- -- >>> fmap (*2) s -- Left "foo" -- -- >>> fmap (*2) n -- Right 6 ---- -- The Monad instance for Either allows us to chain -- together multiple actions which may fail, and fail overall if any of -- the individual steps failed. First we'll write a function that can -- either parse an Int from a Char, or fail. -- --
-- >>> import Data.Char ( digitToInt, isDigit )
--
-- >>> :{
-- let parseEither :: Char -> Either String Int
-- parseEither c
-- | isDigit c = Right (digitToInt c)
-- | otherwise = Left "parse error"
--
-- >>> :}
--
--
-- The following should work, since both '1' and '2'
-- can be parsed as Ints.
--
--
-- >>> :{
-- let parseMultiple :: Either String Int
-- parseMultiple = do
-- x <- parseEither '1'
-- y <- parseEither '2'
-- return (x + y)
--
-- >>> :}
--
--
-- -- >>> parseMultiple -- Right 3 ---- -- But the following should fail overall, since the first operation where -- we attempt to parse 'm' as an Int will fail: -- --
-- >>> :{
-- let parseMultiple :: Either String Int
-- parseMultiple = do
-- x <- parseEither 'm'
-- y <- parseEither '2'
-- return (x + y)
--
-- >>> :}
--
--
-- -- >>> parseMultiple -- Left "parse error" --data Either a b Left :: a -> Either a b Right :: b -> Either a b -- | A space-efficient representation of a Word8 vector, supporting -- many efficient operations. -- -- A ByteString contains 8-bit bytes, or by using the operations -- from Data.ByteString.Char8 it can be interpreted as containing -- 8-bit characters. data ByteString -- | 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. -- --
-- >>> 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) --(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 <$> -- | A space efficient, packed, unboxed Unicode text type. data Text -- | A Map from keys k to values a. data Map k a -- | The read function reads input from a string, which must be -- completely consumed by the input process. read fails with an -- error if the parse is unsuccessful, and it is therefore -- discouraged from being used in real applications. Use readMaybe -- or readEither for safe alternatives. -- --
-- >>> read "123" :: Int -- 123 ---- --
-- >>> read "hello" :: Int -- *** Exception: Prelude.read: no parse --read :: Read a => String -> a -- | A String is a list of characters. String constants in Haskell -- are values of type String. type String = [Char] -- | A monoid on applicative functors. -- -- If defined, some and many should be the least solutions -- of the equations: -- -- class Applicative f => Alternative (f :: Type -> Type) -- | An associative binary operation (<|>) :: Alternative f => f a -> f a -> f a -- | One or more. some :: Alternative f => f a -> f [a] -- | Zero or more. many :: Alternative f => f a -> f [a] infixl 3 <|> -- | Monads that also support choice and failure. class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) -- | The identity of mplus. It should also satisfy the equations -- --
-- mzero >>= f = mzero -- v >> mzero = mzero ---- -- The default definition is -- --
-- mzero = empty --mzero :: MonadPlus m => m a -- | An associative operation. The default definition is -- --
-- mplus = (<|>) --mplus :: MonadPlus m => m a -> m a -> m a -- | Uninhabited data type data Void -- | Fold an Option case-wise, just like maybe. option :: () => b -> (a -> b) -> Option a -> b -- | 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. mtimesDefault :: (Integral b, Monoid a) => b -> a -> a -- | This lets you use a difference list of a Semigroup as a -- Monoid. diff :: Semigroup m => m -> Endo m -- | A generalization of cycle to an arbitrary Semigroup. May -- fail to terminate for some values in some semigroups. cycle1 :: Semigroup m => m -> m newtype Min a Min :: a -> Min a [getMin] :: Min a -> a newtype Max a Max :: a -> Max a [getMax] :: Max a -> a -- | 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. data Arg a b Arg :: a -> b -> Arg a b type ArgMin a b = Min Arg a b type ArgMax a b = Max Arg a b -- | Use Option (First a) to get the behavior of -- First from Data.Monoid. newtype First a First :: a -> First a [getFirst] :: First a -> a -- | Use Option (Last a) to get the behavior of -- Last from Data.Monoid newtype Last a Last :: a -> Last a [getLast] :: Last a -> a -- | 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. newtype WrappedMonoid m WrapMonoid :: m -> WrappedMonoid m [unwrapMonoid] :: WrappedMonoid m -> m -- | 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. newtype Option a Option :: Maybe a -> Option a [getOption] :: Option a -> Maybe a -- | 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 id ≡ id ---- -- If you supply first and second, ensure: -- --
-- first id ≡ id -- second id ≡ id ---- -- 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 --class Bifunctor (p :: Type -> Type -> Type) -- | Map over both arguments at the same time. -- --
-- bimap f g ≡ first f . second g ---- --
-- >>> bimap toUpper (+1) ('j', 3)
-- ('J',4)
--
--
-- -- >>> bimap toUpper (+1) (Left 'j') -- Left 'J' ---- --
-- >>> bimap toUpper (+1) (Right 3) -- Right 4 --bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d -- | Map covariantly over the first argument. -- --
-- first f ≡ bimap f id ---- --
-- >>> first toUpper ('j', 3)
-- ('J',3)
--
--
-- -- >>> first toUpper (Left 'j') -- Left 'J' --first :: Bifunctor p => (a -> b) -> p a c -> p b c -- | Map covariantly over the second argument. -- --
-- second ≡ bimap id ---- --
-- >>> second (+1) ('j', 3)
-- ('j',4)
--
--
-- -- >>> second (+1) (Right 3) -- Right 4 --second :: Bifunctor p => (b -> c) -> p a b -> p a c -- | Monads in which IO computations may be embedded. Any monad -- built by applying a sequence of monad transformers to the IO -- monad will be an instance of this class. -- -- Instances should satisfy the following laws, which state that -- liftIO is a transformer of monads: -- -- class Monad m => MonadIO (m :: Type -> Type) -- | Lift a computation from the IO monad. liftIO :: MonadIO m => IO a -> m a -- | Direct MonadPlus equivalent of filter. -- --
-- filter = ( mfilter :: (a -> Bool) -> [a] -> [a] ) ---- -- An example using mfilter with the Maybe monad: -- --
-- >>> mfilter odd (Just 1) -- Just 1 -- >>> mfilter odd (Just 2) -- Nothing --mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a -- | Strict version of <$>. (<$!>) :: Monad m => (a -> b) -> m a -> m b infixl 4 <$!> -- | The reverse of when. unless :: Applicative f => Bool -> f () -> f () -- | Like replicateM, but discards the result. replicateM_ :: Applicative m => Int -> m a -> m () -- | replicateM n act performs the action n times, -- gathering the results. replicateM :: Applicative m => Int -> m a -> m [a] -- | Like foldM, but discards the result. foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () -- | The foldM function is analogous to foldl, except that -- its result is encapsulated in a monad. Note that foldM works -- from left-to-right over the list arguments. This could be an issue -- where (>>) and the `folded function' are not -- commutative. -- --
-- foldM f a1 [x1, x2, ..., xm] -- -- == -- -- do -- a2 <- f a1 x1 -- a3 <- f a2 x2 -- ... -- f am xm ---- -- If right-to-left evaluation is required, the input list should be -- reversed. -- -- Note: foldM is the same as foldlM foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b -- | zipWithM_ is the extension of zipWithM which ignores the -- final result. zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () -- | The zipWithM function generalizes zipWith to arbitrary -- applicative functors. zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] -- | The mapAndUnzipM function maps its first argument over a list, -- returning the result as a pair of lists. This function is mainly used -- with complicated data structures or a state-transforming monad. mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) -- | Repeat an action indefinitely. -- --
-- echoServer :: Socket -> IO () -- echoServer socket = forever $ do -- client <- accept socket -- forkFinally (echo client) (\_ -> hClose client) -- where -- echo :: Handle -> IO () -- echo client = forever $ -- hGetLine client >>= hPutStrLn client --forever :: Applicative f => f a -> f b -- | Right-to-left composition of Kleisli arrows. -- (>=>), with the arguments flipped. -- -- Note how this operator resembles function composition -- (.): -- --
-- (.) :: (b -> c) -> (a -> b) -> a -> c -- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c --(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 <=< -- | Left-to-right composition of Kleisli arrows. (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 >=> -- | This generalizes the list-based filter function. filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] -- | forM is mapM with its arguments flipped. For a version -- that ignores the results see forM_. forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) -- | for is traverse with its arguments flipped. For a -- version that ignores the results see for_. for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b) -- | One or none. optional :: Alternative f => f a -> f (Maybe a) newtype WrappedMonad (m :: Type -> Type) a WrapMonad :: m a -> WrappedMonad a [unwrapMonad] :: WrappedMonad a -> m a newtype WrappedArrow (a :: Type -> Type -> Type) b c WrapArrow :: a b c -> WrappedArrow b c [unwrapArrow] :: WrappedArrow b c -> a b c -- | Lists, but with an Applicative functor based on zipping. newtype ZipList a ZipList :: [a] -> ZipList a [getZipList] :: ZipList a -> [a] -- | The readIO function is similar to read except that it -- signals parse failure to the IO monad instead of terminating -- the program. readIO :: Read a => String -> IO a -- | The readLn function combines getLine and readIO. readLn :: Read a => IO a -- | The computation appendFile file str function appends -- the string str, to the file file. -- -- Note that writeFile and appendFile write a literal -- string to a file. To write a value of any printable type, as with -- print, use the show function to convert the value to a -- string first. -- --
-- main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]]) --appendFile :: FilePath -> String -> IO () -- | The computation writeFile file str function writes the -- string str, to the file file. writeFile :: FilePath -> String -> IO () -- | The readFile function reads a file and returns the contents of -- the file as a string. The file is read lazily, on demand, as with -- getContents. readFile :: FilePath -> IO String -- | The interact function takes a function of type -- String->String as its argument. The entire input from the -- standard input device is passed to this function as its argument, and -- the resulting string is output on the standard output device. interact :: (String -> String) -> IO () -- | The getContents operation returns all user input as a single -- string, which is read lazily as it is needed (same as -- hGetContents stdin). getContents :: IO String -- | Read a line from the standard input device (same as hGetLine -- stdin). getLine :: IO String -- | Read a character from the standard input device (same as -- hGetChar stdin). getChar :: IO Char -- | The same as putStr, but adds a newline character. putStrLn :: String -> IO () -- | Write a string to the standard output device (same as hPutStr -- stdout). putStr :: String -> IO () -- | Write a character to the standard output device (same as -- hPutChar stdout). putChar :: Char -> IO () -- | Raise an IOException in the IO monad. ioError :: () => IOError -> IO a -- | File and directory names are values of type String, whose -- precise meaning is operating system dependent. Files can be opened, -- yielding a handle which can then be used to operate on the contents of -- that file. type FilePath = String -- | Construct an IOException value with a string describing the -- error. The fail method of the IO instance of the -- Monad class raises a userError, thus: -- --
-- instance Monad IO where -- ... -- fail s = ioError (userError s) --userError :: String -> IOError -- | The Haskell 2010 type for exceptions in the IO monad. Any I/O -- operation may raise an IOException instead of returning a -- result. For a more general type of exception, including also those -- that arise in pure code, see Exception. -- -- In Haskell 2010, this is an opaque type. type IOError = IOException -- | The Const functor. newtype Const a (b :: k) :: forall k. () => Type -> k -> Type Const :: a -> Const a [getConst] :: Const a -> a -- | notElem is the negation of elem. notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 `notElem` -- | Determines whether all elements of the structure satisfy the -- predicate. all :: Foldable t => (a -> Bool) -> t a -> Bool -- | Determines whether any element of the structure satisfies the -- predicate. any :: Foldable t => (a -> Bool) -> t a -> Bool -- | or returns the disjunction of a container of Bools. For the -- result to be False, the container must be finite; True, -- however, results from a True value finitely far from the left -- end. or :: Foldable t => t Bool -> Bool -- | and returns the conjunction of a container of Bools. For the -- result to be True, the container must be finite; False, -- however, results from a False value finitely far from the left -- end. and :: Foldable t => t Bool -> Bool -- | Map a function over all the elements of a container and concatenate -- the resulting lists. concatMap :: Foldable t => (a -> [b]) -> t a -> [b] -- | The concatenation of all the elements of a container of lists. concat :: Foldable t => t [a] -> [a] -- | The sum of a collection of actions, generalizing concat. As of -- base 4.8.0.0, msum is just asum, specialized to -- MonadPlus. msum :: (Foldable t, MonadPlus m) => t (m a) -> m a -- | Evaluate each monadic action in the structure from left to right, and -- ignore the results. For a version that doesn't ignore the results see -- sequence. -- -- As of base 4.8.0.0, sequence_ is just sequenceA_, -- specialized to Monad. sequence_ :: (Foldable t, Monad m) => t (m a) -> m () -- | forM_ is mapM_ with its arguments flipped. For a version -- that doesn't ignore the results see forM. -- -- As of base 4.8.0.0, forM_ is just for_, specialized to -- Monad. forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () -- | Map each element of a structure to a monadic action, evaluate these -- actions from left to right, and ignore the results. For a version that -- doesn't ignore the results see mapM. -- -- As of base 4.8.0.0, mapM_ is just traverse_, specialized -- to Monad. mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () -- | for_ is traverse_ with its arguments flipped. For a -- version that doesn't ignore the results see for. -- --
-- >>> for_ [1..4] print -- 1 -- 2 -- 3 -- 4 --for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () -- | Map each element of a structure to an action, evaluate these actions -- from left to right, and ignore the results. For a version that doesn't -- ignore the results see traverse. traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f () -- | 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. stimesMonoid :: (Integral b, Monoid a) => 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). stimesIdempotent :: Integral b => b -> a -> a -- | The dual of a Monoid, obtained by swapping the arguments of -- mappend. -- --
-- >>> getDual (mappend (Dual "Hello") (Dual "World")) -- "WorldHello" --newtype Dual a Dual :: a -> Dual a [getDual] :: Dual a -> a -- | The monoid of endomorphisms under composition. -- --
-- >>> let computation = Endo ("Hello, " ++) <> Endo (++ "!")
--
-- >>> appEndo computation "Haskell"
-- "Hello, Haskell!"
--
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a
-- | Boolean monoid under conjunction (&&).
--
-- -- >>> getAll (All True <> mempty <> All False) -- False ---- --
-- >>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8])) -- False --newtype All All :: Bool -> All [getAll] :: All -> Bool -- | Boolean monoid under disjunction (||). -- --
-- >>> getAny (Any True <> mempty <> Any False) -- True ---- --
-- >>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8])) -- True --newtype Any Any :: Bool -> Any [getAny] :: Any -> Bool -- | Monoid under addition. -- --
-- >>> getSum (Sum 1 <> Sum 2 <> mempty) -- 3 --newtype Sum a Sum :: a -> Sum a [getSum] :: Sum a -> a -- | Monoid under multiplication. -- --
-- >>> getProduct (Product 3 <> Product 4 <> mempty) -- 12 --newtype Product a Product :: a -> Product a [getProduct] :: Product a -> a -- | unwords is an inverse operation to words. It joins words -- with separating spaces. -- --
-- >>> unwords ["Lorem", "ipsum", "dolor"] -- "Lorem ipsum dolor" --unwords :: [String] -> String -- | words breaks a string up into a list of words, which were -- delimited by white space. -- --
-- >>> words "Lorem ipsum\ndolor" -- ["Lorem","ipsum","dolor"] --words :: String -> [String] -- | unlines is an inverse operation to lines. It joins -- lines, after appending a terminating newline to each. -- --
-- >>> unlines ["Hello", "World", "!"] -- "Hello\nWorld\n!\n" --unlines :: [String] -> String -- | lines breaks a string up into a list of strings at newline -- characters. The resulting strings do not contain newlines. -- -- Note that after splitting the string at newline characters, the last -- part of the string is considered a line even if it doesn't end with a -- newline. For example, -- --
-- >>> lines "" -- [] ---- --
-- >>> lines "\n" -- [""] ---- --
-- >>> lines "one" -- ["one"] ---- --
-- >>> lines "one\n" -- ["one"] ---- --
-- >>> lines "one\n\n" -- ["one",""] ---- --
-- >>> lines "one\ntwo" -- ["one","two"] ---- --
-- >>> lines "one\ntwo\n" -- ["one","two"] ---- -- Thus lines s contains at least as many elements as -- newlines in s. lines :: String -> [String] -- | equivalent to readsPrec with a precedence of 0. reads :: Read a => ReadS a -- | Case analysis for the Either type. If the value is -- Left a, apply the first function to a; if it -- is Right b, apply the second function to b. -- --
-- >>> let s = Left "foo" :: Either String Int -- -- >>> let n = Right 3 :: Either String Int -- -- >>> either length (*2) s -- 3 -- -- >>> either length (*2) n -- 6 --either :: () => (a -> c) -> (b -> c) -> Either a b -> c -- | The lex function reads a single lexeme from the input, -- discarding initial white space, and returning the characters that -- constitute the lexeme. If the input string contains only white space, -- lex returns a single successful `lexeme' consisting of the -- empty string. (Thus lex "" = [("","")].) If there is -- no legal lexeme at the beginning of the input string, lex fails -- (i.e. returns []). -- -- This lexer is not completely faithful to the Haskell lexical syntax in -- the following respects: -- --
-- >>> void Nothing -- Nothing -- -- >>> void (Just 3) -- Just () ---- -- Replace the contents of an Either Int -- Int with unit, resulting in an Either -- Int '()': -- --
-- >>> void (Left 8675309) -- Left 8675309 -- -- >>> void (Right 8675309) -- Right () ---- -- Replace every element of a list with unit: -- --
-- >>> void [1,2,3] -- [(),(),()] ---- -- Replace the second element of a pair with unit: -- --
-- >>> void (1,2) -- (1,()) ---- -- Discard the result of an IO action: -- --
-- >>> mapM print [1,2] -- 1 -- 2 -- [(),()] -- -- >>> void $ mapM print [1,2] -- 1 -- 2 --void :: Functor f => f a -> f () -- | lcm x y is the smallest positive integer that both -- x and y divide. lcm :: Integral a => a -> a -> a -- | gcd x y is the non-negative factor of both x -- and y of which every common factor of x and -- y is also a factor; for example gcd 4 2 = 2, -- gcd (-4) 6 = 2, gcd 0 4 = 4. -- gcd 0 0 = 0. (That is, the common divisor -- that is "greatest" in the divisibility preordering.) -- -- Note: Since for signed fixed-width integer types, abs -- minBound < 0, the result may be negative if one of the -- arguments is minBound (and necessarily is if the other -- is 0 or minBound) for such types. gcd :: Integral a => a -> a -> a -- | raise a number to an integral power (^^) :: (Fractional a, Integral b) => a -> b -> a infixr 8 ^^ -- | raise a number to a non-negative integral power (^) :: (Num a, Integral b) => a -> b -> a infixr 8 ^ odd :: Integral a => a -> Bool even :: Integral a => a -> Bool -- | utility function that surrounds the inner show function with -- parentheses when the Bool parameter is True. showParen :: Bool -> ShowS -> ShowS -- | utility function converting a String to a show function that -- simply prepends the string unchanged. showString :: String -> ShowS -- | utility function converting a Char to a show function that -- simply prepends the character unchanged. showChar :: Char -> ShowS -- | equivalent to showsPrec with a precedence of 0. shows :: Show a => a -> ShowS -- | The shows functions return a function that prepends the -- output String to an existing String. This allows -- constant-time concatenation of results using function composition. type ShowS = String -> String -- | The unzip3 function takes a list of triples and returns three -- lists, analogous to unzip. unzip3 :: () => [(a, b, c)] -> ([a], [b], [c]) -- | unzip transforms a list of pairs into a list of first -- components and a list of second components. unzip :: () => [(a, b)] -> ([a], [b]) -- | The zipWith3 function takes a function which combines three -- elements, as well as three lists and returns a list of their -- point-wise combination, analogous to zipWith. zipWith3 :: () => (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] -- | zipWith generalises zip by zipping with the function -- given as the first argument, instead of a tupling function. For -- example, zipWith (+) is applied to two lists to -- produce the list of corresponding sums. -- -- zipWith is right-lazy: -- --
-- zipWith f [] _|_ = [] --zipWith :: () => (a -> b -> c) -> [a] -> [b] -> [c] -- | zip3 takes three lists and returns a list of triples, analogous -- to zip. zip3 :: () => [a] -> [b] -> [c] -> [(a, b, c)] -- | List index (subscript) operator, starting from 0. It is an instance of -- the more general genericIndex, which takes an index of any -- integral type. (!!) :: () => [a] -> Int -> a infixl 9 !! -- | lookup key assocs looks up a key in an association -- list. lookup :: Eq a => a -> [(a, b)] -> Maybe b -- | reverse xs returns the elements of xs in -- reverse order. xs must be finite. reverse :: () => [a] -> [a] -- | break, applied to a predicate p and a list -- xs, returns a tuple where first element is longest prefix -- (possibly empty) of xs of elements that do not satisfy -- p and second element is the remainder of the list: -- --
-- break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4]) -- break (< 9) [1,2,3] == ([],[1,2,3]) -- break (> 9) [1,2,3] == ([1,2,3],[]) ---- -- break p is equivalent to span (not . -- p). break :: () => (a -> Bool) -> [a] -> ([a], [a]) -- | span, applied to a predicate p and a list xs, -- returns a tuple where first element is longest prefix (possibly empty) -- of xs of elements that satisfy p and second element -- is the remainder of the list: -- --
-- span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4]) -- span (< 9) [1,2,3] == ([1,2,3],[]) -- span (< 0) [1,2,3] == ([],[1,2,3]) ---- -- span p xs is equivalent to (takeWhile p xs, -- dropWhile p xs) span :: () => (a -> Bool) -> [a] -> ([a], [a]) -- | splitAt n xs returns a tuple where first element is -- xs prefix of length n and second element is the -- remainder of the list: -- --
-- splitAt 6 "Hello World!" == ("Hello ","World!")
-- splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
-- splitAt 1 [1,2,3] == ([1],[2,3])
-- splitAt 3 [1,2,3] == ([1,2,3],[])
-- splitAt 4 [1,2,3] == ([1,2,3],[])
-- splitAt 0 [1,2,3] == ([],[1,2,3])
-- splitAt (-1) [1,2,3] == ([],[1,2,3])
--
--
-- It is equivalent to (take n xs, drop n xs) when
-- n is not _|_ (splitAt _|_ xs = _|_).
-- splitAt is an instance of the more general
-- genericSplitAt, in which n may be of any integral
-- type.
splitAt :: () => Int -> [a] -> ([a], [a])
-- | drop n xs returns the suffix of xs after the
-- first n elements, or [] if n > length
-- xs:
--
-- -- drop 6 "Hello World!" == "World!" -- drop 3 [1,2,3,4,5] == [4,5] -- drop 3 [1,2] == [] -- drop 3 [] == [] -- drop (-1) [1,2] == [1,2] -- drop 0 [1,2] == [1,2] ---- -- It is an instance of the more general genericDrop, in which -- n may be of any integral type. drop :: () => Int -> [a] -> [a] -- | take n, applied to a list xs, returns the -- prefix of xs of length n, or xs itself if -- n > length xs: -- --
-- take 5 "Hello World!" == "Hello" -- take 3 [1,2,3,4,5] == [1,2,3] -- take 3 [1,2] == [1,2] -- take 3 [] == [] -- take (-1) [1,2] == [] -- take 0 [1,2] == [] ---- -- It is an instance of the more general genericTake, in which -- n may be of any integral type. take :: () => Int -> [a] -> [a] -- | dropWhile p xs returns the suffix remaining after -- takeWhile p xs: -- --
-- dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3] -- dropWhile (< 9) [1,2,3] == [] -- dropWhile (< 0) [1,2,3] == [1,2,3] --dropWhile :: () => (a -> Bool) -> [a] -> [a] -- | takeWhile, applied to a predicate p and a list -- xs, returns the longest prefix (possibly empty) of -- xs of elements that satisfy p: -- --
-- takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2] -- takeWhile (< 9) [1,2,3] == [1,2,3] -- takeWhile (< 0) [1,2,3] == [] --takeWhile :: () => (a -> Bool) -> [a] -> [a] -- | cycle ties a finite list into a circular one, or equivalently, -- the infinite repetition of the original list. It is the identity on -- infinite lists. cycle :: () => [a] -> [a] -- | replicate n x is a list of length n with -- x the value of every element. It is an instance of the more -- general genericReplicate, in which n may be of any -- integral type. replicate :: () => Int -> a -> [a] -- | repeat x is an infinite list, with x the -- value of every element. repeat :: () => a -> [a] -- | iterate f x returns an infinite list of repeated -- applications of f to x: -- --
-- iterate f x == [x, f x, f (f x), ...] ---- -- Note that iterate is lazy, potentially leading to thunk -- build-up if the consumer doesn't force each iterate. See 'iterate\'' -- for a strict variant of this function. iterate :: () => (a -> a) -> a -> [a] -- | scanr1 is a variant of scanr that has no starting value -- argument. scanr1 :: () => (a -> a -> a) -> [a] -> [a] -- | scanr is the right-to-left dual of scanl. Note that -- --
-- head (scanr f z xs) == foldr f z xs. --scanr :: () => (a -> b -> b) -> b -> [a] -> [b] -- | scanl1 is a variant of scanl that has no starting value -- argument: -- --
-- scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] --scanl1 :: () => (a -> a -> a) -> [a] -> [a] -- | scanl is similar to foldl, but returns a list of -- successive reduced values from the left: -- --
-- scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...] ---- -- Note that -- --
-- last (scanl f z xs) == foldl f z xs. --scanl :: () => (b -> a -> b) -> b -> [a] -> [b] -- | Return all the elements of a list except the last one. The list must -- be non-empty. init :: () => [a] -> [a] -- | Extract the last element of a list, which must be finite and -- non-empty. last :: () => [a] -> a -- | Extract the elements after the head of a list, which must be -- non-empty. tail :: () => [a] -> [a] -- | Extract the first element of a list, which must be non-empty. head :: () => [a] -> a -- | The mapMaybe function is a version of map which can -- throw out elements. In particular, the functional argument returns -- something of type Maybe b. If this is Nothing, -- no element is added on to the result list. If it is Just -- b, then b is included in the result list. -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> let readMaybeInt = readMaybe :: String -> Maybe Int -- -- >>> mapMaybe readMaybeInt ["1", "Foo", "3"] -- [1,3] -- -- >>> catMaybes $ map readMaybeInt ["1", "Foo", "3"] -- [1,3] ---- -- If we map the Just constructor, the entire list should be -- returned: -- --
-- >>> mapMaybe Just [1,2,3] -- [1,2,3] --mapMaybe :: () => (a -> Maybe b) -> [a] -> [b] -- | The catMaybes function takes a list of Maybes and -- returns a list of all the Just values. -- --
-- >>> catMaybes [Just 1, Nothing, Just 3] -- [1,3] ---- -- When constructing a list of Maybe values, catMaybes can -- be used to return all of the "success" results (if the list is the -- result of a map, then mapMaybe would be more -- appropriate): -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] -- [Just 1,Nothing,Just 3] -- -- >>> catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ] -- [1,3] --catMaybes :: () => [Maybe a] -> [a] -- | The listToMaybe function returns Nothing on an empty -- list or Just a where a is the first element -- of the list. -- --
-- >>> listToMaybe [] -- Nothing ---- --
-- >>> listToMaybe [9] -- Just 9 ---- --
-- >>> listToMaybe [1,2,3] -- Just 1 ---- -- Composing maybeToList with listToMaybe should be the -- identity on singleton/empty lists: -- --
-- >>> maybeToList $ listToMaybe [5] -- [5] -- -- >>> maybeToList $ listToMaybe [] -- [] ---- -- But not on lists with more than one element: -- --
-- >>> maybeToList $ listToMaybe [1,2,3] -- [1] --listToMaybe :: () => [a] -> Maybe a -- | The maybeToList function returns an empty list when given -- Nothing or a singleton list when not given Nothing. -- --
-- >>> maybeToList (Just 7) -- [7] ---- --
-- >>> maybeToList Nothing -- [] ---- -- One can use maybeToList to avoid pattern matching when combined -- with a function that (safely) works on lists: -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> sum $ maybeToList (readMaybe "3") -- 3 -- -- >>> sum $ maybeToList (readMaybe "") -- 0 --maybeToList :: () => Maybe a -> [a] -- | The fromMaybe function takes a default value and and -- Maybe value. If the Maybe is Nothing, it returns -- the default values; otherwise, it returns the value contained in the -- Maybe. -- --
-- >>> fromMaybe "" (Just "Hello, World!") -- "Hello, World!" ---- --
-- >>> fromMaybe "" Nothing -- "" ---- -- Read an integer from a string using readMaybe. If we fail to -- parse an integer, we want to return 0 by default: -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> fromMaybe 0 (readMaybe "5") -- 5 -- -- >>> fromMaybe 0 (readMaybe "") -- 0 --fromMaybe :: () => a -> Maybe a -> a -- | The fromJust function extracts the element out of a Just -- and throws an error if its argument is Nothing. -- --
-- >>> fromJust (Just 1) -- 1 ---- --
-- >>> 2 * (fromJust (Just 10)) -- 20 ---- --
-- >>> 2 * (fromJust Nothing) -- *** Exception: Maybe.fromJust: Nothing --fromJust :: () => Maybe a -> a -- | The isNothing function returns True iff its argument is -- Nothing. -- --
-- >>> isNothing (Just 3) -- False ---- --
-- >>> isNothing (Just ()) -- False ---- --
-- >>> isNothing Nothing -- True ---- -- Only the outer constructor is taken into consideration: -- --
-- >>> isNothing (Just Nothing) -- False --isNothing :: () => Maybe a -> Bool -- | The isJust function returns True iff its argument is of -- the form Just _. -- --
-- >>> isJust (Just 3) -- True ---- --
-- >>> isJust (Just ()) -- True ---- --
-- >>> isJust Nothing -- False ---- -- Only the outer constructor is taken into consideration: -- --
-- >>> isJust (Just Nothing) -- True --isJust :: () => Maybe a -> Bool -- | The maybe function takes a default value, a function, and a -- Maybe value. If the Maybe value is Nothing, the -- function returns the default value. Otherwise, it applies the function -- to the value inside the Just and returns the result. -- --
-- >>> maybe False odd (Just 3) -- True ---- --
-- >>> maybe False odd Nothing -- False ---- -- Read an integer from a string using readMaybe. If we succeed, -- return twice the integer; that is, apply (*2) to it. If -- instead we fail to parse an integer, return 0 by default: -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> maybe 0 (*2) (readMaybe "5") -- 10 -- -- >>> maybe 0 (*2) (readMaybe "") -- 0 ---- -- Apply show to a Maybe Int. If we have Just -- n, we want to show the underlying Int n. But if -- we have Nothing, we return the empty string instead of (for -- example) "Nothing": -- --
-- >>> maybe "" show (Just 5) -- "5" -- -- >>> maybe "" show Nothing -- "" --maybe :: () => b -> (a -> b) -> Maybe a -> b -- | uncurry converts a curried function to a function on pairs. -- --
-- >>> uncurry (+) (1,2) -- 3 ---- --
-- >>> uncurry ($) (show, 1) -- "1" ---- --
-- >>> map (uncurry max) [(1,2), (3,4), (6,8)] -- [2,4,8] --uncurry :: () => (a -> b -> c) -> (a, b) -> c -- | curry converts an uncurried function to a curried function. -- --
-- >>> curry fst 1 2 -- 1 --curry :: () => ((a, b) -> c) -> a -> b -> c -- | the same as flip (-). -- -- Because - is treated specially in the Haskell grammar, -- (- e) is not a section, but an application of -- prefix negation. However, (subtract -- exp) is equivalent to the disallowed section. subtract :: Num a => a -> a -> a -- | asTypeOf is a type-restricted version of const. It is -- usually used as an infix operator, and its typing forces its first -- argument (which is usually overloaded) to have the same type as the -- second. asTypeOf :: () => a -> a -> a -- | until p f yields the result of applying f -- until p holds. until :: () => (a -> Bool) -> (a -> a) -> a -> a -- | Strict (call-by-value) application operator. It takes a function and -- an argument, evaluates the argument to weak head normal form (WHNF), -- then calls the function with that value. ($!) :: () => (a -> b) -> a -> b infixr 0 $! -- | flip f takes its (first) two arguments in the reverse -- order of f. -- --
-- >>> flip (++) "hello" "world" -- "worldhello" --flip :: () => (a -> b -> c) -> b -> a -> c -- | Function composition. (.) :: () => (b -> c) -> (a -> b) -> a -> c infixr 9 . -- | const x is a unary function which evaluates to x for -- all inputs. -- --
-- >>> const 42 "hello" -- 42 ---- --
-- >>> map (const 42) [0..3] -- [42,42,42,42] --const :: () => a -> b -> a -- | Identity function. -- --
-- id x = x --id :: () => a -> a -- | In many situations, the liftM operations can be replaced by -- uses of ap, which promotes function application. -- --
-- return f `ap` x1 `ap` ... `ap` xn ---- -- is equivalent to -- --
-- liftMn f x1 x2 ... xn --ap :: Monad m => m (a -> b) -> m a -> m b -- | Promote a function to a monad, scanning the monadic arguments from -- left to right (cf. liftM2). liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r -- | Promote a function to a monad, scanning the monadic arguments from -- left to right (cf. liftM2). liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r -- | Promote a function to a monad, scanning the monadic arguments from -- left to right (cf. liftM2). liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r -- | Promote a function to a monad, scanning the monadic arguments from -- left to right. For example, -- --
-- liftM2 (+) [0,1] [0,2] = [0,2,1,3] -- liftM2 (+) (Just 1) Nothing = Nothing --liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r -- | Promote a function to a monad. liftM :: Monad m => (a1 -> r) -> m a1 -> m r -- | Conditional execution of Applicative expressions. For example, -- --
-- when debug (putStrLn "Debugging") ---- -- will output the string Debugging if the Boolean value -- debug is True, and otherwise do nothing. when :: Applicative f => Bool -> f () -> f () -- | Same as >>=, but with the arguments interchanged. (=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 =<< -- | Lift a ternary function to actions. liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d -- | Lift a function to actions. This function may be used as a value for -- fmap in a Functor instance. liftA :: Applicative f => (a -> b) -> f a -> f b -- | A variant of <*> with the arguments reversed. (<**>) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 <**> -- | A special case of error. It is expected that compilers will -- recognize this and insert error messages which are more appropriate to -- the context in which undefined appears. undefined :: HasCallStack => a -- | A variant of error that does not produce a stack trace. errorWithoutStackTrace :: () => [Char] -> a -- | error stops execution and displays an error message. error :: HasCallStack => [Char] -> 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) stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a -- | The SomeException type is the root of the exception type -- hierarchy. When an exception of type e is thrown, behind the -- scenes it is encapsulated in a SomeException. data SomeException -- | Boolean "and" (&&) :: Bool -> Bool -> Bool infixr 3 && -- | Boolean "or" (||) :: Bool -> Bool -> Bool infixr 2 || -- | Boolean "not" not :: Bool -> Bool -- | A set of values a. data Set a -- | The inverse of ExceptT. runExceptT :: () => ExceptT e m a -> m (Either e a) -- | A monad transformer that adds exceptions to other monads. -- -- ExceptT constructs a monad parameterized over two things: -- --
-- bimapT id id ≡ id ---- -- If you supply first and second, ensure: -- --
-- firstT id ≡ id -- secondT id ≡ id ---- -- If you supply both, you should also ensure: -- --
-- bimapT f g ≡ firstT f . secondT g ---- -- These ensure by parametricity: -- --
-- bimapT (f . g) (h . i) ≡ bimapT f h . bimapT g i -- firstT (f . g) ≡ firstT f . firstT g -- secondT (f . g) ≡ secondT f . secondT g --class BifunctorTrans (t :: Type -> Type -> Type -> Type -> Type) -- | Map over both arguments at the same time. -- --
-- bimap f g ≡ first f . second g --bimapT :: (BifunctorTrans t, Functor f) => (x -> y) -> (a -> b) -> t x f a -> t y f b -- | Map covariantly over the first argument. -- --
-- firstT f ≡ bimapT f id --firstT :: (BifunctorTrans t, Functor f) => (x -> y) -> t x f a -> t y f a -- | Map covariantly over the second argument. -- --
-- second ≡ bimap id --secondT :: (BifunctorTrans t, Functor f) => (a -> b) -> t x f a -> t x f b hoistEither :: Monad m => Either x a -> ExceptT x m a hoistMaybe :: Monad m => x -> Maybe a -> ExceptT x m a joinEither :: Either (Either a b) (Either a b) -> Either a b syncIO :: MonadIO m => IO a -> ExceptT SomeException m a -- | All strings within templates are processed by a common Packer -- templating engine, where variables and functions can be used to modify -- the value of a configuration parameter at runtime. module Kerry.Engine newtype Template Template :: Text -> Template [renderTemplate] :: Template -> Text data RawTemplate toTemplate :: RawTemplate -> Template renderRawTemplate :: RawTemplate -> Text -- | User variables user :: Text -> RawTemplate -- | Template variables are special variables automatically set by Packer -- at build time. Some builders, provisioners and other components have -- template variables that are available only for that component. -- Template variables are recognizable because they're prefixed by a -- period, such as {{ .Name }}. templateVariable :: Text -> Template -- | The name of the build being run. buildName :: RawTemplate -- | The type of the builder being used currently. buildType :: RawTemplate -- | Returns environment variables. See example in using home variable env :: Text -> RawTemplate -- | UTC time, which can be formatted. See more examples below in the -- isotime format reference. isotime :: Text -> RawTemplate -- | Lowercases the string. lower :: RawTemplate -- | The working directory while executing Packer. pwd :: RawTemplate -- | Use a golang implementation of sed to parse an input string. sed :: Text -> Text -> RawTemplate -- | Split an input string using separator and return the requested -- substring. split :: Text -> Text -> Int -> RawTemplate -- | The directory to the template for the build. templateDir :: RawTemplate -- | The current Unix timestamp in UTC. timestamp :: RawTemplate -- | Returns a random UUID. uuid :: RawTemplate -- | Uppercases the string. upper :: RawTemplate -- | Returns Packer version. packerVersion :: RawTemplate -- | Image names can only contain certain characters and have a maximum -- length, eg 63 on GCE & 80 on Azure. clean_resource_name will -- convert upper cases to lower cases and replace illegal characters with -- a "-" character. cleanResourceName :: RawTemplate instance GHC.Show.Show Kerry.Engine.RawTemplate instance GHC.Classes.Eq Kerry.Engine.RawTemplate instance GHC.Show.Show Kerry.Engine.Template instance GHC.Classes.Eq Kerry.Engine.Template module Kerry.Internal.Serial list :: [a] -> Maybe [a] listToObject :: [Pair] -> Value (.=?) :: ToJSON a => Text -> Maybe a -> [(Text, Value)] fromMap :: Map Text Text -> Value fromMapWith :: (a -> Value) -> Map Text a -> Value t :: Text -> Text asTextWith :: (a -> Value) -> a -> Text asByteStringWith :: (a -> Value) -> a -> ByteString prettyAsTextWith :: (a -> Value) -> a -> Text prettyAsByteStringWith :: (a -> Value) -> a -> ByteString module Kerry.Builder.AmazonEC2 data Credentials AWSProfile :: Text -> Credentials EnvironmentVariables :: Credentials data AWS x AWS :: Text -> Credentials -> x -> AWS x [awsRegion] :: AWS x -> Text [awsCredentials] :: AWS x -> Credentials [awsBuilder] :: AWS x -> x fromAWS :: (a -> [Pair]) -> AWS a -> [Pair] data SourceAmi SourceAmiId :: Text -> SourceAmi SourceAmiFilter :: Map SourceAmiFilterKey Text -> AWSAmiOwner -> Bool -> SourceAmi data AWSAmiOwner Accounts :: [Text] -> AWSAmiOwner Self :: AWSAmiOwner Alias :: Text -> AWSAmiOwner data SourceAmiFilterKey -- | The image architecture (i386 | x86_64). Architecture :: SourceAmiFilterKey -- | A Boolean value that indicates whether the Amazon EBS volume is -- deleted on instance termination. BlockDeviceMappingDeleteOnTermination :: SourceAmiFilterKey -- | The device name specified in the block device mapping (for example, -- devsdh or xvdh).rmination BlockDeviceMappingDeviceName :: SourceAmiFilterKey -- | The ID of the snapshot used for the EBS volume. BlockDeviceMappingSnapshotId :: SourceAmiFilterKey -- | The volume size of the EBS volume, in GiB. BlockDeviceMappingVolumeSize :: SourceAmiFilterKey -- | The volume type of the EBS volume (gp2 | io1 | st1 | sc1 | standard). BlockDeviceMappingVolumeType :: SourceAmiFilterKey -- | A Boolean that indicates whether the EBS volume is encrypted.e BlockDevice :: SourceAmiFilterKey -- | The description of the image (provided during image -- creation).-mapping.encrypted Description :: SourceAmiFilterKey -- | A Boolean that indicates whether enhanced networking with ENA is -- enabled. EnaSupport :: SourceAmiFilterKey -- | The hypervisor type (ovm | xen). Hypervisor :: SourceAmiFilterKey -- | The ID of the image.r ImageId :: SourceAmiFilterKey -- | The image type (machine | kernel | ramdisk). ImageType :: SourceAmiFilterKey -- | A Boolean that indicates whether the image is public. IsPublic :: SourceAmiFilterKey -- | The kernel ID. KernelId :: SourceAmiFilterKey -- | The location of the image manifest. ManifestLocation :: SourceAmiFilterKey -- | The name of the AMI (provided during image creation).est-location Name :: SourceAmiFilterKey -- | String value from an Amazon-maintained list (amazon | aws-marketplace -- | microsoft) of snapshot owners. Not to be confused with the -- user-configured AWS account alias, which is set from the IAM console. OwnerAlias :: SourceAmiFilterKey -- | The AWS account ID of the image owner.as OwnerId :: SourceAmiFilterKey -- | The platform. To only list Windows-based AMIs, use windows. Platform :: SourceAmiFilterKey -- | The product code. ProductCode :: SourceAmiFilterKey -- | The type of the product code (devpay | marketplace). ProductCodeType :: SourceAmiFilterKey -- | The RAM disk ID RamdiskId :: SourceAmiFilterKey -- | The device name of the root device volume (for example, -- devsda1). RootDeviceName :: SourceAmiFilterKey -- | The type of the root device volume (ebs | instance-store). RootDeviceType :: SourceAmiFilterKey -- | The state of the image (available | pending | failed).evice-type State :: SourceAmiFilterKey -- | The reason code for the state change. StateReasonCode :: SourceAmiFilterKey -- | The message for the state change. StateReasonMessage :: SourceAmiFilterKey -- | A value of simple indicates that enhanced networking with the Intel -- 82599 VF interface is enabled.ge SriovNetSupport :: SourceAmiFilterKey -- | The key/value combination of a tag assigned to the resource. Use the -- tag key in the filter name and the tag value as the filter value. For -- example, to find all resources that have a tag with the key Owner and -- the value TeamA, specify tag:Owner for the filter name and TeamA for -- the filter value.support Tag :: Text -> SourceAmiFilterKey -- | The key of a tag assigned to the resource. Use this filter to find all -- resources assigned a tag with a specific key, regardless of the tag -- value.> TagKey :: SourceAmiFilterKey -- | The virtualization type (paravirtual | hvm). VirtualizationType :: SourceAmiFilterKey data BlockDeviceMapping BlockDeviceMapping :: Text -> Text -> Maybe Int -> Int -> Bool -> Bool -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> BlockDeviceMapping -- | The device name exposed to the instance (for example, devsdh or -- xvdh). Required for every device in the block device mapping. [blockDeviceMappingName] :: BlockDeviceMapping -> Text -- | The volume type. gp2 for General Purpose (SSD) volumes, io1 for -- Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes [blockDeviceMappingVolumeType] :: BlockDeviceMapping -> Text -- | The number of I/O operations per second (IOPS) that the volume -- supports. See the documentation on IOPs for more information [blockDeviceMappingIOPS] :: BlockDeviceMapping -> Maybe Int -- | The size of the volume, in GiB. Required if not specifying a -- snapshot_id [blockDeviceMappingVolumeSize] :: BlockDeviceMapping -> Int -- | Indicates whether the EBS volume is deleted on instance termination. -- Default false. NOTE: If this value is not explicitly set to true and -- volumes are not cleaned up by an alternative method, additional -- volumes will accumulate after every build. [blockDeviceMappingDeleteOnTermination] :: BlockDeviceMapping -> Bool -- | Indicates whether or not to encrypt the volume. By default, Packer -- will keep the encryption setting to what it was in the source image. -- Setting false will result in an unencrypted device, and true will -- result in an encrypted one. [blockDeviceMappingEncrypted] :: BlockDeviceMapping -> Bool -- | KMS Key ID to use when encrytped is set to True. [blockDeviceMappingKMS] :: BlockDeviceMapping -> Maybe Text -- | The ID of the snapshot [blockDeviceMappingSnapshotId] :: BlockDeviceMapping -> Maybe Text -- | Suppresses the specified device included in the block device mapping -- of the AMI [blockDeviceMappingVirtualName] :: BlockDeviceMapping -> Maybe Text -- | The virtual device name. See the documentation on Block Device Mapping -- for more information [blockDeviceMappingNoDevice] :: BlockDeviceMapping -> Maybe Bool -- | Construct a basic BlockDeviceMapping blockDeviceMapping :: Text -> Text -> Int -> Bool -> BlockDeviceMapping -- | Amazon AMI Builder -- -- Create EBS-backed AMIs by launching a source AMI and re-packaging it -- into a new AMI after provisioning. If in doubt, use this builder, -- which is the easiest to get started with. -- -- https://www.packer.io/docs/builders/amazon-ebs.html -- -- 'amazon-ebs' data EBS EBS :: Text -> SourceAmi -> Text -> Maybe Text -> Maybe [Text] -> Maybe [Text] -> Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Bool -> [BlockDeviceMapping] -> Map Text Text -> Maybe Text -> Map Text Text -> Maybe Text -> EBS -- | ami_name [ebsAmiName] :: EBS -> Text -- | source_ami [ebsSourceAmi] :: EBS -> SourceAmi -- | instance_type [ebsInstanceType] :: EBS -> Text -- | ami_description ami_groups ami_product_codes [ebsAmiDescription] :: EBS -> Maybe Text -- | ami_regions [ebsAmiRegions] :: EBS -> Maybe [Text] -- | ami_users ami_virtualization_type [ebsAmiUsers] :: EBS -> Maybe [Text] -- | associate_public_ip_address [ebsAssociatePublicIpAddress] :: EBS -> Maybe Bool -- | availability_zone block_duration_minutes custom_endpoint_ec2 -- decode_authorization_messages disable_stop_instance ebs_optimized -- ena_support enable_t2_unlimited encrypt_boot kms_key_id -- force_delete_snapshot force_deregister [ebsAvailabilityZone] :: EBS -> Maybe Text -- | iam_instance_profile [ebsIAMInstanceProfile] :: EBS -> Maybe Text -- | insecure_skip_tls_verify [ebsInsecureSkipTLSVerify] :: EBS -> Maybe Bool -- | launch_block_device_mappings mfa_code profile region_kms_key_ids [ebsLaunchBlockDeviceMappings] :: EBS -> [BlockDeviceMapping] -- | run_tags run_volume_tags security_group_id security_group_ids -- security_group_filter shutdown_behavior skip_region_validation -- snapshot_groups snapshot_users snapshot_tags spot_price -- spot_price_auto_product spot_tags sriov_support ssh_keypair_name -- ssh_agent_auth ssh_interface [ebsRunTags] :: EBS -> Map Text Text -- | subnet_id subnet_filter - -- https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html [ebsSubnetId] :: EBS -> Maybe Text -- | tags temporary_key_pair_name temporary_security_group_source_cidrs -- token user_data user_data_file vault_aws_engine [ebsTags] :: EBS -> Map Text Text -- | vpc_id vpc_filter - -- https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html -- windows_password_timeout [ebsVpcId] :: EBS -> Maybe Text -- | Construct a basic amazon-ebs builder. ebs :: Text -> SourceAmi -> Text -> EBS -- | EBS serialization fromEBS :: EBS -> [Pair] instance GHC.Show.Show Kerry.Builder.AmazonEC2.EBS instance GHC.Classes.Eq Kerry.Builder.AmazonEC2.EBS instance GHC.Show.Show Kerry.Builder.AmazonEC2.BlockDeviceMapping instance GHC.Classes.Eq Kerry.Builder.AmazonEC2.BlockDeviceMapping instance GHC.Show.Show Kerry.Builder.AmazonEC2.SourceAmi instance GHC.Classes.Eq Kerry.Builder.AmazonEC2.SourceAmi instance GHC.Show.Show Kerry.Builder.AmazonEC2.SourceAmiFilterKey instance GHC.Classes.Eq Kerry.Builder.AmazonEC2.SourceAmiFilterKey instance GHC.Show.Show Kerry.Builder.AmazonEC2.AWSAmiOwner instance GHC.Classes.Eq Kerry.Builder.AmazonEC2.AWSAmiOwner instance GHC.Show.Show x => GHC.Show.Show (Kerry.Builder.AmazonEC2.AWS x) instance GHC.Classes.Eq x => GHC.Classes.Eq (Kerry.Builder.AmazonEC2.AWS x) instance GHC.Show.Show Kerry.Builder.AmazonEC2.Credentials instance GHC.Classes.Eq Kerry.Builder.AmazonEC2.Credentials module Kerry.Provisioner.File data File File :: FilePath -> FilePath -> FileDirection -> Maybe Bool -> File -- | The path to a local file or directory to upload to the machine. The -- path can be absolute or relative. If it is relative, it is relative to -- the working directory when Packer is executed. If this is a directory, -- the existence of a trailing slash is important. Read below on -- uploading directories. [fileSource] :: File -> FilePath -- | The path where the file will be uploaded to in the machine. This value -- must be a writable location and any parent directories must already -- exist. If the provisioning user (generally not root) cannot write to -- this directory, you will receive a "Permission Denied" error. If the -- source is a file, it's a good idea to make the destination a file as -- well, but if you set your destination as a directory, at least make -- sure that the destination ends in a trailing slash so that Packer -- knows to use the source's basename in the final upload path. Failure -- to do so may cause Packer to fail on file uploads. If the destination -- file already exists, it will be overwritten. [fileDestination] :: File -> FilePath -- | The direction of the file transfer. This defaults to "upload". If it -- is set to "download" then the file "source" in the machine will be -- downloaded locally to "destination" [fileDirection] :: File -> FileDirection -- | For advanced users only. If true, check the file existence only before -- uploading, rather than upon pre-build validation. This allows to -- upload files created on-the-fly. This defaults to false. We don't -- recommend using this feature, since it can cause Packer to become -- dependent on system state. We would prefer you generate your files -- before the Packer run, but realize that there are situations where -- this may be unavoidable. [fileGenerated] :: File -> Maybe Bool -- | FileDirection data FileDirection FileUpload :: FileDirection FileDownload :: FileDirection fromFile :: File -> [Pair] instance GHC.Show.Show Kerry.Provisioner.File.File instance GHC.Classes.Eq Kerry.Provisioner.File.File instance GHC.Show.Show Kerry.Provisioner.File.FileDirection instance GHC.Classes.Eq Kerry.Provisioner.File.FileDirection module Kerry.Provisioner.Shell -- | The shell Packer provisioner provisions machines built by Packer using -- shell scripts. Shell provisioning is the easiest way to get software -- installed and configured on a machine. data Shell Shell :: ShellType -> Maybe Bool -> Maybe [Int] -> Maybe [Text] -> Maybe Bool -> Maybe Text -> Maybe Bool -> Maybe Text -> Maybe FilePath -> Maybe Text -> Maybe FilePath -> Maybe Bool -> Maybe Text -> Maybe Text -> Shell [shellType] :: Shell -> ShellType -- | If true, specifies that the script(s) are binary files, and Packer -- should therefore not convert Windows line endings to Unix line endings -- (if there are any). By default this is false. [shellBinary] :: Shell -> Maybe Bool -- | Valid exit codes for the script. By default this is just 0. [shellValidExitCodes] :: Shell -> Maybe [Int] -- | An array of key/value pairs to inject prior to the execute_command. -- The format should be key=value. Packer injects some environmental -- variables by default into the environment, as well, which are covered -- in the section below. [shellEnvironmentVars] :: Shell -> Maybe [Text] -- | If true, Packer will write your environment variables to a tempfile -- and source them from that file, rather than declaring them inline in -- our execute_command. The default execute_command will be chmod +x -- {{.Path}}; . {{.EnvVarFile}} && {{.Path}}. This option is -- unnecessary for most cases, but if you have extra quoting in your -- custom execute_command, then this may be unnecessary for proper script -- execution. Default: false. [shellUseEnvVarFile] :: Shell -> Maybe Bool -- | The command to use to execute the script. By default this is chmod +x -- {{ .Path }}; {{ .Vars }} {{ .Path }}, unless the user has set -- "use_env_var_file": true -- in that case, the default execute_command -- is chmod +x {{.Path}}; . {{.EnvVarFile}} && {{.Path}}. The -- value of this is treated as a configuration template. There are three -- available variables: -- -- Path is the path to the script to run Vars is the list of -- environment_vars, if configured. EnvVarFile is the path to the file -- containing env vars, if use_env_var_file is true. [shellExecuteCommand] :: Shell -> Maybe Text -- | Defaults to false. Whether to error if the server disconnects us. A -- disconnect might happen if you restart the ssh server or reboot the -- host. [shellExpectDisconnect] :: Shell -> Maybe Bool -- | The shebang value to use when running commands specified by inline. By -- default, this is binsh -e. If you're not using inline, then -- this configuration has no effect. Important: If you customize this, be -- sure to include something like the -e flag, otherwise individual steps -- failing won't fail the provisioner. [shellInlineShebang] :: Shell -> Maybe Text -- | The folder where the uploaded script will reside on the machine. This -- defaults to '/tmp'. [shellRemoteFolder] :: Shell -> Maybe FilePath -- | The filename the uploaded script will have on the machine. This -- defaults to 'script_nnn.sh'. [shellRemoteFile] :: Shell -> Maybe Text -- | The full path to the uploaded script will have on the machine. By -- default this is remote_folder/remote_file, if set this option will -- override both remote_folder and remote_file. [shellRemotePath] :: Shell -> Maybe FilePath -- | If true, specifies that the helper scripts uploaded to the system will -- not be removed by Packer. This defaults to false (clean scripts from -- the system). [shellSkipClean] :: Shell -> Maybe Bool -- | The amount of time to attempt to start the remote process. By default -- this is 5m or 5 minutes. This setting exists in order to deal with -- times when SSH may restart, such as a system reboot. Set this to a -- higher value if reboots take a longer amount of time. [shellStartRetryTimeout] :: Shell -> Maybe Text -- | Wait the amount of time after provisioning a shell script, this pause -- be taken if all previous steps were successful. [shellPauseAfter] :: Shell -> Maybe Text -- | Basic Shell shell :: ShellType -> Shell -- | ShellType data ShellType Inline :: [Text] -> ShellType Script :: Text -> ShellType Scripts :: [Text] -> ShellType -- | Shell serialization fromShell :: Shell -> [Pair] instance GHC.Show.Show Kerry.Provisioner.Shell.Shell instance GHC.Classes.Eq Kerry.Provisioner.Shell.Shell instance GHC.Show.Show Kerry.Provisioner.Shell.ShellType instance GHC.Classes.Eq Kerry.Provisioner.Shell.ShellType module Kerry.Packer -- | Packer -- -- A concrete representation for configuring the various components of -- Packer. data Packer Packer :: [UserVariable] -> [Builder] -> [Provisioner] -> [PostProcessor] -> Packer [variables] :: Packer -> [UserVariable] [builders] :: Packer -> [Builder] [provisioners] :: Packer -> [Provisioner] [postProcessors] :: Packer -> [PostProcessor] data UserVariable UserVariable :: Text -> Text -> UserVariable -- | Builders -- -- See the following for more information - -- https://www.packer.io/docs/templates/builders.html - -- https://www.packer.io/docs/builders/index.html data Builder Builder :: BuilderType -> Maybe Text -> Communicator -> Builder [builderType] :: Builder -> BuilderType [builderName] :: Builder -> Maybe Text [builderCommunicator] :: Builder -> Communicator -- | Concrete BuilderType data BuilderType AmazonEBSBuilder :: AWS EBS -> BuilderType -- | Provisioner -- -- See the following for more information: - -- https://www.packer.io/docs/templates/provisioners.html - -- https://www.packer.io/docs/provisioners/index.html data Provisioner Provisioner :: ProvisionerType -> [Text] -> [Text] -> Maybe Text -> Maybe Text -> Maybe (Map Text (Map Text Text)) -> Provisioner [provisionerType] :: Provisioner -> ProvisionerType [provisionerOnly] :: Provisioner -> [Text] [provisionerExcept] :: Provisioner -> [Text] [provisionerPauseBefore] :: Provisioner -> Maybe Text [provisionerTimeout] :: Provisioner -> Maybe Text [provisionerOverride] :: Provisioner -> Maybe (Map Text (Map Text Text)) -- | Basic Provisioner provisioner :: ProvisionerType -> Provisioner -- | Concrete ProvisionerType data ProvisionerType ShellProvisioner :: Shell -> ProvisionerType FileProvisioner :: File -> ProvisionerType data PostProcessor PostProcessor :: PostProcessor -- | Communicator -- -- See the following for more information: - -- https://www.packer.io/docs/templates/communicator.html - -- https://www.packer.io/docs/provisioners/index.html data Communicator -- | No communicator will be used. If this is set, most provisioners also -- can't be used. None :: Communicator -- | An SSH connection will be established to the machine. This is usually -- the default. SSH :: SSHCommunicator -> Communicator -- | A WinRM connection will be established. WinRm :: Communicator -- | ssh communicator -- -- https://www.packer.io/docs/templates/communicator.html#ssh data SSHCommunicator SSHCommunicator :: Text -> Bool -> Int -> SSHCommunicator -- | ssh_username - The username to connect to SSH with. Required -- if using SSH. [sshUsername] :: SSHCommunicator -> Text -- | ssh_pty - If true, a PTY will be requested for the SSH -- connection. This defaults to false. [sshPty] :: SSHCommunicator -> Bool -- | ssh_timeout (string) - The time to wait for SSH to become -- available. Packer uses this to determine when the machine has booted -- so this is usually quite long. Example value: 10. -- ssh_agent_auth (boolean) - If true, the local SSH agent will -- be used to authenticate connections to the remote host. Defaults to -- false. ssh_bastion_agent_auth (boolean) - If true, the local -- SSH agent will be used to authenticate with the bastion host. Defaults -- to false. ssh_bastion_host (string) - A bastion host to use -- for the actual SSH connection. ssh_bastion_password (string) -- - The password to use to authenticate with the bastion host. -- ssh_bastion_port (number) - The port of the bastion host. -- Defaults to 22. ssh_bastion_private_key_file (string) - Path -- to a PEM encoded private key file to use to authenticate with the -- bastion host. The ~ can be used in path and will be expanded to the -- home directory of current user. ssh_bastion_username (string) -- - The username to connect to the bastion host. -- ssh_clear_authorized_keys (boolean) - If true, Packer will -- attempt to remove its temporary key from ~.sshauthorized_keys -- and root.ssh/authorized_keys. This is a mostly cosmetic option, -- since Packer will delete the temporary private key from the host -- system regardless of whether this is set to true (unless the user has -- set the -debug flag). Defaults to "false"; currently only works on -- guests with sed installed. ssh_disable_agent_forwarding -- (boolean) - If true, SSH agent forwarding will be disabled. Defaults -- to false. ssh_file_transfer_method (scp or sftp) - How to -- transfer files, Secure copy (default) or SSH File Transfer Protocol. -- ssh_handshake_attempts (number) - The number of handshakes to -- attempt with SSH once it can connect. This defaults to 10. -- ssh_host (string) - The address to SSH to. This usually is -- automatically configured by the builder. -- ssh_keep_alive_interval (string) - How often to send "keep -- alive" messages to the server. Set to a negative value (-1s) to -- disable. Example value: 10s. Defaults to 5s. ssh_password -- (string) - A plaintext password to use to authenticate with SSH. -- ssh_port (number) - The port to connect to SSH. This defaults -- to 22. ssh_private_key_file (string) - Path to a PEM encoded -- private key file to use to authenticate with SSH. The ~ can be used in -- path and will be expanded to the home directory of current user. -- ssh_proxy_host (string) - A SOCKS proxy host to use for SSH -- connection ssh_proxy_password (string) - The password to use -- to authenticate with the proxy server. Optional. -- ssh_proxy_port (number) - A port of the SOCKS proxy. Defaults -- to 1080. ssh_proxy_username (string) - The username to -- authenticate with the proxy server. Optional. -- ssh_read_write_timeout (string) - The amount of time to wait -- for a remote command to end. This might be useful if, for example, -- packer hangs on a connection after a reboot. Example: 5m. Disabled by -- default. [sshTimeout] :: SSHCommunicator -> Int -- | A minimal default ssh communicator where only the -- username needs to be specified defaultSSHCommunicator :: Text -> SSHCommunicator -- | Render an Packer to Text renderPacker :: Packer -> Text -- | Packer serialization fromPacker :: Packer -> Value -- | Builder serialization fromBuilder :: Builder -> Value -- | BuilderType serialization fromBuilderType :: BuilderType -> [Pair] -- | UserVariable serialization fromUserVariable :: UserVariable -> Pair -- | Provisioner serialization fromProvisioner :: Provisioner -> Value -- | PostProcessor serialization fromPostProcessor :: PostProcessor -> Value instance GHC.Show.Show Kerry.Packer.Packer instance GHC.Classes.Eq Kerry.Packer.Packer instance GHC.Show.Show Kerry.Packer.Builder instance GHC.Classes.Eq Kerry.Packer.Builder instance GHC.Show.Show Kerry.Packer.Communicator instance GHC.Classes.Eq Kerry.Packer.Communicator instance GHC.Show.Show Kerry.Packer.SSHCommunicator instance GHC.Classes.Eq Kerry.Packer.SSHCommunicator instance GHC.Show.Show Kerry.Packer.PostProcessor instance GHC.Classes.Eq Kerry.Packer.PostProcessor instance GHC.Show.Show Kerry.Packer.Provisioner instance GHC.Classes.Eq Kerry.Packer.Provisioner instance GHC.Show.Show Kerry.Packer.ProvisionerType instance GHC.Classes.Eq Kerry.Packer.ProvisionerType instance GHC.Show.Show Kerry.Packer.BuilderType instance GHC.Classes.Eq Kerry.Packer.BuilderType instance GHC.Show.Show Kerry.Packer.UserVariable instance GHC.Classes.Eq Kerry.Packer.UserVariable module Kerry -- | Packer -- -- A concrete representation for configuring the various components of -- Packer. data Packer Packer :: [UserVariable] -> [Builder] -> [Provisioner] -> [PostProcessor] -> Packer [variables] :: Packer -> [UserVariable] [builders] :: Packer -> [Builder] [provisioners] :: Packer -> [Provisioner] [postProcessors] :: Packer -> [PostProcessor] -- | Render an Packer to Text renderPacker :: Packer -> Text data UserVariable UserVariable :: Text -> Text -> UserVariable -- | Builders -- -- See the following for more information - -- https://www.packer.io/docs/templates/builders.html - -- https://www.packer.io/docs/builders/index.html data Builder Builder :: BuilderType -> Maybe Text -> Communicator -> Builder [builderType] :: Builder -> BuilderType [builderName] :: Builder -> Maybe Text [builderCommunicator] :: Builder -> Communicator -- | Concrete BuilderType data BuilderType AmazonEBSBuilder :: AWS EBS -> BuilderType -- | Communicator -- -- See the following for more information: - -- https://www.packer.io/docs/templates/communicator.html - -- https://www.packer.io/docs/provisioners/index.html data Communicator -- | No communicator will be used. If this is set, most provisioners also -- can't be used. None :: Communicator -- | An SSH connection will be established to the machine. This is usually -- the default. SSH :: SSHCommunicator -> Communicator -- | A WinRM connection will be established. WinRm :: Communicator -- | A minimal default ssh communicator where only the -- username needs to be specified defaultSSHCommunicator :: Text -> SSHCommunicator -- | Provisioner -- -- See the following for more information: - -- https://www.packer.io/docs/templates/provisioners.html - -- https://www.packer.io/docs/provisioners/index.html data Provisioner Provisioner :: ProvisionerType -> [Text] -> [Text] -> Maybe Text -> Maybe Text -> Maybe (Map Text (Map Text Text)) -> Provisioner [provisionerType] :: Provisioner -> ProvisionerType [provisionerOnly] :: Provisioner -> [Text] [provisionerExcept] :: Provisioner -> [Text] [provisionerPauseBefore] :: Provisioner -> Maybe Text [provisionerTimeout] :: Provisioner -> Maybe Text [provisionerOverride] :: Provisioner -> Maybe (Map Text (Map Text Text)) -- | Basic Provisioner provisioner :: ProvisionerType -> Provisioner -- | Concrete ProvisionerType data ProvisionerType ShellProvisioner :: Shell -> ProvisionerType FileProvisioner :: File -> ProvisionerType data PostProcessor PostProcessor :: PostProcessor