2

Quite surprisingly, I'm trying to fix a compilation warning missing-export-lists by adding explicitly the elements imported one by one for a specific module, but somehow there is something magical that this module is implicitly exporting that I can't find....

is it possible to retrieve what is exported implicitly with ghc ?

Here is an example of my issue, Yesod is generating some code with TH and quasiquotes :

{-# LANGUAGE EmptyDataDecls             #-}
{-# LANGUAGE FlexibleContexts           #-}
{-# LANGUAGE GADTs                      #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE QuasiQuotes                #-}
{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE TypeFamilies               #-}
import           Control.Monad.IO.Class  (liftIO)
import           Database.Persist
import           Database.Persist.Sqlite
import           Database.Persist.TH

share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
Person
    name String
    age Int Maybe
    deriving Show
|]

Then let's say we use that generated code that way :

people <- selectList
    (       [PersonAge >. 25, PersonAge <=. 30]
        ||. [PersonName /<-. ["Adam", "Bonny"]]
        ||. ([PersonAge ==. 50] ||. [PersonAge ==. 60])
    )
    []
liftIO $ print people

Now I want to put share in a specific module and control precisely what I'm exporting from that code generated.

I don't know how it generates PersonName and PersonAge ! I don't how to specifically import these 2 types for example...

Will Ness
  • 70,110
  • 9
  • 98
  • 181
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42
  • 5
    Could you give some more details on exactly which module, what's not being imported, etc.? The most helpful thing to supply would be an error message detailing exactly what is not in scope. It's very hard to answer this question without any of this information. – bradrn May 24 '19 at 13:14
  • @bradrn I have added more information... Thx for the feedback.. – Nicolas Henin May 26 '19 at 07:36
  • Thanks for adding more info - it makes more sense now. – bradrn May 26 '19 at 08:04

0 Answers0