Magicloud Magiclouds | 3 Apr 07:45 2013
Picon

Fwd: [Yesod] Type issue when migrating to new yesod

Hi,
  I have a yesod project that used to be compilable. Now when I migrate it to latest yesod, it failed compiling.

---------- Forwarded message ----------
From: Magicloud Magiclouds <magicloud.magiclouds <at> gmail.com>
Date: Tue, Apr 2, 2013 at 9:32 PM
Subject: Re: [Yesod] Type issue in new yesod
To: "yesodweb <at> googlegroups.com" <yesodweb <at> googlegroups.com>


Sure.
The error message is as following. And the new code is here: http://pastebin.com/sqCkeY2q

[12 of 13] Compiling Handler.FetchProcessPathRollup ( Handler/FetchProcessPathRollup.hs, dist/build/Handler/FetchProcessPathRollup.o )

Handler/FetchProcessPathRollup.hs:43:16:
    No instance for (PersistUnique
                       (Data.Conduit.Internal.ConduitM
                          (containers-0.5.0.0:Data.Map.Base.Map Text Text)
                          ProcessPathRollup
                          (ResourceT
                             (Database.Persist.GenericSql.Raw.SqlPersist (GHandler App App)))))
      arising from a use of `getKey'
    Possible fix:
      add an instance declaration for
      (PersistUnique
         (Data.Conduit.Internal.ConduitM
            (containers-0.5.0.0:Data.Map.Base.Map Text Text)
            ProcessPathRollup
            (ResourceT
               (Database.Persist.GenericSql.Raw.SqlPersist (GHandler App App)))))
    In a stmt of a 'do' block:
      reportKey <- getKey
                     (UniqueReport (t "Report")) (Report (t "Report"))
    In the expression:
      do { let t = (!) r
               d = liftM fst . double . t
               ....;
           reportKey <- getKey
                          (UniqueReport (t "Report")) (Report (t "Report"));
           lineitemKey <- getKey
                            (UniqueLineitem (t "LineItem Name") (t "LineItem Id"))
                            (Lineitem (t "LineItem Id") (t "LineItem Name"));
           mainProcessKey <- getKey
                               (UniqueMainProcess (t "Main Process"))
                               (MainProcess (t "Main Process"));
           .... }
    In the second argument of `($)', namely
      `\ r
         -> do { let ...;
                 reportKey <- getKey
                                (UniqueReport (t "Report")) (Report (t "Report"));
                 .... }'



On Tue, Apr 2, 2013 at 7:32 PM, Michael Snoyman <michael <at> snoyman.com> wrote:
Can you provide the new source code and the new compiler error message?


On Tue, Apr 2, 2013 at 11:18 AM, Magicloud Magiclouds <magicloud.magiclouds <at> gmail.com> wrote:
Sorry, the first error about CSV was due to parsePPR's type. If I set it type, then CSV error was gone. And the error of PersistUnique reported on first getKey call, instead of processPPR call.


On Tue, Apr 2, 2013 at 2:50 PM, Michael Snoyman <michael <at> snoyman.com> wrote:
This doesn't look like it's anything to do with Yesod; it looks like a problem with the usage of conduit and csv-conduit. Did you try following the GHC recommendation and adding a type signature to parsePPR?


On Tue, Apr 2, 2013 at 8:09 AM, Magicloud Magiclouds <magicloud.magiclouds <at> gmail.com> wrote:
Hi,
  I have a yesod project that used to be compilable. Now when I migrate it to latest yesod, it failed compiling.

  The failed part is here: http://pastebin.com/pWn5FdeS .
  And the error message is:

Handler/FetchProcessPathRollup.hs:27:30:
    No instance for (Data.CSV.Conduit.CSV
                       Data.ByteString.Internal.ByteString
                       (containers-0.5.0.0:Data.Map.Base.Map a0 Text))
      arising from a use of `intoCSV'
    The type variable `a0' is ambiguous
    Possible fix: add a type signature that fixes these type variable(s)
    Note: there is a potential instance available:
      instance (Data.CSV.Conduit.CSV
                  s (csv-conduit-0.5.1:Data.CSV.Conduit.Types.Row s'),
                Ord s', Data.String.IsString s) =>
               Data.CSV.Conduit.CSV s (MapRow s')
        -- Defined in `Data.CSV.Conduit'
    Possible fix:
      add an instance declaration for
      (Data.CSV.Conduit.CSV
         Data.ByteString.Internal.ByteString
         (containers-0.5.0.0:Data.Map.Base.Map a0 Text))
    In the first argument of `(=$=)', namely `intoCSV defCSVSettings'
    In the second argument of `($$+-)', namely
      `(intoCSV defCSVSettings
        =$= parsePPR (zonedTimeToUTC day) k =$ sinkPersist)'
    In a stmt of a 'do' block:
      responseBody src
      $$+-
        (intoCSV defCSVSettings
         =$= parsePPR (zonedTimeToUTC day) k =$ sinkPersist)

Handler/FetchProcessPathRollup.hs:27:57:
    No instance for (PersistUnique
                       (Data.Conduit.Internal.ConduitM
                          (containers-0.5.0.0:Data.Map.Base.Map a0 Text)
                          ProcessPathRollup
                          (ResourceT
                             (Database.Persist.GenericSql.Raw.SqlPersist (GHandler App App)))))
      arising from a use of `parsePPR'
    Possible fix:
      add an instance declaration for
      (PersistUnique
         (Data.Conduit.Internal.ConduitM
            (containers-0.5.0.0:Data.Map.Base.Map a0 Text)
            ProcessPathRollup
            (ResourceT
               (Database.Persist.GenericSql.Raw.SqlPersist (GHandler App App)))))
    In the first argument of `(=$)', namely
      `parsePPR (zonedTimeToUTC day) k'
    In the second argument of `(=$=)', namely
      `parsePPR (zonedTimeToUTC day) k =$ sinkPersist'
    In the second argument of `($$+-)', namely
      `(intoCSV defCSVSettings
        =$= parsePPR (zonedTimeToUTC day) k =$ sinkPersist)'

--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Yesod Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yesodweb+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.



--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane