Skip to content

Instantly share code, notes, and snippets.

@jroesch
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save jroesch/11383740 to your computer and use it in GitHub Desktop.

Select an option

Save jroesch/11383740 to your computer and use it in GitHub Desktop.
data Value = SelfV | Lit Literal
data Literal = IntLit Int | StringLit String | ect
top :: Interpreter (Maybe Value)
top = do
stack <- get
case stack of
[] -> return Nothing
(top:_) -> return $ Just top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment