Created
August 31, 2020 22:56
-
-
Save MarcelineVQ/b9f5d7e13fcc19d9748941276003cbbf 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
| -- Not compelete since it doesn't go to HasIO yet, but given: | |
| -- makeHasIO "what" ["c:foo","javascript:borp"] `[ prim_gob : Int -> Int -> PrimIO Int ] | |
| -- This generates: | |
| -- %foreign "c:foo" "javascript:borp" | |
| -- what : Int -> Int -> PrimIO Int | |
| makeHasIO : String -> List String -> List Decl -> Elab () | |
| makeHasIO funname str ys = do | |
| [IClaim fc mw vis _ (MkTy tyfc _ ty)] <- pure ys | |
| | _ => fail "bad format" | |
| let r = IClaim fc mw vis [ForeignFn str] (MkTy tyfc (UN funname) ty) | |
| -- spits out what r is when :log 1 is set in repl | |
| quote r >>= logTerm "as" 1 "fds" | |
| declare [r] | |
| %runElab makeHasIO "what" ["c:foo","javascript:borp"] `[ prim_gob : Int -> Int -> PrimIO Int ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment