Skip to content

Instantly share code, notes, and snippets.

@DylanLukes
Created February 28, 2011 15:00
Show Gist options
  • Save DylanLukes/847423 to your computer and use it in GitHub Desktop.
Save DylanLukes/847423 to your computer and use it in GitHub Desktop.
{-# LANGUAGE GADTs, EmptyDataDecls#-}
module Calculator where
type Stack = [Double]
data Arity = Unary | Binary
data Associativity = Left | Right
data Operator = Operator Arity Associativity
data Expr a where
Add :: Expr (Operator Binary Left)
Sub :: Expr (Operator Binary Left)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment