Skip to content

Instantly share code, notes, and snippets.

@23jura23
Created May 12, 2021 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 23jura23/58ce0c73bd7a47015db3a6f908d3d2d6 to your computer and use it in GitHub Desktop.
Save 23jura23/58ce0c73bd7a47015db3a6f908d3d2d6 to your computer and use it in GitHub Desktop.
Cross dependency 2: cyclic dependency
module cyclic.File1 where
data MyFile = native cyclic.File2 where
pure native func :: MyFile -> Int
pure native create new :: () -> MyFile
x = 5
main = print $ MyFile.func $ MyFile.create ()
package cyclic;
import cyclic.File1;
public class File2 {
public int func() {
return 1;
}
public static void main(String[] args) {
File1 f = new File1();
System.out.println(f.x);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment