Open toyboot4e opened 1 month ago
Initial plan:
Alternative approach is hacking the judge environment.
Here's an example submission code, where {- AC_PROJECT <path> -}
denotes a file distribution:
{- AC_PROJECT src/MyLib/F.hs -}
module F (f) where
f :: Int -> Int
f = (+ 1)
{- AC_PROJECT app/Main.hs -}
import MyLib.F qualified as F
main :: IO ()
main = print $ f 1
It would expand to such a project:
.
├── app/
│ └── Main.hs
└── src/
└── MyLib/
└── F.hs
Then we can use real qualified imports. Ridiculous, cheating.. but actually solid.
Allow qualified imports in user-defined libraries and bundle them into a single
Main.hs
before submission.Simple word-based replacement doesn't fully resolve name conflicts, but it's better than nothing!