-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Ill-defined library. -- -- Ill-defined unrelated utilities used by other packages from -- https://functionalley.com @package toolshed @version 0.18.0.2 -- | module ToolShed.Data.Foldable -- | A specific instance of gatherBy. gather :: (Foldable foldable, Ord a) => foldable a -> [[a]] -- | gatherBy :: (Foldable foldable, Ord b) => (a -> b) -> foldable a -> [[a]] -- | hasDuplicates :: (Foldable foldable, Ord a) => foldable a -> Bool -- | module ToolShed.Data.List -- | The length of the chunks into which a list is split. type ChunkLength = Int -- | The type of function required by findConvergenceBy, -- permutationsBy. type Matches a = a -> a -> Bool -- | chunk :: ChunkLength -> [a] -> [[a]] -- | Remove the single indexed element from the list. excise :: Int -> [a] -> [a] -- | A convenient way to compose the Matches-function required by -- findConvergenceBy & permutationsBy. equalityBy :: Eq b => (a -> b) -> Matches a -- | A specific instance of findConvergenceBy. findConvergence :: Eq a => [a] -> a -- | Take the first element from the (potentially infinite) list, which -- matches the subsequent element, according to the specified function. findConvergenceBy :: Matches a -> [a] -> a -- | Interleaves the specified lists, taking the first item from the first -- list. interleave :: [a] -> [a] -> [a] -- | Converts a list of Pairs, into a narrower list. linearise :: [(a, a)] -> [a] -- | measureJaroDistance :: (Eq a, Fractional distance) => ([a], [a]) -> distance -- | A specific instance of mergeBy. merge :: Ord a => [a] -> [a] -> [a] -- | mergeBy :: (a -> a -> Ordering) -> [a] -> [a] -> [a] -- | nub' :: Ord a => [a] -> [a] -- | permutations :: [[a]] -> [[a]] -- | permutationsBy :: Matches a -> [[a]] -> [[a]] -- | takeUntil :: (a -> Bool) -> [a] -> [a] -- | Show a list, delimited by the specified tokens. showListWith :: (Show token, Show element) => (token, token, token) -> [element] -> ShowS -- | module ToolShed.Data.List.Runlength -- | Describes the number of consecutive equal items in a list. type Code a = (Int, a) -- | Run-length encodes the specified list. encode :: Eq a => [a] -> [Code a] -- | Performs run-length decoding to retrieve the original unencoded -- list. decode :: [Code a] -> [a] -- | Accessor. getLength :: Code a -> Int -- | Accessor. getDatum :: Code a -> a -- | module ToolShed.Data.List.Splits -- | splitsLeftFrom :: Int -> [a] -> [Split a] -- | splitsRightFrom :: Int -> [a] -> [Split a] -- | module ToolShed.Data.Pair -- | mirror :: (a -> b) -> (a, a) -> (b, b) -- | module ToolShed.Data.Quadruple -- | Extends the concept of curry. curry4 :: ((a, b, c, d) -> result) -> a -> b -> c -> d -> result -- | Extends the concept of uncurry. uncurry4 :: (a -> b -> c -> d -> result) -> (a, b, c, d) -> result -- | Access the first datum from the specified quadruple. getFirst :: (a, b, c, d) -> a -- | Access the second datum from the specified quadruple. getSecond :: (a, b, c, d) -> b -- | Access the third datum from the specified quadruple. getThird :: (a, b, c, d) -> c -- | Access the fourth datum from the specified quadruple. getFourth :: (a, b, c, d) -> d -- | Operate on first datum. mutateFirst :: (a -> a') -> (a, b, c, d) -> (a', b, c, d) -- | Operate on second datum. mutateSecond :: (b -> b') -> (a, b, c, d) -> (a, b', c, d) -- | Operate on third datum. mutateThird :: (c -> c') -> (a, b, c, d) -> (a, b, c', d) -- | Operate on third datum. mutateForth :: (d -> d') -> (a, b, c, d) -> (a, b, c, d') -- | module ToolShed.Data.String -- | Replaces any embedded tab-characters with the appropriate number of -- spaces. deTab :: Int -> String -> String -- | module ToolShed.Data.Triple -- | Extends the concept of curry. curry3 :: ((a, b, c) -> result) -> a -> b -> c -> result -- | Extends the concept of uncurry. uncurry3 :: (a -> b -> c -> result) -> (a, b, c) -> result -- | Access the first datum from the specified triple. getFirst :: (a, b, c) -> a -- | Access the second datum from the specified triple. getSecond :: (a, b, c) -> b -- | Access the third datum from the specified triple. getThird :: (a, b, c) -> c -- | Operate on first datum. mutateFirst :: (a -> a') -> (a, b, c) -> (a', b, c) -- | Operate on second datum. mutateSecond :: (b -> b') -> (a, b, c) -> (a, b', c) -- | Operate on third datum. mutateThird :: (c -> c') -> (a, b, c) -> (a, b, c') -- | module ToolShed.Options -- | The required interface. class Default a => Options a blankValue :: Options a => a -- | module ToolShed.SelfValidate -- | The interface to which data which can self-validate should conform. class SelfValidator v getErrors :: SelfValidator v => v -> [String] isValid :: SelfValidator v => v -> Bool -- | Returns the first error only (so only call on failure of -- isValid), since subsequent tests may be based on invalid data. getFirstError :: SelfValidator v => v -> String -- | Extracts the failed tests from those specified. extractErrors :: [(Bool, String)] -> [String] instance ToolShed.SelfValidate.SelfValidator v => ToolShed.SelfValidate.SelfValidator (GHC.Maybe.Maybe v) instance (ToolShed.SelfValidate.SelfValidator a, ToolShed.SelfValidate.SelfValidator b) => ToolShed.SelfValidate.SelfValidator (a, b) instance (ToolShed.SelfValidate.SelfValidator a, ToolShed.SelfValidate.SelfValidator b, ToolShed.SelfValidate.SelfValidator c) => ToolShed.SelfValidate.SelfValidator (a, b, c) instance ToolShed.SelfValidate.SelfValidator v => ToolShed.SelfValidate.SelfValidator [v] instance ToolShed.SelfValidate.SelfValidator v => ToolShed.SelfValidate.SelfValidator (Data.Set.Internal.Set v) instance ToolShed.SelfValidate.SelfValidator v => ToolShed.SelfValidate.SelfValidator (Data.Map.Internal.Map k v) instance (GHC.Arr.Ix index, ToolShed.SelfValidate.SelfValidator element) => ToolShed.SelfValidate.SelfValidator (GHC.Arr.Array index element) -- | module ToolShed.System.File -- | The ordered sequence of directories, searched for a file. type SearchPath = [FilePath] -- | A file-path, and the contents read from it. type LocatedData a = (FilePath, a) -- | locate :: FilePath -> SearchPath -> IO [FilePath] -- | Traverse the search-path, looking for matching instances of the -- specified file-name, and either throw an exception, or return a pair -- composed from the path to the first matching file, together with its -- contents. getFile :: FilePath -> SearchPath -> IO (LocatedData String) -- | fromFile :: Read a => FilePath -> SearchPath -> IO (LocatedData a) -- | Accessor. getFilePath :: LocatedData a -> FilePath -- | Accessor. getData :: LocatedData a -> a -- | module ToolShed.System.Random -- | Constructs an infinite list of independent random-generators. randomGens :: RandomGen randomGen => randomGen -> [randomGen] -- | shuffle :: RandomGen randomGen => randomGen -> [a] -> [a] -- | generateSelection :: RandomGen randomGen => randomGen -> [a] -> Maybe [a] -- | generateSelectionFromBounded :: (RandomGen randomGen, Bounded a, Random a) => randomGen -> [a] -- | Return a randomly selected element from those provided. select :: (Foldable foldable, RandomGen randomGen) => randomGen -> foldable a -> Maybe a -- | module ToolShed.System.TimeAction -- | Time the specified IO-action, returning the required number of -- CPU-seconds and the 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 -- | module ToolShed.System.TimePure -- | getCPUSeconds :: (Fractional seconds, NFData expression) => expression -> IO (seconds, expression) -- | printCPUSeconds :: NFData expression => expression -> IO expression -- | module ToolShed.Test.Ix -- | Checks that implementations of Data.Array.IArray.Ix satisfy rules. index :: (Bounded a, Ix a) => a -> Bool -- | -- -- Implements Arbitrary for Array, where the array-index is -- required to be a bounded enumerable type. -- -- module ToolShed.Test.QuickCheck.Arbitrary.Array instance (GHC.Enum.Bounded i, GHC.Arr.Ix i, GHC.Enum.Enum i, Test.QuickCheck.Arbitrary.Arbitrary e) => Test.QuickCheck.Arbitrary.Arbitrary (GHC.Arr.Array i e) -- | module ToolShed.Test.QuickCheck.Arbitrary.Map instance (GHC.Classes.Ord k, Test.QuickCheck.Arbitrary.Arbitrary k, Test.QuickCheck.Arbitrary.Arbitrary v) => Test.QuickCheck.Arbitrary.Arbitrary (Data.Map.Internal.Map k v) -- | module ToolShed.Test.QuickCheck.Arbitrary.Set instance (GHC.Classes.Ord k, Test.QuickCheck.Arbitrary.Arbitrary k) => Test.QuickCheck.Arbitrary.Arbitrary (Data.Set.Internal.Set k) -- | module ToolShed.Test.QuickCheck.Result -- | Check whether the specified result is successful. isSuccessful :: Result -> Bool -- | module ToolShed.Test.ReversibleBoundedEnum -- | Checks that composing pred & succ is equivalent to -- the identity. isReversible :: (Bounded r, Eq r, Enum r) => r -> Bool -- | module ToolShed.Test.ReversibleEnum -- | Checks that composing toEnum & fromEnum is -- equivalent to the identity. isReversible :: (Eq r, Enum r) => r -> Bool -- | -- -- module ToolShed.Test.ReversibleIO -- | Checks that composing read & show is equivalent to -- the identity. isReversible :: (Eq r, Read r, Show r) => r -> Bool -- | Checks whether read can skip prepended white space; -- isReversible is a prerequisite. readPrependedWhiteSpace :: (Eq r, Read r, Show r) => r -> Bool -- | Checks whether read both copes with garbage following the valid -- input-data, & leaves it unchanged. readTrailingGarbage :: (Eq a, Read a, Show a) => (Char -> Bool) -> a -> String -> Bool