Why won't GHC reduce my type family?
Here's an untyped lambda calculus whose terms are indexed by their free variables. I'm using the singletons library for singleton values of type-level strings. {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} import Data.Singletons import Data.Singletons.TypeLits data Expr (free :: [Symbol]) where Var :: Sing a -> Expr '[a] Lam :: Sing a -> Expr as -> Expr (Remove a as) App :: Expr free1 -> Expr free2 -> Expr (Union free1 free2) A Var introduces a free variable. A