Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
Cull (m a) (a -> k) |
cull :: (Carrier sig m, Member Cull sig) => m a -> m a Source #
Cull nondeterminism in the argument, returning at most one result.
run (runNonDet (runCull (cull (pure a <|> pure b)))) == [a]
run (runNonDet (runCull (cull (pure a <|> pure b) <|> pure c))) == [a, c]
run (runNonDet (runCull (cull (asum (map pure (repeat a)))))) == [a]