Welcome to my blog!

I am a Chinese college student in Wuhan Univ. Intereted in topics of a wide range including FP, PLT, Architecture, UI/UX and a lot more. Know something about C#, TypeScript, Haskell, Rust and frameworks related.

Posts

12 Feb 2025

Nix Should Focus on the Static

Cause # My Firefox on NixOS met a problem: everytime the home environment is rebuilt, the ~/.mozilla folder must be removed for home-manager to set up configs. Therefore, all stored information, including those that cannot be generated from Nix like history, passwords, etc. are lost. Blaming Nix for overriding those information is almost the sudden reaction. However, home-manager is just doing its job: reproduce the same thing. The problem is that we’re requiring something that should not be considered part of reproducibility - which is exactly the opposite.

6 Sep 2024

Easy Way Understanding Fix

Introduction # Fix point of $f: A \rightarrow A$ is $x \in A$ such that $f(x)=x$. fix in haskell is used to find the (least) fix point for a function, which has the type (a -> a) -> a. It’s also widely used as a helper function for writing recursive functions. But how, and why? Fix and Recursive Functions # Generalise Recursive Function # We can first describe recursive functions without using the word “recursive”.

20 Jun 2024

Position of Web Components

Problem # Web Components are widely misused. Guides and frameworks invest a lot of time and resources into upgrading web components into something capable of handling state. However, state should not be handled by web components. It doesn’t mean that they can’t hold states; actually, handling states here refers to 2 facts: Be used to build business-level logics. Reactivity is considered a feature. And this is what’s happening with Lit, one of the most powerful and popular web component building framework.