Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concat-plugin sometimes generates "Failed to load interface for ... hidden module" #14

Closed
ryantrinkle opened this issue Jul 7, 2017 · 2 comments

Comments

@ryantrinkle
Copy link

The presence of imports sometimes causes ccc to try to load hidden modules, which causes compilation to fail. For example, this module:

{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -fplugin=ConCat.Plugin -fplugin-opt ConCat.Plugin:trace #-}
module LoadsHiddenModule where

import ConCat.AltCat

import qualified Data.Aeson

f :: a -> a
f = ccc @(->) (\x -> x)

will produce output like this:

[1 of 1] Compiling LoadsHiddenModule ( LoadsHiddenModule.hs, LoadsHiddenModule.o )
go ccc (->): \ (x_adEQ :: a_adF0) -> x_adEQ :: a_adF0 -> a_adF0
Doing lam Id
user error (Errors:
<interactive>:1:1: error:
    Failed to load interface for ‘Data.Attoparsec.Text.Internal’
    it is a hidden module in the package ‘attoparsec-0.13.1.0’
    Use -v to see a list of the files searched for.
Warnings:)

However, if the import qualified Data.Aeson is removed, compilation will succeed and work as expected.

@conal
Copy link
Collaborator

conal commented Jul 7, 2017

Thanks for the report. I have a fragile workaround, and I'm working on a real solution, which requires that I remove hidden modules from the set of orphan modules (transitively for the module being compiled). Much of GHC is still pretty mysterious to me.

I'd love to hear about what you're up to with compiling to categories.

@conal conal closed this as completed in 14eaf2a Jul 7, 2017
@conal
Copy link
Collaborator

conal commented Jul 7, 2017

@ryantrinkle I think it's fixed now. Fragile workaround banished! Please give it a spin, and let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants