Created
April 5, 2010 18:35
-
-
Save eagletmt/356697 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
commands.addUserCommand(['hseval'], 'evaluate haskell expression', | |
function(args) { | |
util.httpGet('http://tryhaskell.org/haskell.json?method=eval&expr=' + encodeURIComponent(args.literalArg), function(res) { | |
let json = JSON.parse(res.responseText); | |
if (json.error) { | |
liberator.echoerr('error: ' + json.error); | |
} else if (json.exception) { | |
liberator.echoerr('exception: ' + json.exception); | |
} else { | |
liberator.echo(json.result + ' :: ' + json.type); | |
} | |
}); | |
}, { literal: 0 }, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment