halive icon indicating copy to clipboard operation
halive copied to clipboard

`default-extensions` from cabal file is not taken

Open kayhide opened this issue 7 years ago • 2 comments

With a new stack project, this code works fine with halive.

Lib.hs

{-# LANGUAGE TupleSections #-}
module Lib
    ( someFunc
    ) where

someFunc :: IO ()
someFunc = print $ (3,) 4

But when moving the language pragma from the source file to cabal settings like:

library
  hs-source-dirs:      src
  exposed-modules:     Lib
  ...
  default-extensions:  TupleSections

Despite stack build success, halive fails to compile saying:

************************* Compilation Errors, Waiting...      *************************

src/Lib.hs:6:20: error: Illegal tuple section: use TupleSections

Is there any way to make this work? Maybe, a way of providing default extensions to halive?

I have tried this with the head of master of this repository (a1ddda47b348c212ffbcb63881eb0fc2779cb828).

Thanks.

kayhide avatar May 12 '17 09:05 kayhide

Tricky! Nice find.

On May 12, 2017, at 2:02 AM, kayhide [email protected] wrote:

With a new stack project, this code works fine with halive.

Lib.hs

{-# LANGUAGE TupleSections #-} module Lib ( someFunc ) where

someFunc :: IO () someFunc = print $ (3,) 4 But when moving the language pragma from the source file to cabal settings like:

library hs-source-dirs: src exposed-modules: Lib ... default-extensions: TupleSections Despite stack build success, halive fails to compile saying:

************************* Compilation Errors, Waiting... *************************

src/Lib.hs:6:20: error: Illegal tuple section: use TupleSections Is there any way to make this work? Maybe, a way of providing default extensions to halive?

I have tried this with the head of master of this repository (a1ddda4 https://github.com/lukexi/halive/commit/a1ddda47b348c212ffbcb63881eb0fc2779cb828).

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lukexi/halive/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/AABhbtGyWOWgJ-xnKfpf2-YkkNZ-osJ4ks5r5CASgaJpZM4NZBYF.

schell avatar May 12 '17 16:05 schell

I implemented a solution allowing you to set project-wide GHC extensions in a configuration file in my fork.

saschaheylik avatar Mar 18 '21 23:03 saschaheylik