Skip to content

Instantly share code, notes, and snippets.

@jozefg
jozefg / PatCompile.hs
Created March 25, 2016 07:19
Wadler's classic pattern matching algorithm implemented for a core language with Bound.
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module PatCompile where
import Bound
import Bound.Var
import Bound.Scope
import Control.Monad (ap)