Tag: lambda-calculus
-
Is it possible, using PHOAS, to evaluate a term to normal form, and then stringify it?
6 From this Haskell Cafe post, and borrowing some code examples from jyp, we can construct a simple PHOAS evaluator in Haskell as: {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} import Data.Char data Term v t where Var :: v t -> Term v t App :: Term v (a -> b) -> Term…