Blog

Memory

My Dell XPS 8930, new in July 2020, came with 8 GB of DDR4 2666 MHz RAM (non-ECC, I assumed) in one of its four UDIMM slots. Windows 11 specifies 4 GB as the minimum memory requirement, but, recently, the system had been behaving as if it had run out of memory. I decided to […]

Pattern synonyms

Pattern synonyms are an extension to the Haskell programming language provided by GHC since GHC 7.8.1. Their definition is enabled by language extension PatternSynonyms. Their use does not require the extension. There are three forms: unidirectional, bidirectional and explicitly bidirectional. Synonyms A synonym is introduced with the keyword pattern. Synonyms have three forms: prefix, infix […]

Mechanical keyboards

The first computer keyboard that I used regularly was a mechanical one: the one built into my father’s Apple II. At some point, likely in September 2007 with an XPS 720, I acquired a wired (USB) Dell SK-8135 keyboard. Full-sized, in a UK ISO layout, it is a rubber dome keyboard but with the feel […]

The economics of OCaml

OCaml (formerly Objective Caml) is a functional programming language. I wondered if the economics of OCaml could provide a benchmark for the economics of Haskell. ML (Meta Language) influenced Caml (Categorical Abstract Machine Language) (1985) and Haskell (1990). Caml influenced OCaml (1996). Caml was developed by the French National Institute for Research in Digital Science […]

Integer linear programming

Attempting Eric Wastl’s Advent of Code introduced me to two integer linear programming problems: Both problems minimise (the objective), the first subject to: and the second subject to: . Zero vector If , then the solutions are straightforward, as: Parity Before turning to the solutions, the term ‘parity’ of an integer is used to refer […]

Complex numbers

Complex numbers are catered for in the Haskell 98 and Haskell 2010 Language Reports. The former specifies library Complex exposing module Complex and the latter (which introduced hierarchical modules names) specifies module Data.Complex. Both modules define: The RealFloat a context also implies that the type a is an instance of typeclasses Eq, Floating, Fractional, Num, […]

Symmetry

YouTube’s algorithm also presented me with videos about equations that could be solved by noticing the symmetry in their form. Example 1 Here, we notice that if then and: The odd powers of will cancel out on the expansion of the term on the left, and the even powers will appear twice, to give: We […]

The Lambert W function

YouTube’s algorithm kept presenting me with videos of equations whose solutions could be expressed in terms of the Lambet function. The function, named after Johann Heinrich Lambert (1728 to 1777), is specified by: is multivalued, even when and are real. has a single value when . That is referred to as the principal branch and […]

Executable sizes

The simplest Haskell program is main = pure (). It does nothing. It can be compiled to an executable file with GHC – for example, with GHC 9.12.2, by commanding: This command will output Main.hi, Main.o and Main.exe – the last being the executable file. We can find its size in bytes by commanding (in […]

The missing link

Two Windows 11 machines shared a Desktop folder under OneDrive. A couple of the Shortcut files in the folder, valid links to applications, were missing their icons. The problem was fixed by forcing the rebuilding the icon cache. Rebuilding the icon cache The rebuilding of the icon cache can be forced, as follows (in PowerShell): […]