-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Utilities used by other packages.
--
-- An ill-defined collection of simple unrelated utilities used by other
-- packages from http://functionalley.eu
@package toolshed
@version 0.12.0.0
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION
--
--
--
-- - Provides impure functions to print & return the specified
-- value.
-- - The pure interfaces permit calls from outside the
-- IO-monad.
--
--
--
-- - TODO Review function-names.
--
module ToolShed.Unsafe
-- | A transparent print-function, for use in debugging.
print' :: Show s => s -> s
-- | A transparent print-function, which prepends the specified label, for
-- use in debugging.
printShow :: Show s => String -> s -> s
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION Determines the CPU-time, required to
-- evaluate the specified pure expression.
--
module ToolShed.TimePure
-- |
-- - Time the specified pure expression, returning the seconds and
-- result as a Pair.
-- - CAVEAT: as a side-effect, the expression is deep
-- evaluated.
--
getCPUSeconds :: (Fractional seconds, NFData expression) => expression -> IO (seconds, expression)
-- |
-- - Print the time required by the specified pure expression.
-- - CAVEAT: as a side-effect, the expression is deep
-- evaluated.
--
printCPUSeconds :: NFData expression => expression -> IO expression
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION Determines the CPU-time, required to
-- evaluate the specified IO-action.
--
module ToolShed.TimeAction
-- | Time the specified IO-action, returning the seconds and result as a
-- Pair.
getCPUSeconds :: Fractional seconds => IO result -> IO (seconds, result)
-- | Print the time required by the specified IO-action.
printCPUSeconds :: IO result -> IO result
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION A class to define the simple
-- interface, to which data which can self-validation, should
-- conform.
--
module ToolShed.SelfValidate
-- | The interface to which data which can self-validate should conform.
class SelfValidator a
isValid :: SelfValidator a => a -> Bool
instance SelfValidator a => SelfValidator [a]
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION Miscellaneous operations on
-- Pairs.
--
module ToolShed.Pair
-- | Apply the same transformation to both halves of a Pair.
mirror :: (a -> b) -> (a, a) -> (b, b)
-- | True if both halves of the Pair are.
both :: (Bool, Bool) -> Bool
-- | True if neither half of the Pair is.
neither :: (Bool, Bool) -> Bool
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION Miscellaneous polymorphic
-- list-operations.
--
module ToolShed.ListPlus
-- | The length of the chunks into which a list is split.
type ChunkLength = Int
-- |
-- - Splits a list into length-size pieces, where (size
-- >= 0).
-- - The last chunk will be shorter, if n isn't an aliquot
-- part of the input list-length.
-- - If (size == 0), the resulting list will be an infinite
-- sequence of null lists.
-- - CAVEAT: a similar function is available in the module
-- Data.List.Split, though this one checks for (size <
-- 0).
--
chunk :: ChunkLength -> [a] -> [[a]]
-- | Remove the single indexed element from the list.
excise :: Int -> [a] -> [a]
-- |
-- - Much like Data.List.GroupBy, but where the normal binary
-- predicate, is composed from equality, after the same unary
-- translation-function has been applied to both list-elements.
-- - cf. GHC.Exts.groupWith, which uses the function parameter
-- to both sort and group.
--
groupComparing :: Eq b => (a -> b) -> [a] -> [[a]]
-- | Converts a list of Pairs, into a narrower list.
linearise :: [(a, a)] -> [a]
-- |
-- - Merge two sorted lists, to product a single sorted list.
-- - The merge-process is stable, in that where items from each
-- list are equal, they remain in the original order.
--
merge :: Ord a => [a] -> [a] -> [a]
-- |
-- - Merge two sorted lists, according to the specified order, to
-- product a single sorted list.
-- - The merge-process is stable, in that where items from each
-- list are equal, they remain in the original order.
--
mergeBy :: Ord a => (a -> a -> Ordering) -> [a] -> [a] -> [a]
-- |
-- - Create the set of all Splits, migrating left from the
-- specified location.
-- - CAVEAT: init fails when fst has been reduced to
-- null.
--
splitsLeftFrom :: Int -> [a] -> [Split a]
-- |
-- - Create the set of all Splits, migrating right from the
-- specified location.
-- - CAVEAT: pattern-match against : fails, when snd
-- has been reduced to null.
--
splitsRightFrom :: Int -> [a] -> [Split a]
-- |
-- - Take until the specified predicate is satisfied; including
-- the item which satisfied it.
-- - NB: takeWhile (not . test) would return one fewer
-- item.
--
takeUntil :: (a -> Bool) -> [a] -> [a]
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION A simple interface which data-types
-- with a default-value can implement.
--
module ToolShed.Defaultable
-- | An interface to which data which have a default-value can adhere.
class Defaultable a
defaultValue :: Defaultable a => a
-- |
-- - AUTHOR Dr. Alistair Ward
-- - DESCRIPTION Defines a standard interface to which
-- various options-related data can conform.
--
module ToolShed.Options
-- | Similar to the class Text.Regex.Base.RegexLike.RegexOptions.
class Defaultable a => Options a
blankValue :: Options a => a