[web-devel] Esqueleto error messages

Erik de Castro Lopo mle+hs at mega-nerd.com
Thu Oct 25 14:49:07 CEST 2012


Felipe Almeida Lessa wrote:

> What are those messages?

Messages resulting from a single incorrect identifier below.
I actually now notice that error for line 76 point to the
specific cause, while the multiple errors flagged for line
62 just confuse matters. Part of the confusion is that I
tend to look at error messages from top to bottom, possibly
from my long term work in C and C++. I'm not sure if the top
to bottom approach to reading error messages is valid for
Haskell.

Cheers,
Erik

blog.hs:62:15:
    Couldn't match type `SqlPersist'
                   with `SqlPersist IO (PersonGeneric SqlPersist)'
    When using functional dependencies to combine
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity a)) (Entity a),
        arising from the dependency `a -> r'
        in the instance declaration in `Database.Esqueleto.Internal.Sql'
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity (PersonGeneric SqlPersist)))
        (Entity
           (SqlPersist IO (SqlPersist IO (PersonGeneric SqlPersist)))),
        arising from a use of `select' at blog.hs:62:15-20
    In the expression: select
    In a stmt of a 'do' block:
      people <- select
                $ from
                  $ \ p
                      -> do { where_ (p ^. PersonAge >=. val age);
                              return p }

blog.hs:62:15:
    Couldn't match type `PersonGeneric' with `SqlPersist IO'
    When using functional dependencies to combine
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity a)) (Entity a),
        arising from the dependency `a -> r'
        in the instance declaration in `Database.Esqueleto.Internal.Sql'
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity (PersonGeneric SqlPersist)))
        (Entity
           (SqlPersist IO (SqlPersist IO (PersonGeneric SqlPersist)))),
        arising from a use of `select' at blog.hs:62:15-20
    In the expression: select
    In a stmt of a 'do' block:
      people <- select
                $ from
                  $ \ p
                      -> do { where_ (p ^. PersonAge >=. val age);
                              return p }

blog.hs:62:15:
    Couldn't match type `SqlPersist IO (PersonGeneric SqlPersist)'
                   with `SqlPersist'
    When using functional dependencies to combine
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity a)) (Entity a),
        arising from the dependency `r -> a'
        in the instance declaration in `Database.Esqueleto.Internal.Sql'
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity (PersonGeneric SqlPersist)))
        (Entity
           (SqlPersist IO (SqlPersist IO (PersonGeneric SqlPersist)))),
        arising from a use of `select' at blog.hs:62:15-20
    In the expression: select
    In a stmt of a 'do' block:
      people <- select
                $ from
                  $ \ p
                      -> do { where_ (p ^. PersonAge >=. val age);
                              return p }

blog.hs:62:15:
    Couldn't match type `SqlPersist IO' with `PersonGeneric'
    When using functional dependencies to combine
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity a)) (Entity a),
        arising from the dependency `r -> a'
        in the instance declaration in `Database.Esqueleto.Internal.Sql'
      Database.Esqueleto.Internal.Sql.SqlSelect
        (SqlExpr (Entity (PersonGeneric SqlPersist)))
        (Entity
           (SqlPersist IO (SqlPersist IO (PersonGeneric SqlPersist)))),
        arising from a use of `select' at blog.hs:62:15-20
    In the expression: select
    In a stmt of a 'do' block:
      people <- select
                $ from
                  $ \ p
                      -> do { where_ (p ^. PersonAge >=. val age);
                              return p }

blog.hs:76:32:
    Couldn't match expected type `PersonGeneric backend0'
                with actual type `BlogPostGeneric backend1'
    Expected type: EntityField (PersonGeneric backend0) a0
      Actual type: EntityField (BlogPostGeneric backend1) String
    In the second argument of `(^.)', namely `BlogPostTitle'
    In the first argument of `asc', namely `(b ^. BlogPostTitle)'



-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the web-devel mailing list