Copyright | (c) 2024 Sayo Koyoneda |
---|---|
License | MPL-2.0 (see the file LICENSE) |
Maintainer | [email protected] |
Safe Haskell | None |
Language | GHC2021 |
Data.Effect.NonDet
Description
Effects that realize non-deterministic computations.
Synopsis
- data Empty a where
- type LEmpty = LiftFOE Empty
- pattern LEmpty :: forall a f a1. () => forall. (a ~ a1, ()) => LiftFOE Empty f a
- empty :: forall a f. SendFOE Empty f => f a
- empty' :: forall {k} (tag :: k) a f. SendFOE (Tag Empty tag) f => f a
- empty'' :: forall {k} (key :: k) a f. SendFOEBy key Empty f => f a
- data Choose a where
- type LChoose = LiftFOE Choose
- pattern LChoose :: forall a f. () => (a ~ Bool, ()) => LiftFOE Choose f a
- choose :: SendFOE Choose f => f Bool
- choose' :: forall {k} (tag :: k) f. SendFOE (Tag Choose tag) f => f Bool
- choose'' :: forall {k} (key :: k) f. SendFOEBy key Choose f => f Bool
- data ChooseH (f :: Type -> Type) a where
- chooseH :: forall a f. SendHOE ChooseH f => f a -> f a -> f a
- chooseH' :: forall {k} (tag :: k) a f. SendHOE (TagH ChooseH tag) f => f a -> f a -> f a
- chooseH'' :: forall {k} (key :: k) a f. SendHOEBy key ChooseH f => f a -> f a -> f a
Documentation
An effect that eliminates a branch by causing the current branch context of a non-deterministic computation to fail.
empty :: forall a f. SendFOE Empty f => f a Source #
Eliminates a branch by causing the current branch context of a non-deterministic computation to fail.
empty' :: forall {k} (tag :: k) a f. SendFOE (Tag Empty tag) f => f a Source #
Eliminates a branch by causing the current branch context of a non-deterministic computation to fail.
empty'' :: forall {k} (key :: k) a f. SendFOEBy key Empty f => f a Source #
Eliminates a branch by causing the current branch context of a non-deterministic computation to fail.
An effect that splits the computation into two branches.
data ChooseH (f :: Type -> Type) a where Source #
An effect that executes two branches as scopes.
A higher-order version of the Choose
effect.
chooseH :: forall a f. SendHOE ChooseH f => f a -> f a -> f a Source #
Executes the given two scopes as branches.
Even if one fails due to the empty
operation, the whole does not fail as long as the other does not fail.