Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.

Sign Up

Articles related to "haskell"

Little partial application challenge in Haskell

  • Correct a function that maps a list of negative numbers.
  • A function that I wrote but that results in a mistake.
  • The challenge is to solve it with partial application.
  • Personally, I think the lambda solution is perfect without partial application because it is easy to read.
  • But for the purposes of this challenge, here is a partial application solution.
  • I don't have a Haskell environment to test with, but I tested the equivalent in F#.
  • It works, I checked.
  • That's a pretty clever solution.
  • Very close.
  • Huh, this works verbatim in F#.
  • No HKT or type classes, so each structure in F# has its own map implementation.
  • I'm not sure why it doesn't work in Haskell tbh.
  • Possibilities are that (+) is not recognized as integer addition.
  • Or that the negative sign on -1 is parsed as a function.
  • Indeed, Haskell is picky.

save | comments | report | share on

This 22-year-old was a Business Insider intern 3 years ago. Now he's a state senator who pulled off one of the biggest upsets of the year.

  • On November 2, 22-year-old Will Haskell flipped one of the most entrenched seats in the Connecticut state senate from red to blue.
  • Connecticut's 26th senate district has been held by Republicans since Richard Nixon was president.
  • And its incumbent, Toni Boucher, had worked in the legislature since before Haskell was born.
  • But with a nimble digital strategy, a campaign that involved a lot of door-knocking, and a pair of endorsements from former President Barack Obama and Senator Chris Murphy, Haskell ousted Boucher and helped Democrats tie the state's senate.
  • Before all that, Haskell worked at Business Insider.
  • He says it's because he prioritized knocking on doors and for reaching voters on Instagram, Facebook, and Twitter.
  • Haskell says he wants to meet voters where they already are, whether on the street or on their phones.

save | comments | report | share on