title: How to define custom Rule in Shake: Development.Shake.Core is hidden
body: <p>I am trying to use Shake which look very promising but I hit a small wall. I am quite new to haskell so maybe I am missing something obvious but here is my problem:</p>
  
  <p>I want to define a new kind of Rule in my shake program. This rule would compute a value from dependencies and let shake store it in its database. So if the dependencies are up to date, the shake db value is always valid.</p>
  
  <pre><code>data PrjList = PrjList FilePath deriving (Typeable,Show,Eq,Hashable,Binary,NFData)
  
  instance Rule PrjList [(String,FilePath)] where
      validStored q a = True
  
  -- Generate the dependency
  getProjectList :: FilePath -&gt; Action [(String,FilePath)]
  getProjectList dir = apply1 $ PrjList dir
  
  -- We want to traverse recursivly all subdir but stop once we find a BuildConfig file
  defaultProjectList :: Rules ()
  defaultProjectList = defaultRule $ \(PrjList dir) -&gt; Just $ do
       -- blabla...
       return []
  </code></pre>
  
  <p>However, if I try to <code>import Development.Shake.Core</code> I have</p>
  
  <pre><code>Could not find module `Development.Shake.Core'
  It is a member of the hidden package `shake-0.7'.
  it is a hidden module in the package `shake-0.7'
  it is a hidden module in the package `shake-0.8'
  Use -v to see a list of the files searched for.
  </code></pre>
  
  <p>And If I don't import it, I have</p>
  
  <pre><code>`validStored' is not a (visible) method of class `Rule'
  </code></pre>
  
  <p>So how can one define new rules?</p>
  
  <p>Bonus question is: is my idea interesting or is there a better way to do it? When thinking about how to use shake, I had lots of rules which would have this behavior. This avoid having lots of temporary file and take advantage of the shake db. In fact my next step would be to try to define a generic rules for "filesystem free rules". User would just have to provide a <code>key → Maybe (Action value)</code> function.</p>