chrrasmussen / Idris2-Erlang

Erlang code generator for Idris 2
Other
141 stars 5 forks source link

Can't run sample #9

Closed fuelen closed 3 years ago

fuelen commented 3 years ago

Hi!

I've tried to run a sample and I got an error:

$HOME/.idris2erl/bin/idris2erl Idris2-Erlang/samples/4-Concurrency/Main.idr
     ____    __     _         ___                                           
    /  _/___/ /____(_)____   |__ \                                          
    / // __  / ___/ / ___/   __/ /     Version 0.3.0-ecfb5e86b
  _/ // /_/ / /  / (__  )   / __/      https://www.idris-lang.org           
 /___/\__,_/_/  /_/____/   /____/      Type :? for help                     

Welcome to Idris 2.  Enjoy yourself!
With codegen for: erlang
1/1: Building Idris2-Erlang.samples.4-Concurrency.Main (Idris2-Erlang/samples/4-Concurrency/Main.idr)
Error: While processing right hand side of sleep. Can't find an implementation for HasIO ?io.

Idris2-Erlang.samples.4-Concurrency.Main:8:3--8:31
 4 | 
 5 | ||| Helper function used to simulate delay.
 6 | sleep : Int -> IO ()
 7 | sleep ms = do
 8 |   erlCall "timer" "sleep" [ms]

Idris2-Erlang was installed using 2nd approach: https://github.com/chrrasmussen/Idris2-Erlang#alternative-2-from-chez-scheme-bootstrap

chrrasmussen commented 3 years ago

Hi! I am sorry for the late reply.

Thanks for reporting this issue! I have now updated Idris2-Erlang to match the latest version of Idris 2 (v0.5.1), and fixed the compile errors in the samples.

To make sure that the samples continue to type-check, I have added a step in the CI workflows to run the samples (https://github.com/chrrasmussen/Idris2-Erlang/commit/aef5ab8a94b3b4ce737fee10a97d2229b00e55f3).

If you would like to give it another try, I recommend that you reinstall Idris2-Erlang by following the same steps as you did previously.

fuelen commented 3 years ago

@chrrasmussen It works, thank you!