[Haskell-cafe] Proposal: (.:) operator in base.
i.caught.air at gmail.com
Fri Aug 19 14:51:54 UTC 2016
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 (:
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 at plaimi.net
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> -----END PGP SIGNATURE-----
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe