bravit / hid-examples

Examples to accompany the book "Haskell in Depth"
BSD 3-Clause "New" or "Revised" License
257 stars 93 forks source link

stack lts-18 and GH CI action #12

Closed juhp closed 2 years ago

juhp commented 2 years ago

This updates stack.yaml to lts-18 (sorting the extra-deps). Also bump fin to allow 0.2. And add a GH Ci to test building.

BTW I would suggest also to drop package.yaml, which is deprecated by recent stack. It doesn't lead to good workflow. I can add that change too if you don't mind.

bravit commented 2 years ago

Thanks, @juhp!

kharus commented 2 years ago

Hi @juhp, If you have a version without package.yaml around can you please push it to your fork? I'm curious to check how it works.

juhp commented 2 years ago

Hi @juhp, If you have a version without package.yaml around can you please push it to your fork? I'm curious to check how it works.

@kharus : I think you can just delete your package.yaml file (and git reset hid-examples.cabal if needed) for that.

juhp commented 2 years ago

I don't understand but when I run stack repl SunTimes gives me compilation errors somehow:

/var/home/petersen/haskell/hid-examples/suntimes/SunTimes.hs:22:40: error:
    • Expecting two more arguments to ‘MyApp (SunTimes UTCTime)’
      Expected a type, but
      ‘MyApp (SunTimes UTCTime)’ has kind
      ‘* -> * -> *’
    • In the type signature:
        getSunTimesUTC :: GeoCoords -> When -> MyApp (SunTimes UTCTime)
   |
22 | getSunTimesUTC :: GeoCoords -> When -> MyApp (SunTimes UTCTime)
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^

/var/home/petersen/haskell/hid-examples/suntimes/SunTimes.hs:38:37: error:
    • Expecting two more arguments to ‘MyApp (SunTimes ZonedTime)’
      Expected a type, but
      ‘MyApp (SunTimes ZonedTime)’ has kind
      ‘* -> * -> *’
    • In the type signature:
        getSunTimes :: GeoCoords -> When -> MyApp (SunTimes ZonedTime)
   |
38 | getSunTimes :: GeoCoords -> When -> MyApp (SunTimes ZonedTime)
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^

/var/home/petersen/haskell/hid-examples/suntimes/SunTimes.hs:56:43: error:
    • Expecting two more arguments to ‘MyApp TimeZone’
      Expected a type, but ‘MyApp TimeZone’ has kind ‘* -> * -> *’
    • In the type signature:
        lookupTimeZone :: GeoCoords -> UTCTime -> MyApp TimeZone
   |
56 | lookupTimeZone :: GeoCoords -> UTCTime -> MyApp TimeZone
   |                                           ^^^^^^^^^^^^^^

This is particularly strange since it does not happen with stack build... and also the type errors don't make sense to me?

If anyone has any ideas would like to know.

kharus commented 2 years ago

I have the same issue with SunTimes