Build #1 for structural-traversal-0.1.0.0

[all reports]

Package structural-traversal-0.1.0.0
Install BuildFailed
Docs NotTried
Tests NotTried
Time submitted 2016-11-25 18:20:37.017991 UTC
Compiler ghc-8.0.1.20161018
OS linux
Arch x86_64
Dependencies base-4.9.0.0, mtl-2.2.1, template-haskell-2.11.0.0
Flags none

Code Coverage

No Code Coverage was submitted for this report.

Build log

[view raw]

Resolving dependencies...
Configuring mtl-2.2.1...
Building mtl-2.2.1...
Installed mtl-2.2.1
Downloading structural-traversal-0.1.0.0...
Configuring structural-traversal-0.1.0.0...
Building structural-traversal-0.1.0.0...
Failed to install structural-traversal-0.1.0.0
Build log ( /home/builder/.cabal/logs/structural-traversal-0.1.0.0.log ):
cabal: Entering directory '/tmp/cabal-tmp-22384/structural-traversal-0.1.0.0'
Configuring structural-traversal-0.1.0.0...
Building structural-traversal-0.1.0.0...
Preprocessing library structural-traversal-0.1.0.0...
[1 of 5] Compiling Data.StructuralTraversal.Class ( src/Data/StructuralTraversal/Class.hs, dist/build/Data/StructuralTraversal/Class.o )
[2 of 5] Compiling Data.StructuralTraversal.Indexing ( src/Data/StructuralTraversal/Indexing.hs, dist/build/Data/StructuralTraversal/Indexing.o )
[3 of 5] Compiling Data.StructuralTraversal.TH ( src/Data/StructuralTraversal/TH.hs, dist/build/Data/StructuralTraversal/TH.o )

src/Data/StructuralTraversal/TH.hs:17:5: error:
    • The constructor ‘DataD’ should have 6 arguments, but has been given 5
    • In the pattern: DataD _ tyConName typArgs dataCons _
      In a case alternative:
          DataD _ tyConName typArgs dataCons _
            -> createInstance tyConName typArgs dataCons
      In the expression:
        case dt of {
          DataD _ tyConName typArgs dataCons _
            -> createInstance tyConName typArgs dataCons
          NewtypeD _ tyConName typArgs dataCon _
            -> createInstance tyConName typArgs [dataCon]
          _ -> fail "Unsupported data type" }

src/Data/StructuralTraversal/TH.hs:29:16: error:
    • Couldn't match type ‘[Dec] -> Dec’ with ‘Dec’
      Expected type: Q [Dec]
        Actual type: Q [[Dec] -> Dec]
    • In a stmt of a 'do' block:
        return
          [InstanceD
             (concat preds)
             (AppT
                (ConT className)
                (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
             [FunD upName upClauses, FunD downName downClauses]]
      In the expression:
        do { (upClauses, preds) <- unzip
                                   <$> mapM (createClause upName) dataCons;
             (downClauses, _) <- unzip
                                 <$> mapM (createClause downName) dataCons;
             return
               [InstanceD
                  (concat preds)
                  (AppT
                     (ConT className)
                     (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
                  [...]] }
      In an equation for ‘createInstance’:
          createInstance tyConName typArgs dataCons
            = do { (upClauses, preds) <- unzip
                                         <$> mapM (createClause upName) dataCons;
                   (downClauses, _) <- unzip
                                       <$> mapM (createClause downName) dataCons;
                   return
                     [InstanceD
                        (concat preds)
                        (AppT
                           (ConT className)
                           (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
                        ...] }
            where
                varToTraverseOn :: Q Name
                varToTraverseOn
                  = case reverse typArgs of {
                      (PlainTV last : _) -> return last
                      (KindedTV last StarT : _) -> return last
                      (KindedTV last _ : _)
                        -> fail $ "The kind of the last type parameter is not *"
                      [] -> fail $ "The kind of type " ++ show tyConName ++ " is *" }
                createClause :: Name -> Con -> Q (Clause, [Pred])
                createClause funN (RecC conName conArgs)
                  = createClause' funN conName (map (\ (_, _, r) -> r) conArgs)
                createClause funN (NormalC conName conArgs)
                  = createClause' funN conName (map snd conArgs)
                createClause funN (InfixC conArg1 conName conArg2)
                  = createClause' funN conName [snd conArg1, ....]
                ....

src/Data/StructuralTraversal/TH.hs:29:35: error:
    • Couldn't match expected type ‘Maybe Overlap’
                  with actual type ‘[Pred]’
    • In the first argument of ‘InstanceD’, namely ‘(concat preds)’
      In the expression:
        InstanceD
          (concat preds)
          (AppT
             (ConT className)
             (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
          [FunD upName upClauses, FunD downName downClauses]
      In the first argument of ‘return’, namely
        ‘[InstanceD
            (concat preds)
            (AppT
               (ConT className)
               (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
            [FunD upName upClauses, FunD downName downClauses]]’

src/Data/StructuralTraversal/TH.hs:30:35: error:
    • Couldn't match type ‘Type’ with ‘[Pred]’
      Expected type: Cxt
        Actual type: Type
    • In the second argument of ‘InstanceD’, namely
        ‘(AppT
            (ConT className)
            (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))’
      In the expression:
        InstanceD
          (concat preds)
          (AppT
             (ConT className)
             (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
          [FunD upName upClauses, FunD downName downClauses]
      In the first argument of ‘return’, namely
        ‘[InstanceD
            (concat preds)
            (AppT
               (ConT className)
               (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
            [FunD upName upClauses, FunD downName downClauses]]’

src/Data/StructuralTraversal/TH.hs:33:34: error:
    • Couldn't match expected type ‘Type’ with actual type ‘[Dec]’
    • In the third argument of ‘InstanceD’, namely
        ‘[FunD upName upClauses, FunD downName downClauses]’
      In the expression:
        InstanceD
          (concat preds)
          (AppT
             (ConT className)
             (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
          [FunD upName upClauses, FunD downName downClauses]
      In the first argument of ‘return’, namely
        ‘[InstanceD
            (concat preds)
            (AppT
               (ConT className)
               (foldl AppT (ConT tyConName) (map getTypVarTyp (init typArgs))))
            [FunD upName upClauses, FunD downName downClauses]]’
cabal: Leaving directory '/tmp/cabal-tmp-22384/structural-traversal-0.1.0.0'
cabal: Error: some packages failed to install:
structural-traversal-0.1.0.0 failed during the building phase. The exception
was:
ExitFailure 1