Hoogle Search

Within LTS Haskell 24.38 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. mapMaybeWithKey :: (Build1 -> a -> Maybe b) -> Radix1Tree a -> Radix1Tree b

    radix-tree Data.Radix1Tree.Word8.Lazy

    Apply a function to every value in the tree and create one out of Just values.

  2. mapMaybe :: (a -> Maybe b) -> Radix1Tree a -> Radix1Tree b

    radix-tree Data.Radix1Tree.Word8.Strict

    Apply a function to every value in the tree and create one out of Just values. The Maybe is evaluated to WHNF.

  3. mapMaybeWithKey :: (Build1 -> a -> Maybe b) -> Radix1Tree a -> Radix1Tree b

    radix-tree Data.Radix1Tree.Word8.Strict

    Apply a function to every value in the tree and create one out of Just values. The Maybe is evaluated to WHNF.

  4. mapMaybe :: (a -> Maybe b) -> RadixTree a -> RadixTree b

    radix-tree Data.RadixTree.Word8.Lazy

    Apply a function to every value in the tree and create one out of Just values.

  5. mapMaybeWithKey :: (Build -> a -> Maybe b) -> RadixTree a -> RadixTree b

    radix-tree Data.RadixTree.Word8.Lazy

    Apply a function to every value in the tree and create one out of Just values.

  6. mapMaybe :: (a -> Maybe b) -> RadixTree a -> RadixTree b

    radix-tree Data.RadixTree.Word8.Strict

    Apply a function to every value in the tree and create one out of Just values. The Maybe is evaluated to WHNF.

  7. mapMaybeWithKey :: (Build -> a -> Maybe b) -> RadixTree a -> RadixTree b

    radix-tree Data.RadixTree.Word8.Strict

    Apply a function to every value in the tree and create one out of Just values. The Maybe is evaluated to WHNF.

  8. unfoldlMRangeMaybe :: forall (w :: Natural) (v :: Nat) m a . (0 <= w, Unfoldl 0 v w, Monad m) => m Bool -> m a -> m (Maybe (RangeR v w a))

    ranged-list Data.List.Range

    It is like unfoldlRangeMaybe. But it use a monad instead of a function. The first argument monad returns a boolean value. It creates values while this boolean value is True. If this boolean value is False before to create enough values or True after to create full values, then unfoldlMRangeMaybe returns Nothing.

    >>> :set -XDataKinds
    
    >>> :module + Data.IORef
    
    >>> r <- newIORef 1
    
    >>> check n0 = (< n0) <$> readIORef r
    
    >>> count = readIORef r >>= \n -> n * 3 <$ writeIORef r (n + 1)
    
    >>> unfoldlMRangeMaybe (check 2) count :: IO (Maybe (RangeR 3 5 Integer))
    Nothing
    
    >>> writeIORef r 1
    
    >>> unfoldlMRangeMaybe (check 5) count :: IO (Maybe (RangeR 3 5 Integer))
    Just ((((NilR :++ 12) :+ 9) :+ 6) :+ 3)
    
    >>> writeIORef r 1
    
    >>> unfoldlMRangeMaybe (check 10) count :: IO (Maybe (RangeR 3 5 Integer))
    Nothing
    

  9. unfoldlMRangeMaybeWithBase :: (Unfoldl n v w, Monad m) => m Bool -> m a -> RangeR n w a -> m (Maybe (RangeR v w a))

    ranged-list Data.List.Range

    It is like unfoldrMRangeMaybe. But it has already prepared values.

    >>> :set -XDataKinds
    
    >>> :module + Data.IORef
    
    >>> r <- newIORef 1
    
    >>> check = (< 3) <$> readIORef r
    
    >>> count = readIORef r >>= \n -> n * 3 <$ writeIORef r (n + 1)
    
    >>> xs = NilR :++ 123 :+ 456 :: RangeR 1 5 Integer
    
    >>> :{
    unfoldlMRangeMaybeWithBase check count xs
    :: IO (Maybe (RangeR 3 5 Integer))
    :}
    Just ((((NilR :++ 6) :+ 3) :+ 123) :+ 456)
    

  10. unfoldlRangeMaybe :: forall (w :: Natural) (v :: Nat) s a . (0 <= w, Unfoldl 0 v w) => (s -> Maybe (s, a)) -> s -> Maybe (RangeR v w a)

    ranged-list Data.List.Range

    To evaluate a function to construct a list. The function recieves a state and return a nothing value or an element and a new state. If the number of created elements is less than a minimum number of list elements or greater than a maximum number, then return Nothing.

    >>> :set -XDataKinds
    
    >>> count n0 n = if n < n0 then Just (n + 1, n * 3) else Nothing
    
    >>> unfoldlRangeMaybe (count 2) 1 :: Maybe (RangeR 3 5 Int)
    Nothing
    
    >>> unfoldlRangeMaybe (count 5) 1 :: Maybe (RangeR 3 5 Int)
    Just ((((NilR :++ 12) :+ 9) :+ 6) :+ 3)
    
    >>> unfoldlRangeMaybe (count 10) 1 :: Maybe (RangeR 3 5 Int)
    Nothing
    

Page 283 of many | Previous | Next