News for hackers. Stuff that matters.
Re:Real World Haskell by asplake on Friday November 06, 2020 @12:47PM (#25009527)
Immediately confronted by 9 compiler extension directives, major turnoff to this interested newbie. Is this considered normal and acceptable?
Re:Real World Haskell by aszen on Friday November 06, 2020 @01:02PM (#25009675)
I think this is considered normal for real world Haskell usage.

Most libraries and even frameworks like ihp that try to be favor ease of use rely on these language extensions. You can ofcourse place these directives once in the cabal file, but there's no getting around to learning what they do.

Re:Real World Haskell by iso8859-1 on Friday November 06, 2020 @04:09PM (#25011175)
With GHC2021, you may soon be able to simply put that instead, and it will imply enabling all those individually.

https://www.reddit.com/r/haskell/comments/je1t82/does_the_id...

Re:Real World Haskell by Iceland_jack on Sunday November 08, 2020 @01:13AM (#25023511)
It comes with the territory for a fast moving language with new extensions like -XDerivingVia[1] -XLinearTypes[2], more often than not backed by a publication where its interaction with other features is considered. Some extensions are purely syntactic and are quickly understood -XLambdaCase[3] -XBlockArguments[4] -XMultiWayIf[5]. The compiler will suggest missing extensions. There is enough to hs98 for a lifetime of study (see work of Graham Hutton[6] and Jeremy Gibbons[7])

[1] https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/deri...

[2] https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/line...

[3] https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/lamb...

[4] https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/bloc...

[5] https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/mult...

[6] https://twitter.com/haskellhutt

[7] https://twitter.com/jer_gib

Re:Real World Haskell by tome on Friday November 06, 2020 @02:24PM (#25010334)
Why a turnoff? "Extension" just means "language feature that is thoroughly well-specified, well-tested and widely used but hasn't made it into the language standard (partly because there hasn't been one for ten years)".
Re:Real World Haskell by lallysingh on Friday November 06, 2020 @02:51PM (#25010550)
Yes. They're normal here, and you can consider them about as significant as an import statement, some context when reading the code, but nothing crazy.

The extensions are very well vetted, and new versions of the language standard can be summed up as "enable extensions a, b, c by default." Plus library changes, of course.

Re:Real World Haskell by kccqzy on Friday November 06, 2020 @03:56PM (#25011048)
Are you looking at production code or pedagogical examples? For the former, it's totally normally to use compiler-specific features. If you are scared off by that, you'd be better served reading a book that introduces things little by little.