eskimor / servant-purescript

Translate servant API to purescript code, with the help of purescript-bridge.
BSD 3-Clause "New" or "Revised" License
105 stars 44 forks source link

Trouble compiling generated code with pulp build #23

Closed nlander closed 7 years ago

nlander commented 7 years ago

I am trying to compile the generated code with pulp build and so far I have gotten three compile errors. generated_purescript_error_1 That error was easy to fix: generated_purescript_error_1_fix The second error was: generated_purescript_error_2 It was also easy to fix: generated_purescript_error_2_fix The third error I got has me and my coworkers a bit stumped: generated_purescript_error_3a generated_purescript_error_3b generated_purescript_error_3c Any help understanding what is going on here would be appreciated.

eskimor commented 7 years ago

What servant-purescript version are you using?

legrostdg commented 7 years ago

@nlander Could you use text instead of images? It would help visually impaired people.

nlander commented 7 years ago

I am using the version that comes with stackage lts 7.19, which is 0.3.1.5

nlander commented 7 years ago

@legrostdg here is the third compile error in text form: Error found: in module ServerAPI at /home/nlander/clearnexus-chrome-extension/src/Client/ServerAPI.purs line 28, column 1 - line 45, column 31

 Could not match type

   Error

  with type

    AjaxError

while solving type class constraint

  Control.Monad.Error.Class.MonadError AjaxError
                                       (Aff t3)

while checking that expression \email ->
                                 \access_token ->
               (bind ask) (\$2 ->
                             ...
                          )
  has type forall eff m.
             ( MonadReader (SPSettings_ SPParams_) m
         , MonadError Error m
        , MonadAff
            ( ajax :: AJAX
         | eff
         )
         m
        ) => UriEmail -> Token -> m EmailProperties    
while applying a function (bind (#dict Bind t0)) (ask (#dict MonadAsk t3 t4))
 of type (t0 -> t1 t2) -> t1 t2
  to argument \$2 ->
            case $2 of
              spOpts_' -> let
                       ...
                  in ...

in value declaration getApiEmailByEmail

where t1 is an unknown type
     t2 is an unknown type
     t0 is an unknown type
      t3 is an unknown type`
legrostdg commented 7 years ago

@nlander "man github-markdown-syntax". You can prefix everything with 4 spaces, to have a nice looking code block.

legrostdg commented 7 years ago

update your version of servant-purescript, 0.3.1.5 is outdated.

nlander commented 7 years ago

I updated to servant-purescript-0.6.0.0 and everything built fine. Thanks!