Skip to content

Comment on Examples of Lisp formatting through historyparent

Comments

I actually like the first one best, and would prefer a case-lambda even more. Once it becomes available we can write

  foo x y = x >>= \case
    Leaf -> ..
    Branch l r -> ..
modulo whatever syntax gets chosen. That would save an unnecessary temporary variable. (See https://groups.google.com/group/haskell-cafe/browse_thread/t...)

Temporary variables clutter up the name space. While reading code you have to look for shadowing, or whether that variable is ever used again.

Agree about case lambda (and consequently that I could have chosen a better example).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.