Reexport GHC.Integer.Logarithms from base

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Reexport GHC.Integer.Logarithms from base

Andrew Martin
The packages integer-simple and integer-gmp each provide a module named
GHC.Integer.Logarithms. In both packages, this module exports identical
functions. The two useful ones are:

1. integerLog2#
2. integerLogBase#

There is a third function wordLog2# that not as helpful since its
implementation is trivial. It would be really nice to be able to use the
two integer logarithm functions and only incur a dependency on base. The
easiest way to accopmlish this would be to reexport the module from
base. However, I'm fine with any other approach that ends up making these
functions more accessible. Are there good reasons not to do this? Do
others feel like this should/shouldn't be done? Thanks for any further
input.

-Andrew Martin
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Reexport GHC.Integer.Logarithms from base

Bas van Dijk-2
+1

This would make packages like integer-logarithms and scientific simpler to define since they don't need to add conditional compilation to support integer-simple.

I would go even further and reexport GHC.Integer from base as well. We now have that capability with Cabal's reexported-modules field[1].

Bas



On 8 January 2017 at 22:50, Andrew Martin <[hidden email]> wrote:
The packages integer-simple and integer-gmp each provide a module named
GHC.Integer.Logarithms. In both packages, this module exports identical
functions. The two useful ones are:

1. integerLog2#
2. integerLogBase#

There is a third function wordLog2# that not as helpful since its
implementation is trivial. It would be really nice to be able to use the
two integer logarithm functions and only incur a dependency on base. The
easiest way to accopmlish this would be to reexport the module from
base. However, I'm fine with any other approach that ends up making these
functions more accessible. Are there good reasons not to do this? Do
others feel like this should/shouldn't be done? Thanks for any further
input.

-Andrew Martin
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Reexport GHC.Integer.Logarithms from base

Bas van Dijk-2
An alternative for reexporting GHC.Integer and GHC.Integer.Logarithms from base is reexporting them from a new package: integer. base could then depend on integer. I'm always in favour of simplifying base so maybe this is the better way.

On 15 January 2017 at 17:39, Bas van Dijk <[hidden email]> wrote:
+1

This would make packages like integer-logarithms and scientific simpler to define since they don't need to add conditional compilation to support integer-simple.

I would go even further and reexport GHC.Integer from base as well. We now have that capability with Cabal's reexported-modules field[1].

Bas



On 8 January 2017 at 22:50, Andrew Martin <[hidden email]> wrote:
The packages integer-simple and integer-gmp each provide a module named
GHC.Integer.Logarithms. In both packages, this module exports identical
functions. The two useful ones are:

1. integerLog2#
2. integerLogBase#

There is a third function wordLog2# that not as helpful since its
implementation is trivial. It would be really nice to be able to use the
two integer logarithm functions and only incur a dependency on base. The
easiest way to accopmlish this would be to reexport the module from
base. However, I'm fine with any other approach that ends up making these
functions more accessible. Are there good reasons not to do this? Do
others feel like this should/shouldn't be done? Thanks for any further
input.

-Andrew Martin
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries



_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Reexport GHC.Integer.Logarithms from base

Bas van Dijk-2
Something like this:


On 15 January 2017 at 17:46, Bas van Dijk <[hidden email]> wrote:
An alternative for reexporting GHC.Integer and GHC.Integer.Logarithms from base is reexporting them from a new package: integer. base could then depend on integer. I'm always in favour of simplifying base so maybe this is the better way.

On 15 January 2017 at 17:39, Bas van Dijk <[hidden email]> wrote:
+1

This would make packages like integer-logarithms and scientific simpler to define since they don't need to add conditional compilation to support integer-simple.

I would go even further and reexport GHC.Integer from base as well. We now have that capability with Cabal's reexported-modules field[1].

Bas



On 8 January 2017 at 22:50, Andrew Martin <[hidden email]> wrote:
The packages integer-simple and integer-gmp each provide a module named
GHC.Integer.Logarithms. In both packages, this module exports identical
functions. The two useful ones are:

1. integerLog2#
2. integerLogBase#

There is a third function wordLog2# that not as helpful since its
implementation is trivial. It would be really nice to be able to use the
two integer logarithm functions and only incur a dependency on base. The
easiest way to accopmlish this would be to reexport the module from
base. However, I'm fine with any other approach that ends up making these
functions more accessible. Are there good reasons not to do this? Do
others feel like this should/shouldn't be done? Thanks for any further
input.

-Andrew Martin
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries




_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries