Note that there are some explanatory texts on larger screens.

plurals
  1. POHaskell Error "Not in scope: data constructor"
    primarykey
    data
    text
    <p>I've reviewed the other posts on this error, and I don't think I'm making any of those mistakes.</p> <p>Not in scope: data constructor 'Extraction'.</p> <p>Configuration.hs:</p> <pre><code>module Configuration (Config , columns , headers , types , totals , extractions, Extraction , xState , xDivisions , xOffice ...) where ... data Extraction = Extraction { xState :: String , xDivisions :: Maybe [String] , xOffice :: Maybe String } deriving Show data Config = Config { columns :: String , headers :: [String] , types :: [String] , totals :: [String] , extractions :: [Extraction] } deriving Show ... </code></pre> <p>PIF.hs:</p> <pre><code>module PIF (...) where import Configuration ... data Report = Report { division :: String , state :: String , office :: String , inSection :: Bool , content :: [String] } deriving Show ... extract :: Config -&gt; [Report] -&gt; [Report] extract c = filter f where f Report { division=d, state=s, office=o, inSection=_, content=_ } = map or $ map isMatch $ extractions c where isMatch | Extraction { xState=xS, xDivisions=Just xD, xOffice=Nothing } = s==xS &amp;&amp; (map or $ map (==d) xD) | Extraction { xState=xS, xDivisions=Nothing, xOffice=Just xO } = s==xS &amp;&amp; o==xO </code></pre> <p>Let me know if you need more information. Thanks.</p> <p>Here is my corrected <code>extract</code>:</p> <pre><code>extract c = filter f where f Report { division=d, state=s, office=o, inSection=_, content=_ } = or $ map isMatch $ extractions c where isMatch x = case ((xDivisions x), (xOffice x)) of (Nothing, Just y) -&gt; s==(xState x) &amp;&amp; o==y (Just y, Nothing) -&gt; s==(xState x) &amp;&amp; (or $ map (==d) y) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload