-
-
Save 23jura23/58ce0c73bd7a47015db3a6f908d3d2d6 to your computer and use it in GitHub Desktop.
Cross dependency 2: cyclic dependency
This file contains 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
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 () |
This file contains 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
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