Idris2/tests/idris2/api001/LazyCodegen.idr

22 lines
706 B
Idris
Raw Normal View History

2022-01-12 00:13:45 +03:00
||| NOTE: Please keep this file in sync with the example in docs/source/backends/custom.rst
module Main
import Core.Context
import Compiler.Common
import Idris.Driver
2020-08-21 12:51:21 +03:00
compile : Ref Ctxt Defs -> (tmpDir : String) -> (execDir : String) ->
ClosedTerm -> (outfile : String) -> Core (Maybe String)
2020-08-21 12:51:21 +03:00
compile defs tmp dir term file = do coreLift $ putStrLn "I'd rather not."
pure $ Nothing
execute : Ref Ctxt Defs -> (execDir : String) -> ClosedTerm -> Core ()
execute defs dir term = do coreLift $ putStrLn "Maybe in an hour."
lazyCodegen : Codegen
2021-06-27 18:00:03 +03:00
lazyCodegen = MkCG compile execute Nothing Nothing
main : IO ()
main = mainWithCodegens [("lazy", lazyCodegen)]