Skip to content

vikraman/hs-coexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hs-coexp

ci

This is a Haskell library which explores some ideas around continuations and co-exponentials.

Modules

The library has the following modules:

  • Control.Monad.Coexp: a monadic interface for coexponentials
  • Control.Monad.Control: a monadic interface for control operators using coexponentials
  • Data.Coexp: implementation of coexponential types using Cont
  • Data.Coexp.Backtrack: backtracking combinators
  • Control.Monad.Free.Control: codensity encoding of Free monads using coexponentials
  • Control.Arrow.Coapply: coarrows
  • Data.Profunctor.Coclosed: coclosed profunctors

The examples are implemented in the following modules.

  • Examples.SAT.Guess: bruteforce SAT solver using continuations
  • Examples.SAT.Backtrack: backtracking SAT solver using the coexponential combinators
  • Examples.Eff.Toss: Sam Lindley's drunken toss example of effect handlers encoded using codensity
  • Examples.TS.Backtrack: backtracking tree search using the coexponential combinators

Usage

There is a test suite which:

  • benchmarks the brute-force SAT solver against the backtracking SAT solver, and
  • runs some test cases on the drunken toss example,
  • tests the tree search example.
$ cabal build all
$ cabal run coexp-test -- --quickcheck-tests 1000

Comments

Any contributions and suggestions are most welcome.

Here are some other repositories (that I know of), which also explore continuations and co-exponentials:

Releases

No releases published

Packages

No packages published