Skip to content

Instantly share code, notes, and snippets.

@andrevidela
Created August 17, 2017 22:24
Show Gist options
  • Select an option

  • Save andrevidela/c9d12421034591da8883be07b1e3f1e4 to your computer and use it in GitHub Desktop.

Select an option

Save andrevidela/c9d12421034591da8883be07b1e3f1e4 to your computer and use it in GitHub Desktop.
Can't infer explicit argument to tryGenOp, Can't infer explicit argument to S, Can't infer explicit argument to doAdd
mutual
tryGenOp : StackCmd () pre (S _) -> StackIO h
tryGenOp x {pre} {h} = case decEq pre h of
(Yes Refl) => do x
res <- Top
PutStr (show res ++ "\n")
stackCalc
(No contra) => do PutStr $ "not enough item on the stack, expected " ++
(show pre) ++
", got " ++
(show h) ++ "\n"
stackCalc
stackCalc : StackIO height
stackCalc = do PutStr "> "
input <- GetStr
case strToInput input of
Nothing => do PutStr "Invalid Input\n"
stackCalc
Just (Number x) => do Push x
stackCalc
Just (Add) => tryGenOp doAdd
Just (Sub) => tryGenOp doSubtract
Just (Neg) => ?negation
@andrevidela
Copy link
Author

ex_13_1_2.idr:112:28:
Can't infer explicit argument to tryGenOp,
Can't infer explicit argument to S,
Can't infer explicit argument to doAdd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment