prospect alternatives and similar packages
Based on the "Control" category.
Alternatively, view prospect alternatives based on common mentions on social networks and blogs.
-
transient
A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state) -
classy-prelude
Type classes for mapping, folding, and traversing monomorphic containers -
classy-prelude-yesod
Type classes for mapping, folding, and traversing monomorphic containers -
distributed-closure
Serializable closures for distributed programming. -
extensible-effects
Extensible Effects: An Alternative to Monad Transformers -
selective
Selective Applicative Functors: Declare Your Effects Statically, Select Which to Execute Dynamically -
auto
Haskell DSL and platform providing denotational, compositional api for discrete-step, locally stateful, interactive programs, games & automations. http://hackage.haskell.org/package/auto -
ComonadSheet
A library for expressing "spreadsheet-like" computations with absolute and relative references, using fixed-points of n-dimensional comonads. -
abstract-par
Type classes generalizing the functionality of the 'monad-par' library. -
these
An either-or-both data type, with corresponding hybrid error/writer monad transformer. -
hask
Category theory for Haskell with a lens flavor (you need GHC 7.8.3, not 7.8.2 to build this!) -
transient-universe
A Cloud monad based on transient for the creation of Web and reactive distributed applications that are fully composable, where Web browsers are first class nodes in the cloud -
distributed-fork
A distributed data processing framework in Haskell. -
cloud-haskell
This is an umbrella development repository for Cloud Haskell -
monad-validate
(NOTE: REPOSITORY MOVED TO NEW OWNER: https://github.com/lexi-lambda/monad-validate) A Haskell monad transformer library for data validation -
distributed-process-platform
DEPRECATED (Cloud Haskell Platform) in favor of distributed-process-extras, distributed-process-async, distributed-process-client-server, distributed-process-registry, distributed-process-supervisor, distributed-process-task and distributed-process-execution -
operational
Implement monads by specifying instructions and their desired operational semantics. -
ixmonad
Provides 'graded monads' and 'parameterised monads' to Haskell, enabling fine-grained reasoning about effects. -
effect-monad
Provides 'graded monads' and 'parameterised monads' to Haskell, enabling fine-grained reasoning about effects. -
monad-control
Lift control operations, like exception catching, through monad transformers -
freer-effects
An implementation of "Freer Monads, More Extensible Effects". -
monad-time
Type class for monads which carry the notion of the current time.
Tired of breaking your main and manually rebasing outdated pull requests?
Do you think we are missing an alternative of prospect or a related project?
README
prospect
| Hackage
Dedication
It is absolutely necessary, for the peace and safety of mankind, that some of earth's dark, dead corners and unplumbed depths be let alone; lest sleeping abnormalities wake to resurgent life, and blasphemously surviving nightmares squirm and splash out of their black lairs to newer and wider conquests.
H.P. Lovecraft
Overview
prospect
is a library that provides primitives for exploring functions, and by
extension, monads. As such, it allows for a best-attempt static analysis of free
monads. Such power, however, does not come for free; using prospect
is an
implicit promise with the Eldrich horrors that you'll tread lightly. Feckless
wanderers into these depths will be rewarded with naught but terror, madness,
and runtime crashes.
Usage
The library provides a function, prospect :: Free f a -> (Maybe a, [f ()])
,
which can probe the depths of a free monad, finding as many f
constructors as
it can before the monad branches dynamically.
Be careful when inspecting the f ()
s, if any of them depend on variables bound
in the monad, they will leak exceptions when you are least expecting them. It's
a good idea to run your f ()
s through ensure :: Alternative m => a -> m a
after you've scrutinized their constructors.
Example
prospect
can be used to perform a best-effort static analysis of a free monad:
data Pattern a
= Cont (Bool -> a)
| Action Int a
deriving (Functor, Generic1)
cont :: MonadFree Pattern m => m Bool
cont = liftF $ Cont id
action :: MonadFree Pattern m => Int -> m ()
action i = liftF $ Action i ()
success :: (Maybe String, [Pattern ()]
success = prospect $ do
a <- cont
action 1
pure "success"
-- success = (Just "success", [Cont (const ()), Action 1 ()])
failure :: (Maybe String, [Pattern ()]
failure = prospect $ do
a <- cont
action 1
if a -- static analysis ends here, as it would require branching on the
-- result of a monadic action
then action 2
else action 3
action 4
pure "failure"
-- failure = (Nothing, [Cont (const ()), Action 1 ()])
In these examples, we can continue analyzing a Free Pattern
monad until
the result of its Cont
continuation is forced.