
How to specify defaultExtensions in cabal (1.22) file? e.g. -fglasgow-exts or TypeSynonymInstances ?

https://www.haskell.org/cabal/users-guide/developing-packages.html might
help.
On 9 July 2015 at 20:02, Imants Cekusins
How to specify defaultExtensions in cabal (1.22) file?
e.g. -fglasgow-exts or TypeSynonymInstances
? _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-- Regards Sumit Sahrawat

Thank you Sumit. This is how far I got: if I put this right after hs-source-dirs: default-extensions: FlexibleInstances , it works: ghc asks for MultiParamTypeClasses option. However if I add FlexibleInstances, MultiParamTypeClasses - either separated with comma or on the next line, the compiler parses .cabal and tries to build however prompts for FlexibleInstances again. How would I specify >1 option?

I used to take a look at cabal files from projects that I've used and found
to work. For example, IHaskell uses a lot of extensions [1].
[1]:
https://github.com/gibiansky/IHaskell/blob/master/ihaskell.cabal#L122-L126
On 9 July 2015 at 21:32, Imants Cekusins
Thank you Sumit.
This is how far I got:
if I put this right after hs-source-dirs:
default-extensions: FlexibleInstances
, it works: ghc asks for MultiParamTypeClasses option.
However if I add FlexibleInstances, MultiParamTypeClasses - either separated with comma or on the next line, the compiler parses .cabal and tries to build however prompts for FlexibleInstances again.
How would I specify >1 option?
-- Regards Sumit Sahrawat

Cheers Sumit. it worked: default-extensions: FlexibleInstances MultiParamTypeClasses TypeSynonymInstances needed to run cabal clean, then cabal build. this needs to be specified in both library & test-suite spec section hope this helps someone.
participants (2)
-
Imants Cekusins
-
Sumit Sahrawat, Maths & Computing, IIT (BHU)