Profpatsch,
@Profpatsch@mastodon.xyz avatar

on, the most useless function in base. There’s really never a situation where inlining it doesn’t make the code easier to understand.

jaror,
jaror avatar

@Profpatsch compare `on` length to me seems much nicer than \x y -> compare (length x) (length y)

Profpatsch,
@Profpatsch@mastodon.xyz avatar

@jaror I disagree. The function does not carry it's complexity budget, similar to curry/uncurry

jaror,
jaror avatar

Would you also say that syntactic sugar like [1,2,3] doesn't carry its complexity budget? Should we always use 1:2:3:[] instead?

I don't necessarily disagree, but you'd get quite a different language.

Profpatsch,
@Profpatsch@mastodon.xyz avatar

@jaror No, I specifically say "on" does not carry its complexity budget. Is the first tweet so hard to understand

Profpatsch,
@Profpatsch@mastodon.xyz avatar

@jaror maybe the idea behind a complexity budget is not well known in programming, I would not be surprised

jaror,
jaror avatar

@Profpatsch Are you implying syntactic sugar doesn't count towards the complexity budget? I'm just trying to test my understanding of the complexity budget by applying it to other things in the language.

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@Profpatsch I think maybe the name is a bit terse and ambiguous, but I appreciate the combinator being available. Homogeneous binary functions are fairly common (lots of operators) and precomposing a projection on both arguments is not uncommon when dealing with nested record structure. But, if pointed style is preferred or encouraged, I do think its utility is minimal.

kosmikus,
@kosmikus@functional.cafe avatar

@Profpatsch Hmm, I quite like it.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • haskell
  • DreamBathrooms
  • InstantRegret
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • modclub
  • Youngstown
  • ngwrru68w68
  • slotface
  • osvaldo12
  • kavyap
  • mdbf
  • thenastyranch
  • JUstTest
  • everett
  • cubers
  • cisconetworking
  • normalnudes
  • Durango
  • anitta
  • khanakhh
  • tacticalgear
  • tester
  • provamag3
  • megavids
  • Leos
  • lostlight
  • All magazines