Haskell platform proposal: split package
Henning Thielemann
lemming at henning-thielemann.de
Fri Jul 20 23:25:47 CEST 2012
On Fri, 20 Jul 2012, Brent Yorgey wrote:
> Use of GHC.Exts
> ---------------
>
> At the request of a user, the 0.1.4.3 release switched from defining
> its own version of the standard 'build' function, to importing it from
> GHC.Exts. This allows GHC to do more optimization, resulting in
> reported speedups to uses of splitEvery, splitPlaces, and
> splitPlacesBlanks. However, this makes the library GHC-specific. If
> any reviewers think this is an issue I would be willing to go back to
> defining build by hand, or use CPP macros to select between build
> implementations based on the compiler.
You could provide two private modules with the same name in different
directories, one that re-exports 'build' from GHC.Exts and one with a
custom definition of 'build' for non-GHC compilers. Then set
'Hs-Source-Dirs' in Cabal according to the impl(ghc). No CPP needed, only
Cabal. One could even think of a separate package for this purpose.
The only type extension you use, is GADTs, right? It looks like you use it
for an Eq constraint in Delimiter/DelimSublist. That is, you actually need
only ExistentialQuantification. Is it necessary?
More information about the Libraries
mailing list