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.
-
clash-prelude Clash.Signal Version of delay that only updates when its second argument is a Just value.
>>> let input = fromList [Just 1, Just 2, Nothing, Nothing, Just 5, Just 6, Just (7::Int)] >>> sampleN @System 7 (delayMaybe 0 input) [0,1,2,2,2,5,6]
-
clash-prelude Clash.Signal Version of register that only updates its content when its second argument is a Just value. So given:
sometimes1 = s where s = register Nothing (switch <$> s) switch Nothing = Just 1 switch _ = Nothing countSometimes = s where s = regMaybe 0 (plusM (pure <$> s) sometimes1) plusM = liftA2 (liftA2 (+))
We get:>>> sampleN @System 9 sometimes1 [Nothing,Nothing,Just 1,Nothing,Just 1,Nothing,Just 1,Nothing,Just 1] >>> sampleN @System 9 countSometimes [0,0,0,1,1,2,2,3,3]
-
clash-prelude Clash.XException.MaybeX Deconstruct MaybeX into an a - the opposite of toMaybeX. Be careful when using this function, because it might return an XException if the argument was IsX.
hasXToMaybeX :: (NFDataX a, NFData a) => a -> MaybeX aclash-prelude Clash.XException.MaybeX Construct a MaybeX value. If hasX evaluates to Left, this function will return IsX. Otherwise, it will return IsDefined.
-
clash-prelude Clash.XException.MaybeX Construct a MaybeX value. If a evaluates to XException, this function will return IsX. Otherwise, it will return IsDefined.
-
classy-prelude-conduit ClassyPrelude.Conduit Like fuseBoth, but does not force consumption of the Producer. In the case that the Producer terminates, the result value is provided as a Just value. If it does not terminate, then a Nothing value is returned. One thing to note here is that "termination" here only occurs if the Producer actually yields a Nothing value. For example, with the Producer mapM_ yield [1..5], if five values are requested, the Producer has not yet terminated. Termination only occurs when the sixth value is awaited for and the Producer signals termination. Since 1.2.4
-
classy-prelude-conduit ClassyPrelude.Conduit Same as mapOutput, but use a function that returns Maybe values. Since 0.5.0
-
classy-prelude-conduit ClassyPrelude.Conduit Run MaybeT in the base monad Since 1.0.11
fromMaybe :: forall c (f :: Type -> Type) a . c -> Colonnade f a c -> Colonnade f (Maybe a) ccolonnade Colonnade Lift a column over a Maybe. For example, if some people have houses and some do not, the data that pairs them together could be represented as:
>>> :{ let owners :: [(Person,Maybe House)] owners = [ (Person "Jordan" 18, Nothing) , (Person "Ruth" 25, Just (House Red 125000)) , (Person "Sonia" 12, Just (House Green 145000)) ] :}The column encodings defined earlier can be reused with the help of fromMaybe:>>> :{ let colOwners :: Colonnade Headed (Person,Maybe House) String colOwners = mconcat [ lmap fst colPerson , lmap snd (fromMaybe "" colHouse) ] :}>>> putStr (ascii colOwners owners) +--------+-----+-------+---------+ | Name | Age | Color | Price | +--------+-----+-------+---------+ | Jordan | 18 | | | | Ruth | 25 | Red | $125000 | | Sonia | 12 | Green | $145000 | +--------+-----+-------+---------+
chooseUnrankMaybe :: Int -> Int -> Int -> Maybe [Bool]combinatorial Combinatorics No documentation available.