Partial Evaluation

and Automatic Program Generation

Neil D. Jones, Carsten K Gomard, Peter Sestoft

Antimirov Derivatives for Regular Expressions

Derivatives of Regular Expressions

Actual good docs for recursion schemes

Functional Pearl: Enumerating the Rationals

Probabilistic Programming and Bayesian Methods for Hackers

Toy SMT solver in Haskell

It provides solver implementations of various problems including SAT, SMT, Max-SAT, PBS (Pseudo Boolean Satisfaction), PBO (Pseudo Boolean Optimization), MILP (Mixed Integer Linear Programming) and non-linear real arithmetic.

Probabilistic programming languages


Bayesian Logic (BLOG) is a probabilistic modeling language. It is designed for representing relations and uncertainties among real world objects. For instance, tracking multiple targets in a video. BLOG makes it easy and concise to represet - uncertainty about the existence (and the number) of underlying objects - uncertain relations among objects - dependencies among relations and functions - observed evidence


This system description paper introduces the probabilistic programming language Hakaru10, for expressing, and performing inference on (general) graphical models. The language supports discrete and continuous distributions, mixture distributions and conditioning. Hakaru10 is a DSL embedded in Haskell and supports Monte-Carlo Markov Chain (MCMC) inference.

Hakaru10 is designed to address two main challenges of probabilistic programming: performance and correctness. It implements the incremental Metropolis-Hastings method, avoiding all redundant computations. In the presence of conditional branches, efficiently maintaining dependencies and correctly computing the acceptance ratio are non-trivial problems, solved in Hakaru10. The implementation is unique in being explicitly designed to satisfy the common equational laws of probabilistic programs. Hakaru10 is typed; specifically, its type system statically prevents meaningless conditioning, enforcing that the values to condition upon must indeed come from outside the model.

(includes okay implementation of Metropolis-Hastings)

Writing Semigroup / Monoid instances compatible with GHC 8.2 / 8.4

import Data.Semigroup as Sem
-- base >= 4.8: `Monoid` class is exported via `Prelude`
-- base < 4.11: re-exports `Monoid` class & common newtype wrappers
-- base >= 4.11: doesn't reexport `Monoid` class anymore

instance Sem.Semigroup Foo where
  (<>) =instance Monoid Foo where
  mempty =#if !(MIN_VERSION_base(4,11,0))
  -- this is redundant starting with base-4.11 / GHC 8.4
  -- if you want to avoid CPP, you can define `mappend = (<>)` unconditionally
  mappend = (<>)


SC Mini is a “minimal” positive supercompiler

Supercompilation by Evaluation

Max Bolingbroke, Simon Peyton Jones