cashew-s-engine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[CASHeW-s-engine] Function Evaluation


From: Simon D. Foster
Subject: [CASHeW-s-engine] Function Evaluation
Date: Fri, 18 Feb 2005 17:18:53 +0000

Ok,

You're probably all going to hate me for this, but because I can't get
hs-plugins to work with the latest version of GHC and because it can't
extract type errors properly at the moment anyway, I've written two
reference functions which perform evaluation and typing. They do it via
a pipe to a GHCi process (specifically ghc -e, which works like perl
-e), which means we're using Read to perform deserialization of the data
and we obviously can't deserialize functions.

My reason for doing this is so that we've at least got something to work
with while I'm awaiting a reply from Don Stewart (the guy behind
hs-plugins). We'd have to be playing the pipe game anyway to get proper
errors, but at least we'd be able to evaluate functions. But this will
have to do for now. To enable evaluation of onotology functions, you
need to append the serialized parameters to the function call. Any none
Prelude functions must be fully qualified and appropriate packages
loaded on the ghc command line. 

Code so far is attached. The two key functions are eval and typeExpr.

-Si.

-- 
Simon D. Foster <address@hidden>
Sheffield University

Attachment: Eval.hs
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]