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.

  1. unsafeDupablePerformIO :: IO a -> a

    base-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.

  2. 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:)
    

  3. 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',"---")])
    

  4. segmentBeforeMaybe :: (a -> Maybe b) -> [a] -> ([a], [(b, [a])])

    utility-ht Data.List.HT

    Deprecated: use segmentBeforeJust instead

  5. 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)
    

  6. type NoInstanceFor (expr :: k) = 'Text "There is no instance for " ':<>: 'ShowType expr

    servant Servant.API.TypeErrors

    No instance exists for expr.

  7. type NoInstanceForSub (tycls :: k) (expr :: k') = 'Text "There is no instance for " ':<>: 'ShowType tycls ':<>: 'Text " (" ':<>: 'ShowType expr ':<>: 'Text " :> ...)"

    servant Servant.API.TypeErrors

    No instance exists for tycls (expr :> ...) because expr is not recognised.

  8. transformStepWithAtto :: forall a (m :: Type -> Type) . Monad m => Parser a -> StepT m ByteString -> StepT m a

    servant Servant.Types.SourceT

    No documentation available.

  9. transformWithAtto :: forall (m :: Type -> Type) a . Monad m => Parser a -> SourceT m ByteString -> SourceT m a

    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"
    

  10. package transformers-compat

    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.

Page 430 of many | Previous | Next