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

bower install in the example asks a bunch of questions i don't know the answer to #14

Closed mwotton closed 7 years ago

mwotton commented 7 years ago

might it be possible to encode a working version in bower.json or something?

eskimor commented 7 years ago

Which compiler are you on? psc-0.10 or still 0.9?

mwotton commented 7 years ago

No idea, I'm a Haskell+servant hacker getting my feet wet with purescript through this project. What should I use?

On Tue, Dec 20, 2016, 2:58 AM Robert Klotzner notifications@github.com wrote:

Which compiler are you on? psc-0.10 or still 0.9?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eskimor/servant-purescript/issues/14#issuecomment-268178992, or mute the thread https://github.com/notifications/unsubscribe-auth/AAELgmJJK_fSb_iSJZuPpPsJmJ4eVzCNks5rJ4rAgaJpZM4LQxCF .

eskimor commented 7 years ago

Please try with current master and purescript-0.9.x. purescript-0.10.x is not yet supported.

commandodev commented 7 years ago

I'm having similar problems. I rolled back to ps version 0.9.2 and tried again. bower install still asked me to manually resolve a lot of version conflicts:

Unable to find a suitable version for purescript-console, please choose one by typing one of the numbers below:
    1) purescript-console#^1.0.0 which resolved to 1.0.0 and is required by purescript-aff#1.1.0, purescript-servant-support#5.0.0, purescript-subscriber#1.1.2
    2) purescript-console#^1.0.0-rc.1 which resolved to 1.0.0 and is required by purescript-psci-support#1.0.0
    3) purescript-console#^2.0.0 which resolved to 2.0.0 and is required by purescript-psci-support#2.0.0

Prefix the choice with ! to persist it to bower.json

? Answer 1

Unable to find a suitable version for purescript-eff, please choose one by typing one of the numbers below:
    1) purescript-eff#^1.0.0 which resolved to 1.0.0 and is required by purescript-console#1.0.0, purescript-eff-functions#1.0.0, purescript-exceptions#1.0.0, purescript-pux#5.0.3, purescript-react#1.3.0, purescript-refs#1.0.0, purescript-st#1.0.0, purescript-var#0.2.0
    2) purescript-eff#~1.0.0 which resolved to 1.0.0 and is required by purescript-websocket-simple#0.4.0
    3) purescript-eff#^2.0.0 which resolved to 2.0.0 and is required by purescript-console#2.0.0

Prefix the choice with ! to persist it to bower.json

? Answer 1

Unable to find a suitable version for purescript-prelude, please choose one by typing one of the numbers below:
    1) purescript-prelude#~1.0.1 which resolved to 1.0.1 and is required by purescript-signal#6.1.0
    2) purescript-prelude#^1.0.0 which resolved to 1.0.1 and is required by purescript-eff#1.0.0
    3) purescript-prelude#^1.0.1 which resolved to 1.1.0 and is required by purescript-form-urlencoded#1.0.0
    4) purescript-prelude#^2.1.0 which resolved to 2.1.0 and is required by purescript-eff#2.0.0

Prefix the choice with ! to persist it to bower.json

? Answer 1

Unable to find a suitable version for purescript-psci-support, please choose one by typing one of the numbers below:
    1) purescript-psci-support#^1.0.0 which resolved to 1.0.0 and is required by central-counter
    2) purescript-psci-support#^2.0.0 which resolved to 2.0.0

Prefix the choice with ! to persist it to bower.json

? Answer 1

and then pulp psci give me the following:

$ pulp psci
Error 1 of 4:

  at C:\workspace\ext\dev\hs\cortex-dash\frontend\bower_components\purescript-newtype\src\Data\Newtype.purs line 26, column 19 - line 26, column 19

    Unable to parse module:
    unexpected |
    expecting no indentation or end of input

  See https://github.com/purescript/purescript/wiki/Error-Code-ErrorParsingModule for more information,
  or to contribute content related to this error.

Error 2 of 4:

  at C:\workspace\ext\dev\hs\cortex-dash\frontend\bower_components\purescript-functors\src\Data\Functor\Compose.purs line 26, column 1 - line 26, column 1

    Unable to parse module:
    unexpected type wildcard

  See https://github.com/purescript/purescript/wiki/Error-Code-ErrorParsingModule for more information,
  or to contribute content related to this error.

Error 3 of 4:

  at C:\workspace\ext\dev\hs\cortex-dash\frontend\bower_components\purescript-functors\src\Data\Functor\Coproduct.purs line 39, column 1 - line 39, column 1

    Unable to parse module:
    unexpected type wildcard

  See https://github.com/purescript/purescript/wiki/Error-Code-ErrorParsingModule for more information,
  or to contribute content related to this error.

Error 4 of 4:

  at C:\workspace\ext\dev\hs\cortex-dash\frontend\bower_components\purescript-functors\src\Data\Functor\Product.purs line 30, column 1 - line 30, column 1

    Unable to parse module:
    unexpected type wildcard

  See https://github.com/purescript/purescript/wiki/Error-Code-ErrorParsingModule for more information,
  or to contribute content related to this error.

Any pointers?

eskimor commented 7 years ago

Please try again with new master and delete any packages that don't compile (I don't know why they are being installed):

rm -Rf bower_components/purescript-functors
rm -Rf bower_components/purescript-newtype
commandodev commented 7 years ago

Great - that seems to be working! One other problem though: I've ended up with this line

import GHC.Types (Double)

In the generated code. What should I use on the Haskell side instead of Double?

Thanks for the help :-)

commandodev commented 7 years ago

So scanning through the code it looks like I'd need to add something for Number to PSTypes say psNumber and something like intBridge to Primitives and then either extend defaultBridge or make my own version

Is that about right? Anything else I'd need to do?

eskimor commented 7 years ago

That sounds right - jep. purescript-bridge is extensible, you can either define your own bridge based on defaultBridge or (for such a general purpose type better) you can add it to defaultBridge and send me a PR.

legrostdg commented 7 years ago

for Double: https://github.com/eskimor/purescript-bridge/pull/18