Skip to content

Commit

Permalink
* This should work more. Still need to copy the Subst rules though.
Browse files Browse the repository at this point in the history
  • Loading branch information
spockz committed Jan 15, 2012
1 parent 53776ac commit d43949c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion resources/static/hjs/Models.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ hasValidSyntax term =


run :: Parser a b -> [a] -> Maybe b
run p as = fmap fst . find (null . snd) $ startParse p as
run p as = fmap fst . find (null . snd) $ startParse p as

-- class exports.ProofTreeNode extends Backbone.Model
-- # Available attributes:
Expand Down
4 changes: 4 additions & 0 deletions resources/static/hjs/Prolog.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import Language.Prolog.NanoProlog.ParserUUTC

type Proof = Tree Term

instance Subst Proof where
subst env (Node tm cs) = Node (subst env tm) (subst env cs)


data DropRes = DropRes Bool Proof
deriving Show

Expand Down
20 changes: 8 additions & 12 deletions resources/static/hjs/jcu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,15 @@ class FromJS a b => FromJSPlus a b where
jsType :: a -> b -> String
check :: a -> b -> Bool
check a b = jsType a b == fromJS (typeof a)
-- fromJSP :: a -> Maybe b
-- fromJSP a = if check a undefined then
-- Just (fromJS a)
-- else
-- Nothing
fromJSP :: a -> Maybe b
fromJSP a = let (v::b) = fromJS a
in if check a v then
Just v
else
Nothing

--
-- foreign import jscript "typeof(%1)"
-- typeof :: a -> JSString


ajaxQ :: (JS r) => AjaxRequestType -> String -> v -> AjaxCallback r -> AjaxCallback r -> IO ()
ajaxQ :: (JS r, JS v) => AjaxRequestType -> String -> v -> AjaxCallback r -> AjaxCallback r -> IO ()
ajaxQ rt url vals onSuccess onFail = do
AQ.ajaxQ "jcu_app"
(AjaxOptions { ao_url = url,
Expand Down Expand Up @@ -176,8 +173,7 @@ addRules obj str obj2 = do
draggable draggables $ Draggable (toJS True) (toJS "document") (toJS True) 100 50 onStart

return ()

-- instance Language.UHC.JScript.Types.JS UHC.Base.PackedString where

--
-- instance JS () where

Expand Down

0 comments on commit d43949c

Please sign in to comment.