notes.mackieburgess

What I think about while reading things.

2023-10-08

Conventional Comments

Conventional Comments

This seems like a neat way to reduce mental overhead, but also might be slightly over-engineered. If I were to start using this I’d probably use:

  • Suggestion: non-blocking idea, a different/better way to do things.
  • For future reference: maybe not useful here, but good to know.
  • Todo: small, trivial, but necessary change.
  • {nothing}: an issue with the code that needs to be addressed.

Overall I’m still undecided on how much messages should be annotated, especially in a non-email context. I’ve recently been enjoying bolding the important part(s) of a message, especially when dealing with busy people.

There is also Conventional Commits. Lately I’ve been enjoying using Gitmoji to label my commits, which really strikes the balance of being minimal yet declarative.

2023-10-08

An alternative frontend for Haskell?

gilmi.me – An alternative frontend for Haskell?

Interesting article, but for me it’s mostly useful for exposing Haskell footguns that I won’t have heard of before.

slow functions like foldl

TIL, IIRC it’s notably fast in OCaml due to tail recursion? I looked into this and it seems foldl builds a massive ‘thunk’ (subroutine), so foldl' should be used instead. This Haskell wiki article was pretty helpful.

Remove type String = [Char] and promote strict Text to be the one true string type in its stead.

I should get into the habit of making sure I use Unicode everywhere, even if my project doesn’t necessarily need it.

Modules...

  1. We can make all module imports qualified by default, and use an expose keyword instead to import unqualified.
  2. We can compile qualified module exports to multiple module imports.
  3. We can split and merge source files to single or multiple source files to achieve what we want.

I don’t know too much about modules in FP, but I’m pretty sure OCaml can do these things. You can definitely specify multiple modules in one file:

module Foo = struct
  let x = 5
end

module Bar = struct
  let x = 6
end

Apparently in OCaml you can define mutually dependent modules through recursive modules. I don’t really understand the benefit of this?

~ fin ~