Skip to content

Instantly share code, notes, and snippets.

@23jura23
Created May 12, 2021
Embed
What would you like to do?
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