shithub: MicroHs

Download patch

ref: 938dd568317ac23db8da130b3a426b812428ce8c
parent: b4d456d64a98c16a162384ad878503a0bfc3ec16
author: Lennart Augustsson <lennart@augustsson.net>
date: Mon Apr 1 13:54:20 EDT 2024

Handle more recursive modules

--- a/tests/RecMdl.hs
+++ b/tests/RecMdl.hs
@@ -1,6 +1,9 @@
 module RecMdl where
 import RecMdlA
 
+data B = B1 | B2 A
+  deriving (Show)
+
 h :: Int -> Int
 h x = x + 100
 
@@ -10,3 +13,4 @@
 main :: IO ()
 main = do
   print (f 10)
+  print (B2 (A2 B1))
--- a/tests/RecMdl.hs-boot
+++ b/tests/RecMdl.hs-boot
@@ -1,2 +1,7 @@
 module RecMdl where
+import {-# SOURCE #-} RecMdlA
+
+data B = B1 | B2 A
+instance Show B
+
 h :: Int -> Int
--- a/tests/RecMdl.ref
+++ b/tests/RecMdl.ref
@@ -1,1 +1,2 @@
 222
+B2 (A2 B1)
--- a/tests/RecMdlA.hs
+++ b/tests/RecMdlA.hs
@@ -1,5 +1,8 @@
 module RecMdlA where
 import {-# SOURCE #-} RecMdl
 
+data A = A1 | A2 B
+  deriving (Show)
+
 g :: Int -> Int
 g x = h x * 2
--- /dev/null
+++ b/tests/RecMdlA.hs-boot
@@ -1,0 +1,2 @@
+module RecMdlA where
+data A
--