Skip to content

Heimdell/dual-effects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dual-effects

Yet another experiment on effect systems. Instead of using sum-of-functors to hold the actions, I use product-of-handlers to dispatch it.

What

An effect system, Reader/Writer/State/Throw/Catch - all that stuff. Some ideas are taken from polysemy.

Why

Because I wanted to have an effect system I have full control of, so I can experiment with it and rewrite it as much as I like.

The defining property is the absolute simplicity of the implementation and the API. It is kinda slow, thought - the countDown benchmark shows a ~100x slowdown (from 0.16 sec to 13.4 sec).

Features

The library is designed to be a layer over some ReaderT Env IO monad.

Addidng certain effects autoimplements some standart typeclasses: Fixpoint -> MonadFix, Error -> MonadThrow/MonadCatch, NonDet -> Alternative, Lift IO -> LiftIO.

The Error effect operates with Exceptions, so it is not ExceptT-like. Separate State or Reader effects can be combined. The State can be wired to work with IORefs in ReaderT context.

Effects mostly delegate their implementations to the Final monad.

You don't have to import Core, all Effects are re-exporing it.

About

Yet another experiment on effect systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published