Urgent.News

What's breaking now, across hundreds of outlets.

Tech

I kept writing Hindley-Milner signatures in my comments, so I made them type-check

A few years ago I worked my way through Professor Frisby's Mostly Adequate Guide to Functional Programming . Chapter 7, "Hindley-Milner and Me", has signatures in comments like these: // strLength :: String -> Number const strLength = s => s . length ; // join :: String -> [String] -> String const join = curry ( ( what , xs ) => xs . join ( what ) ) ; // replace :: Regex -> String -> String ->…

In the article "HinMil: Type-checking JavaScript with Hindley-Milner signatures," the author describes a language server and CLI that type-checks JavaScript against comments containing signatures. The idea stems from the functional programming guide "Mostly Adequate Guide to Functional Programming" by Professor Frisby, which used comments to document functions, specifying the input, output, and their relationship.

The author found this helpful, as these signatures only serve as comments and are not checked by the system. The author developed HinMil, which type-checks JavaScript based on the signatures in the comments, allowing for a functional style without the need for a compiler. The article notes that while functional programming in JavaScript was popular around 2015-2017, it has largely been absorbed into everyday JavaScript development, with concepts like map, filter, and reduce replacing loops, and functional style being used in React and Redux.

HinMil caters to developers who already write JavaScript using this style, or have existing JavaScript codebases they don't want to convert to TypeScript. The signatures in HinMil are a dialect of Hindley-Milner, incorporating JavaScript-specific elements such as curried functions, objects as records, JavaScript types (null, undefined, any), and type classes without instances.

The author provides an example of how HinMil modifies a piece of code, highlighting the signatures, displaying errors, and updating types as the user types.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

New Balance Data Breach: 3.7 Million Store Records Exposed Through a Hacked Marketing Vendor. What Does Yours Collect?

Your online store probably sends customer data to more places than you think. The New Balance data breach shows why that matters.

  • New Balance Japan's breach exposed 3.74 million records from its online store.
  • PLAID, a Tokyo-based marketing vendor, was the source of the unauthorized access.
  • Exposed data included customer numbers, gender, date of birth, and last purchased product.

A "Try for free" click shouldn't cost a first-time buyer $1.26 and five minutes

Every Actor we publish has a health check that answers one question: does a real run return real rows? Two of our Actors passed that check every time.

  • "Try for free" click cost $1.26 and 5 minutes for first-time buyers
  • Default settings caused sequential HTTP requests and URL decoding issues
  • Adjusting defaults reduced runtime to 90 seconds and cost to $0.0056

The Newer YOLO Model Had Better mAP. It Counted Sheep Worse.

I nearly shipped a newer YOLO model because the headline benchmark said it was better. The iOS app already bundled yolov8n . I exported yolo11n , yolo26n , yolo11s and yolo26s to CoreML.

  • Newer YOLO models outperformed in benchmarks but had counting errors with sheep.
  • Older model predicted 262 sheep, newer models predicted 278 and 301 respectively.
  • Deployment pipeline's performance, not model architecture, ultimately mattered.

More from Tuesday, 1 December 2026 →