2023-03-12

Sunday, March 12

Was super epic massively cooked. Today I epicly failed my interview with Functionally. Turns out doing 5grams of Panama White is a fantasic way for the brain to be cooked as fucked as possible for an interview🥲. I

t was some generic recursion question but I managed to totally blow it, lol. The worst part is I knew exactly what I should be doing, and even described my approach, but I just couldn’t implement it. Reeeeeeeeeeeeeeeeeeeeeeeeeeeee.

In the end I think maybe my recent work with Purescript has messed it up. In Purescript youd write it like this:

type rec :: List x -> Int
let rec ls = 
    Nil = Nil
    { x : xs } = x : rec xs

In javascript you’d write it like

const rec = (x, xs) =>
  if (x === <something>) {return endValue}
  return someComputation(x) + rec(xs)

I even tried to implement this internally within the calling function, but I just couldn’t get it to work. I think that the problem is that is that I’m just so used to Pattern Matching now that its hard to think outside it.