Created
February 28, 2011 15:00
-
-
Save DylanLukes/847423 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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