google / ghc-source-gen

Library for generating Haskell source files and code fragments.
BSD 3-Clause "New" or "Revised" License
91 stars 29 forks source link

Support arithmetic sequences. #70

Closed jinwoo closed 4 years ago

jinwoo commented 4 years ago

from : [a .. ] fromThen : [a, b .. ] fromTo : [a .. b] fromThenTo: [a, b .. c]

These are needed before supporting list comprehensions (#64).

judah commented 4 years ago

Looks good! The ghc-8.4 build is failing (lts-12.8); can you please take a look? You can reproduce it locally with stack test --resolver=lts-12.8. https://app.circleci.com/pipelines/github/google/ghc-source-gen/173/workflows/cc51481d-10dc-450c-b3bf-f5de2d9f2086/jobs/780/steps

Fixing it will probably require CPP; you can see what we've done elsewhere in the file. In this case I think (without looking too closely) you can just use noPostTcExpr like we do for recordConE, maybe inside a new helper function (up to you): http://hackage.haskell.org/package/ghc-8.4.4/docs/HsExpr.html#t:HsExpr

jinwoo commented 4 years ago

Thanks. I think it's fixed now. The code is also simpler.