Hoogle Search
Within LTS Haskell 24.46 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapMaybeWithKey :: (Build -> a -> Maybe b) -> RadixTree a -> RadixTree bradix-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.
-
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
-
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) -
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
-
ranged-list Data.List.Range It is like unfoldlRangeMaybe. But it has already prepared values.
>>> :set -XDataKinds >>> count n = if n < 3 then Just (n + 1, n * 3) else Nothing >>> xs = NilR :++ 123 :+ 456 :: RangeR 1 5 Int >>> unfoldlRangeMaybeWithBase count 1 xs :: Maybe (RangeR 3 5 Int) Just ((((NilR :++ 6) :+ 3) :+ 123) :+ 456)
-
ranged-list Data.List.Range It is like unfoldrRangeMaybe. But it use a monad instead of a function. The first argument monad return boolean value. It create 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 unfoldrMRangeMaybe return Nothing.
>>> :set -XDataKinds >>> :module + Data.IORef >>> r <- newIORef 1 >>> check n0 = (< n0) <$> readIORef r >>> count = readIORef r >>= \n -> n * 3 <$ writeIORef r (n + 1) >>> unfoldrMRangeMaybe (check 2) count :: IO (Maybe (RangeL 3 5 Integer)) Nothing
>>> writeIORef r 1 >>> unfoldrMRangeMaybe (check 5) count :: IO (Maybe (RangeL 3 5 Integer)) Just (3 :. (6 :. (9 :. (12 :.. NilL))))
>>> writeIORef r 1 >>> unfoldrMRangeMaybe (check 10) count :: IO (Maybe (RangeL 3 5 Integer)) Nothing
-
ranged-list Data.List.Range It is like unfoldrMRangeMaybe. But it has already prepared values.
>>> :set -XDataKinds -fno-warn-tabs >>> :module + Data.IORef >>> r <- newIORef 1 >>> check = (< 3) <$> readIORef r >>> count = readIORef r >>= \n -> n * 3 <$ writeIORef r (n + 1) >>> xs = 123 :. 456 :.. NilL :: RangeL 1 5 Integer >>> :{ unfoldrMRangeMaybeWithBase xs check count :: IO (Maybe (RangeL 3 5 Integer)) :} Just (123 :. (456 :. (3 :. (6 :.. NilL)))) -
ranged-list Data.List.Range To eveluate a function to construct a list. The function recieve a state and return a nothing value or an element and a new state. If number of created elements is less than a minimum number of list elements or greater than a maximum number, then return Nothing.
>>> :set -XDataKinds >>> next n0 n = if n < n0 then Just (n * 3, n + 1) else Nothing >>> unfoldrRangeMaybe (next 2) 1 :: Maybe (RangeL 3 5 Int) Nothing
>>> unfoldrRangeMaybe (next 5) 1 :: Maybe (RangeL 3 5 Int) Just (3 :. (6 :. (9 :. (12 :.. NilL))))
>>> unfoldrRangeMaybe (next 10) 1 :: Maybe (RangeL 3 5 Int) Nothing
-
ranged-list Data.List.Range It is like unfoldrRangeMaybe. But it has already prepared values.
>>> :set -XDataKinds >>> xs = 123 :. 456 :.. NilL :: RangeL 1 5 Int >>> next n = if n < 3 then Just (n * 3, n + 1) else Nothing >>> unfoldrRangeMaybeWithBase xs next 1 :: Maybe (RangeL 3 5 Int) Just (123 :. (456 :. (3 :. (6 :.. NilL))))
fromMaybe :: Exception e => e -> Maybe a -> BitGet arattletrap Rattletrap.Type.Attribute No documentation available.