Typeclass for monad with backtracking logic operations. We can interpret it as a monad with non-deterministic choice or as a potentialy infinite stream of values corresponding to possible choices.
The default implementation is LogicStream (for no need in async operations) or LogicStreamT[F] (for need in async operations)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait CpsTryMonad[M]trait CpsTrySupport[M]trait CpsThrowMonad[M]trait CpsThrowSupport[M]trait CpsMonad[M]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class CpsLogicStreamConcurrenctMonad[F]trait CpsLogicMonadInstanceContext[M]object CpsLogicStreamSyncMonadclass CpsLogicStreamTryMonad[F]object LazyListCpsLogicMonadtrait CpsLogicStreamMonadBase[F]trait CpsSyncLogicMonad[M]Show all
Members list
Type members
Types
Monad, which can be used to observe values of computation and can be used in map/flatMap/... operations. Usefull for cases, where we should mix logic and async operations. If implementation is LogicStream[F[_],A], that Observer is F[_].
Monad, which can be used to observe values of computation and can be used in map/flatMap/... operations. Usefull for cases, where we should mix logic and async operations. If implementation is LogicStream[F[_],A], that Observer is F[_].
Attributes
Value members
Abstract methods
Flatten observer into computation.
Flatten observer into computation.
Value parameters
- fma
-
- observer to flatten
Attributes
- Returns
-
- computation, which adopt observer wrapper
Split computation into part, which return as first value and rest of computation and return this as observer.
Split computation into part, which return as first value and rest of computation and return this as observer.
Attributes
mplus in haskell LogicT Synonym for 'orElse'.
mplus in haskell LogicT Synonym for 'orElse'.
Attributes
Split computation into part, which return as first value and rest of computation and return this as logic stream.
Split computation into part, which return as first value and rest of computation and return this as logic stream.
Attributes
mzero in haskell LogicT Synonym for 'empty'.
mzero in haskell LogicT Synonym for 'empty'.
Attributes
Concrete methods
empty solution set. (same as 'mzero')
empty solution set. (same as 'mzero')
Attributes
Can be viewed as fair And
-- flatMap results are mixed over the all choices in ma
Can be viewed as fair And
-- flatMap results are mixed over the all choices in ma
- in haskell LogicT
Attributes
ifte -- if/then/else which works not on boolean condition, but on existence of values in computation.
ifte -- if/then/else which works not on boolean condition, but on existence of values in computation.
Value parameters
- a
-
- computation to check
- elsep
-
- what to do if
a
is empty
- what to do if
- thenp
-
- what to do after
a
- what to do after
Attributes
Can be viewed as fair Or
-- values from both computations are interleaved
Can be viewed as fair Or
-- values from both computations are interleaved
Attributes
get the first value of computation, discarding all other. head of the list, or soft cut in prolog (scoped inside current computation).
get the first value of computation, discarding all other. head of the list, or soft cut in prolog (scoped inside current computation).
Attributes
Create a computation, which explore a
and then
b
end do not start evaluation of b
until all values or a
are explored.
Create a computation, which explore
a
and then
b
end do not start evaluation of b
until all values or a
are explored.
Synonym for MonadPlus 'mplus' or Alternative '<|>' in haskell.
Attributes
Attributes
def unsplit[A](ta: Try[A], m: M[A]): M[A]
Inherited methods
run op in the context environment.
represent error e
in monadic context.
bind combinator, which compose f
over fa
flatMap over result of checked evaluation of A
Wrap and flatten of monadic expression..
transform r
into pure value or error.
map a function f
over fa
map over result of checked evaluation of A
synonym for flatMapTry needed for processing awaits inside mapTry.
synonym for flatMapTry needed for processing awaits inside mapTry.
Attributes
-
Inherited from:
-
CpsTryMonad
Pure - wrap value t
inside monad.
Pure - wrap value t
inside monad.
Note, that pure use eager evaluation, which is different from Haskell.
Attributes
-
Inherited from:
-
CpsMonad
restore fa, ie if fa sucessful - return fa, otherwise apply fx to received error.
restore fa, ie if fa sucessful - return fa, otherwise apply fx to received error.
Attributes
-
Inherited from:
-
CpsTryMonad
try to evaluate async operation and wrap successful or failed result into F
.
try to evaluate async operation and wrap successful or failed result into F
.
Attributes
-
Inherited from:
-
CpsTryMonad
try to evaluate synchonious operation and wrap successful or failed result into F
.
try to evaluate synchonious operation and wrap successful or failed result into F
.
Attributes
-
Inherited from:
-
CpsTryMonad
async shift of tryPure.
ensure that action
will run before getting value from fa
async shift of withAction
.
async shift of withAction
.
This method is substituted instead withAction, when we use await
inside withAction
argument.
Attributes
-
Inherited from:
-
CpsTryMonad
return result of fa
after completition of action
.
Attributes
-
Inherited from:
-
CpsTrySupport
Attributes
-
Inherited from:
-
CpsTrySupport
Create monadic expression according to the default operation of choosen monad types. (i.e. delaying for effect monads, starting for eager monand, pure by default)
Create monadic expression according to the default operation of choosen monad types. (i.e. delaying for effect monads, starting for eager monand, pure by default)
Attributes
-
Inherited from:
-
CpsMonad
Abstract fields
instance of observer cps monad.
instance of observer cps monad.
Attributes