<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Functional-Programming on Unnamed Website</title><link>https://unnamed.website/tags/functional-programming/</link><description>Recent content in Functional-Programming on Unnamed Website</description><generator>Hugo</generator><language>en-us</language><managingEditor>Anthony Wang</managingEditor><webMaster>Anthony Wang</webMaster><lastBuildDate>Sat, 27 Dec 2025 17:14:12 -0600</lastBuildDate><atom:link href="https://unnamed.website/tags/functional-programming/index.xml" rel="self" type="application/rss+xml"/><item><title>Haskelling My Typst</title><link>https://unnamed.website/posts/haskelling-my-typst/</link><pubDate>Sat, 27 Dec 2025 17:14:12 -0600</pubDate><author>Anthony Wang</author><guid>https://unnamed.website/posts/haskelling-my-typst/</guid><description>&lt;p&gt;&lt;a href="https://typst.app/"&gt;Typst&lt;/a&gt; is a typesetting system similar to LaTeX. It&amp;rsquo;s also a &lt;a href="https://justinpombrio.net/src/typst.pdf"&gt;dynamically typed programming language with value semantics&lt;/a&gt;, so of course the natural question is: Can we implement the &lt;a href="https://unnamed.website/tags/lazy-infinite-series/"&gt;Haskell lazy infinite lists trick&lt;/a&gt; in Typst?&lt;/p&gt;
&lt;p&gt;Typst doesn&amp;rsquo;t have a built-in lazy evaluation feature, but we can simulate thunks with lambdas. Basically, if we want to defer evaluating something, we&amp;rsquo;ll wrap it in a function that takes a dummy argument, and then call that function when we actually want to do the evaluation. The lists themselves will be represented as cons cells using Typst dictionaries. Here&amp;rsquo;s how to lazily map over a list:&lt;/p&gt;</description></item><item><title>RNG and Cosine in Nix</title><link>https://unnamed.website/posts/rng-cosine-nix/</link><pubDate>Sat, 12 Apr 2025 12:56:26 -0400</pubDate><author>Anthony Wang</author><guid>https://unnamed.website/posts/rng-cosine-nix/</guid><description>&lt;p&gt;NixOS is an immutable, atomic Linux distribution with a declarative and reproducible configuration and packaging system using the purely functional, lazily evaluated, dynamically typed Nix programming language.&lt;/p&gt;
&lt;style&gt;
.chardiv {
	float: left;
	width: 100px;
}
.charimg {
	height: 60px;
}
blockquote {
	min-height: 60px;
}
&lt;/style&gt;
&lt;div class="chardiv"&gt;
	&lt;img src="https://unnamed.website/img/char/kublai.png" class="charimg"&gt;
&lt;/div&gt;
&lt;blockquote&gt;&lt;strong&gt;Kublai&lt;/strong&gt;:
AAAAAAHHH too many buzzwords, what does that all mean???&lt;/blockquote&gt;

&lt;p&gt;Glad you asked! Basically, in NixOS, you can configure your entire system using a &lt;code&gt;configuration.nix&lt;/code&gt; file and NixOS will magically (using a bunch of Bash scripts) figure out what needs to be installed and how to do it. For instance, if you want to enable Firefox, you&amp;rsquo;d add &lt;code&gt;programs.firefox.enable = true;&lt;/code&gt; to your &lt;code&gt;configuration.nix&lt;/code&gt;. Easy as that.&lt;/p&gt;</description></item><item><title>Haskelling My Python</title><link>https://unnamed.website/posts/haskelling-my-python/</link><pubDate>Sat, 05 Apr 2025 13:08:44 -0400</pubDate><author>Anthony Wang</author><guid>https://unnamed.website/posts/haskelling-my-python/</guid><description>&lt;link rel="stylesheet" href="https://unnamed.website/katex/katex.min.css" crossorigin="anonymous"&gt;
&lt;script defer src="https://unnamed.website/katex/katex.min.js" crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;script defer src="https://unnamed.website/katex/contrib/auto-render.min.js" crossorigin="anonymous" onload="renderMathInElement(document.body, {delimiters: [{left: '$', right: '$', display: false}, {left: '\\(', right: '\\)', display: false}, {left: '\\[', right: '\\]', display: true}, {left: '\\begin{equation}', right: '\\end{equation}', display: true}, {left: '\\begin{equation*}', right: '\\end{equation*}', display: true}, {left: '\\begin{align}', right: '\\end{align}', display: true}, {left: '\\begin{align*}', right: '\\end{align*}', display: true}]});"&gt;&lt;/script&gt;

&lt;p&gt;A few years ago, Pleng showed me &lt;a href="https://tcpc.me/2021/12/20/lazy-power-series-integration.html"&gt;a really cool trick&lt;/a&gt; you can do with lazy infinite lists in Haskell.&lt;/p&gt;
&lt;style&gt;
.chardiv {
	float: left;
	width: 100px;
}
.charimg {
	height: 60px;
}
blockquote {
	min-height: 60px;
}
&lt;/style&gt;
&lt;div class="chardiv"&gt;
	&lt;img src="https://unnamed.website/img/char/kublai.png" class="charimg"&gt;
&lt;/div&gt;
&lt;blockquote&gt;&lt;strong&gt;Kublai&lt;/strong&gt;:
Oh no, not Haskell! 😱&lt;/blockquote&gt;

&lt;p&gt;Don&amp;rsquo;t worry. There will be no mandatory Haskell in this post (although it is a really nice language which you should check out!). Instead, today &lt;a href="https://erikz.xyz"&gt;Erik&lt;/a&gt; asked me if that trick also works using infinite Python generators, and turns out it does!&lt;/p&gt;</description></item></channel></rss>