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

Alexander Berntsen alexander at plaimi.net
Fri Aug 19 13:08:39 UTC 2016


-----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-----


More information about the Haskell-Cafe mailing list