Hoogle Search
Within LTS Haskell 24.51 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
unsafeDupablePerformIO :: IO a -> abase-compat System.IO.Unsafe.Compat This version of unsafePerformIO is more efficient because it omits the check that the IO is only being performed by a single thread. Hence, when you use unsafeDupablePerformIO, there is a possibility that the IO action may be performed multiple times (on a multiprocessor), and you should therefore ensure that it gives the same results each time. It may even happen that one of the duplicated IO actions is only run partially, and then interrupted in the middle without an exception being raised. Therefore, functions like bracket cannot be used safely within unsafeDupablePerformIO.
segmentBefore :: (a -> Bool) -> [a] -> [[a]]utility-ht Data.List.HT Split the list before each occurence of a leading character. Keep these characters. There is always a list for the part before the first leading character. It may be empty. See package non-empty for more precise result type.
>>> segmentBefore isUpper "AbcdXyz" ["","Abcd","Xyz"] >>> segmentBefore isUpper "kAbcdXYZ" ["k","Abcd","X","Y","Z"]
forAllPredicates $ \p xs -> concat (segmentBefore p xs) == xs
forAllPredicates $ \p xs -> length (filter p xs) == length (tail (segmentBefore p xs))
forAllPredicates $ \p -> all (p . head) . tail . segmentBefore p
forAllPredicates $ \p -> all (all (not . p) . tail) . tail . segmentBefore p
forAllPredicates $ \p x -> flip seq True . (!!100) . concat . segmentBefore p . cycle . (x:)
segmentBeforeJust :: (a -> Maybe b) -> [a] -> ([a], [(b, [a])])utility-ht Data.List.HT >>> segmentBeforeJust (\c -> toMaybe (isLetter c) (toUpper c)) "123a5345b---" ("123",[('A',"5345"),('B',"---")])segmentBeforeMaybe :: (a -> Maybe b) -> [a] -> ([a], [(b, [a])])utility-ht Data.List.HT Deprecated: use segmentBeforeJust instead
segmentBeforeRight :: [Either a b] -> ([a], [(b, [a])])utility-ht Data.List.HT >>> segmentBeforeRight [Left 'a', Right LT, Right GT, Left 'b'] ("a",[(LT,""),(GT,"b")])forAllMaybeFn $ \f xs -> segmentBeforeJust f xs == segmentBeforeRight (map (\x -> maybe (Left x) Right (f x)) xs)
type
NoInstanceFor (expr :: k) = 'Text "There is no instance for " ':<>: 'ShowType exprservant Servant.API.TypeErrors No instance exists for expr.
-
servant Servant.API.TypeErrors No instance exists for tycls (expr :> ...) because expr is not recognised.
-
servant Servant.Types.SourceT No documentation available.
-
servant Servant.Types.SourceT Transform using attoparsec parser. Note: parser should not accept empty input!
>>> let parser = A.skipWhile A8.isSpace_w8 >> A.takeWhile1 A8.isDigit_w8
>>> runExcept $ runSourceT $ transformWithAtto parser (source $ [fromString "1 2 3"]) Right ["1","2","3"]
>>> runExcept $ runSourceT $ transformWithAtto parser (source $ map fromString ["1", "2", "3"]) Right ["123"]
>>> runExcept $ runSourceT $ transformWithAtto parser (source $ map fromString ["1", "2 3", "4"]) Right ["12","34"]
>>> runExcept $ runSourceT $ transformWithAtto parser (source [fromString "foobar"]) Left "Failed reading: takeWhile1"
-
A small compatibility shim for the transformers library This package includes backported versions of types that were added to transformers in transformers 0.3, 0.4, and 0.5 for users who need strict transformers 0.2 or 0.3 compatibility to run on old versions of the platform, but also need those types. Those users should be able to just depend on transformers >= 0.2 and transformers-compat >= 0.3. Note: missing methods are not supplied, but this at least permits the types to be used.