Skip to main content

Home/ javascript/ Group items tagged monad

Rss Feed Group items tagged

Javier Neira

jQuery is a Monad « Important Shock - 1 views

  •  
    1. Monads aren't esoteric, abstruse computer science - they're useful. 2. You probably have used monads but just haven't realized it. 3. jQuery is awesome.
Ivan Pavlov

Monads on the Cheap I: The Maybe Monad at Oliver Steele - 0 views

  • What about the case where most products don’t have offerings, or the offerings don’t have merchants, vel cetera? If this were a frequent case, and this were inner-loop code, I might introduce a global empty object in order to reduce the object instantiation overhead (which happens right away) and the GC load (which shows up over time). E.g. define var $N={}, and use: var product = ..., merchantName = (((product||$N).offering||$N).merchant||$N).name; if (merchantName) displayMerchantName(merchantName);
1 - 2 of 2
Showing 20 items per page