Last active
August 29, 2015 14:07
-
-
Save dustingetz/62b7074208c7f1c203ac to your computer and use it in GitHub Desktop.
This file contains 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
Author
dustingetz
commented
Oct 20, 2014
Here is a second attempt
instance Expr Program where
lit (IVal n) = [PushI n]
lit (BVal n) = [PushB n]
add l r = l ++ r ++ [StackVM.Add]
mul l r = l ++ r ++ [StackVM.Mul]
Illegal instance declaration for ‘Expr Program’
(All instance types must be of the form (T a1 ... an)
where a1 ... an are *distinct type variables*,
and each type variable appears at most once in the instance head.
Use FlexibleInstances if you want to disable this.)
In the instance declaration for ‘Expr Program’
Failed, modules loaded: Parser, ExprT, StackVM, Calc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment