[Haskell-cafe] Proposal: (.:) operator in base.

Theodore Lief Gannon tanuki at gmail.com
Fri Aug 19 18:16:59 UTC 2016


Well... there's that rather worrisome introductory paragraph of the
Data.Composition docs, though:

"This module is for convenience and demonstrative purposes more than it is
for providing actual value. I do not recommend that you rely on this module
for performance-sensitive code. Because this module is not based on
Prelude's (.), some chances at optimization might be missed by your
compiler."

On Fri, Aug 19, 2016 at 7:51 AM, Alex Belanger <i.caught.air at gmail.com>
wrote:

> I didn't even know about the composition package. I just wanted it to be
> readily available to everyone.
>
> A quick look, `composition` seems really nice and is probably more aligned
> with Haskell ecosystem's philosophy of keeping base to what is only stricly
> needed by GHC.
>
> These were some valuable feedback. I think I got my answer and we can let
> the thread die (:
>
> Much appreciated,
> Alex
>
> On Aug 19, 2016 9:08 AM, "Alexander Berntsen" <alexander at plaimi.net>
> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA512
>>
>> On 18/08/16 23:57, Mike Ledger wrote:
>> > IMO: I've never seen a compelling use of this; I think it decreases
>> > clarity, and barely shaves off any characters from equivalent "pointful"
>> > expressions.
>>
>> I think it quite compelling. An example:
>>
>> asSeconds :: Hour h -> Minute m -> Second s -> Second t
>> - -- | asSeconds take some 'TimeUnit's and convert them to 'Second's.
>> asSeconds h m s = MkSecond $ 3600 * timeVal h + 60 * timeVal m + timeVal s
>>
>> hmsToDiffTime :: Hour h -> Minute m -> Second s -> DiffTime
>> - -- | 'hmsToDiffTime' converts time of day in hours, minutes and seconds
>> to the
>> - -- time from midnight as a 'DiffTime'.
>> hmsToDiffTime = (secondsToDiffTime . timeVal) .:. asSeconds
>>
>>
>> As for putting it in base -- meh. I use the composition package, or
>> define it myself. So I agree with Oleg; -1.
>> - --
>> Alexander
>> alexander at plaimi.net
>> https://secure.plaimi.net/~alexander
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v2
>>
>> iQIcBAEBCgAGBQJXtwTXAAoJENQqWdRUGk8BP/UQAIcKzqVRhkVs0qtFDneTpSIi
>> jLPPXMELbMnQe/ZQH2c5SaVM4+eDJIky33FEzrh9FWMeDftz1QFrsC+pPq+5/Esw
>> U3h1HJrAJKl+zZ/bC1GQj9ObWKNROj3jEEt9pyNBcoHpxVnCohD3Y6Gx2LknE7m0
>> hnFlO0rCZZamk+pSeSlmLkkDM/MNxTx/FQcuZT0omxZtvzrz4cN7a069Gx35C+vr
>> RK6NpiD5NUqTvMCL0zeI2yRpg2GV2PQcwV0CEWjLCsJYMcoeiF8+prSBdwzatgjH
>> 7k1bHUdGwvcRzB74dyxIOPyHBgIDUFzj7bcE+NT0V20WXaz/Jgl73zZaIG9XtW19
>> aJ+RzW+aBSLEh8+uERc+Al9NpM9dLR94mDWIK/MZWEmlFHo8+W/md27+OxvM5BOr
>> YCRpoQYeYDkepTAyRK2wRlszFXydDze8K6PMAq4DUE7xtUXofEbcodWA0quLxP4N
>> ro2A8E4kqnO6BVD7iN+qch8TxmEiVYpqZnAjNz8eSyQCdn9UORpcMLT8yQ963nml
>> 17yKRjHYDwg/g8EC1UjqJ9KwVFRhqQwdk//IupRyZ/5PPkEChy8t/ZjmmGKfLy0H
>> CfhpRiNi0ozR+bYpUJcOdNM0ckCzgq5++9+M643RGjNWvD4fKDI8idNNn9eLlcom
>> kaABFBC5Gbx2O6/rgpHc
>> =X/Rb
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160819/d505769b/attachment.html>


More information about the Haskell-Cafe mailing list