# Haskell

Published articles for Haskell.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Profunctor Optics

DevFeed: [Profunctor Optics](<https://devfeed.tech/articles/profunctor-optics-28864.md>)

Original publisher: [Read original article](<https://bartoszmilewski.com/2026/07/19/profunctor-optics/>)

Author: Bartosz Milewski

Published: 2026-07-19T11:39:02Z

Content type: article

Language: en

Sources: [Bartosz Milewski's Programming Cafe](<https://devfeed.tech/sources/bartosz-milewski-s-programming-cafe.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [modules](<https://devfeed.tech/topics/modules.md>)

Tags: [category-theory](<https://devfeed.tech/tags/category-theory.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [language](<https://devfeed.tech/tags/language.md>), [lens](<https://devfeed.tech/tags/lens.md>), [mapping](<https://devfeed.tech/tags/mapping.md>), [modules](<https://devfeed.tech/tags/modules.md>), [optics](<https://devfeed.tech/tags/optics.md>), [profunctors](<https://devfeed.tech/tags/profunctors.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [tambara-modules](<https://devfeed.tech/tags/tambara-modules.md>)

### AI overview

This article explains profunctor optics through Tannakian reconstruction. It presents optics as a category, describes lenses and their composition in Haskell, and introduces Tambara modules as a representation that simplifies optic composition.

### Source excerpt

You may think of Tannakian Reconstruction as an example of redundant encoding. It lets you replace a simple hom-set with a much more complex end that is taken over an entire functor category. Why would anyone want to do it? The answer is simple: composition! Morphisms on the left compose according to the rules of [...]

## Tambara Equipment

DevFeed: [Tambara Equipment](<https://devfeed.tech/articles/tambara-equipment-28862.md>)

Original publisher: [Read original article](<https://bartoszmilewski.com/2026/07/11/tambara-equipment/>)

Author: Bartosz Milewski

Published: 2026-07-11T08:13:34Z

Content type: article

Language: en

Sources: [Bartosz Milewski's Programming Cafe](<https://devfeed.tech/sources/bartosz-milewski-s-programming-cafe.md>)

Topics: [modules](<https://devfeed.tech/topics/modules.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [category-theory](<https://devfeed.tech/tags/category-theory.md>), [code](<https://devfeed.tech/tags/code.md>), [double-categories](<https://devfeed.tech/tags/double-categories.md>), [double-category](<https://devfeed.tech/tags/double-category.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [modules](<https://devfeed.tech/tags/modules.md>), [optics](<https://devfeed.tech/tags/optics.md>), [proarrow-equipment](<https://devfeed.tech/tags/proarrow-equipment.md>), [profunctors](<https://devfeed.tech/tags/profunctors.md>), [structure](<https://devfeed.tech/tags/structure.md>), [tambara-modules](<https://devfeed.tech/tags/tambara-modules.md>), [tannakian-reconstruction](<https://devfeed.tech/tags/tannakian-reconstruction.md>), [theory](<https://devfeed.tech/tags/theory.md>), [transformation](<https://devfeed.tech/tags/transformation.md>)

### AI overview

This article explains Tambara modules through category theory and illustrates the concepts with Haskell code. It discusses their relationship to profunctors, monoidal actions, double categories, proarrow equipment, and Tannakian reconstruction.

### Source excerpt

I was originally attracted to category theory when trying to understand Haskell optics. I was puzzled by the van Laarhoven's functor representations and Kmett's use of Tambara modules. By playing Tetris with the Yoneda lemma I was able to make some progress, attacking more and more esoteric topics. With a group of researcher and students [...]

## Actegories

DevFeed: [Actegories](<https://devfeed.tech/articles/actegories-28861.md>)

Original publisher: [Read original article](<https://bartoszmilewski.com/2026/06/30/actegories/>)

Author: Bartosz Milewski

Published: 2026-06-30T11:45:46Z

Content type: tutorial

Language: en

Sources: [Bartosz Milewski's Programming Cafe](<https://devfeed.tech/sources/bartosz-milewski-s-programming-cafe.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [actegories](<https://devfeed.tech/tags/actegories.md>), [category-theory](<https://devfeed.tech/tags/category-theory.md>), [class](<https://devfeed.tech/tags/class.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [lens](<https://devfeed.tech/tags/lens.md>), [optics](<https://devfeed.tech/tags/optics.md>), [programming](<https://devfeed.tech/tags/programming.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

This tutorial introduces actegories, explaining their relationship to monoidal categories and their role in programming optics such as lenses, prisms, and traversals. It develops the concepts through Haskell models, including tensor products, unit objects, constraints, associators, unitors, and categorical actions.

### Source excerpt

Previously: Kan Extensions in Double Categories. In programming, actegories play a central role in optics: lenses, prisms, traversals, etc. To understand actegories, let's start with the definition of a monoidal category. Monoidal Category A monoidal category is a category equipped with a tensor product. A tensor product is a functor . We assume that this [...]

## Kan Extensions in Double Categories

DevFeed: [Kan Extensions in Double Categories](<https://devfeed.tech/articles/kan-extensions-in-double-categories-28860.md>)

Original publisher: [Read original article](<https://bartoszmilewski.com/2026/06/13/kan-extensions-in-double-categories/>)

Author: Bartosz Milewski

Published: 2026-06-13T12:27:28Z

Content type: article

Language: en

Sources: [Bartosz Milewski's Programming Cafe](<https://devfeed.tech/sources/bartosz-milewski-s-programming-cafe.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [category-theory](<https://devfeed.tech/tags/category-theory.md>), [data-type](<https://devfeed.tech/tags/data-type.md>), [double-category](<https://devfeed.tech/tags/double-category.md>), [function](<https://devfeed.tech/tags/function.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [kan-extensions](<https://devfeed.tech/tags/kan-extensions.md>), [profunctor-equipment](<https://devfeed.tech/tags/profunctor-equipment.md>), [profunctors](<https://devfeed.tech/tags/profunctors.md>)

### AI overview

This article generalizes right and left Kan extensions from functors to profunctors in double categories and presents corresponding Haskell representations. It explains the associated universal and factorization properties, including their computational interpretation.

### Source excerpt

Previously: Kan extensions in Haskell. In a double category that is also a proarrow equipment, we have the ability to bend arrows. In particular, in the definition of the counit of the right Kan extension: we can bend the vertical arrow, replacing it with its horizontal conjoint . In a profunctor equipment, this is just [...]

## Kan Extensions in Haskell

DevFeed: [Kan Extensions in Haskell](<https://devfeed.tech/articles/kan-extensions-in-haskell-28859.md>)

Original publisher: [Read original article](<https://bartoszmilewski.com/2026/06/08/kan-extensions-in-haskell/>)

Author: Bartosz Milewski

Published: 2026-06-08T12:31:58Z

Content type: tutorial

Language: en

Sources: [Bartosz Milewski's Programming Cafe](<https://devfeed.tech/sources/bartosz-milewski-s-programming-cafe.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Reflex FRP](<https://devfeed.tech/topics/reflex-frp.md>)

Tags: [building](<https://devfeed.tech/tags/building.md>), [category-theory](<https://devfeed.tech/tags/category-theory.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [kan-extensions](<https://devfeed.tech/tags/kan-extensions.md>), [programming](<https://devfeed.tech/tags/programming.md>), [types](<https://devfeed.tech/tags/types.md>), [universal-arrows](<https://devfeed.tech/tags/universal-arrows.md>)

### AI overview

This article explains Kan extensions in category theory and translates their definitions and constructions into Haskell. It focuses on right Kan extensions, adjunctions, universal arrows, and pointwise constructions.

### Source excerpt

Previously: Tabulation Tribulations. If you think of functor composition as a form of multiplication, Kan extensions are an attempt to construct inverses of this multiplication. But unlike multiplication, composition is not symmetric, so we have extensions that attempt to undo precomposition, and lifts that do the same for postcomposition. Furthermore, there rarely is a single [...]

## Profunctor Equipment in Haskell

DevFeed: [Profunctor Equipment in Haskell](<https://devfeed.tech/articles/profunctor-equipment-in-haskell-28856.md>)

Original publisher: [Read original article](<https://bartoszmilewski.com/2026/05/16/profunctor-equipment-in-haskell/>)

Author: Bartosz Milewski

Published: 2026-05-16T09:47:40Z

Content type: tutorial

Language: en

Sources: [Bartosz Milewski's Programming Cafe](<https://devfeed.tech/sources/bartosz-milewski-s-programming-cafe.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [Code](<https://devfeed.tech/topics/code.md>), [Library](<https://devfeed.tech/topics/library.md>), [trust](<https://devfeed.tech/topics/trust.md>)

Tags: [category-theory](<https://devfeed.tech/tags/category-theory.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [library](<https://devfeed.tech/tags/library.md>), [profunctor-equipment](<https://devfeed.tech/tags/profunctor-equipment.md>), [profunctors](<https://devfeed.tech/tags/profunctors.md>), [programming](<https://devfeed.tech/tags/programming.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

This article presents a toy Haskell implementation of profunctor equipment. It explains how cells, composition, units, companions, and conjoints can be represented using standard library types, natural transformations, existential types, and profunctor composition, while noting limitations that would require dependent types.

### Source excerpt

Previously: Profunctor Equipment. To make things more palatable for programmers, I decided to provide a toy implementation of some of the equipments in Haskell. The advantage of this encoding is that it can be verified by the compiler, and I still trust the compiler more than I trust the AI. A more adequate implementation would [...]

## Haskell Debugger for GHC 9.14

DevFeed: [Haskell Debugger for GHC 9.14](<https://devfeed.tech/articles/haskell-debugger-for-ghc-9-14-27920.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2026-01-07-haskell-debugger-for-ghc914.html>)

Published: 2026-01-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [debugging](<https://devfeed.tech/topics/debugging.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [Neovim](<https://devfeed.tech/topics/neovim.md>), [Visual Studio Code](<https://devfeed.tech/topics/visual-studio-code.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [GitHub Issues](<https://devfeed.tech/topics/github-issues.md>)

Tags: [bytecode](<https://devfeed.tech/tags/bytecode.md>), [crashes](<https://devfeed.tech/tags/crashes.md>), [debugger](<https://devfeed.tech/tags/debugger.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [editor](<https://devfeed.tech/tags/editor.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [issue](<https://devfeed.tech/tags/issue.md>), [performance](<https://devfeed.tech/tags/performance.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [vscode](<https://devfeed.tech/tags/vscode.md>)

### AI overview

This article announces that the Haskell Debugger is ready for GHC 9.14 and explains how to install it and configure editors through the Debug Adapter Protocol. It covers VSCode and Neovim integration, project-based session configuration, robustness goals, current limitations, and planned callstack and multithreading support.

### Source excerpt

This post was first published inline to the Haskell Discourse, where there was some discussion about the debugger: 1 The Haskell Debugger for GHC 9.14 The Haskell Debugger is ready to use with GHC-9.14! The installation, configuration, and talks can be found in the official website. The tl;dr first step is installing the debugger: $ ghc --version # MUST BE GHC 9.14 The Glorious Glasgow Haskell Compilation System, version 9.14.1 $ cabal install haskell-debugger \ --allow-newer=base,time,containers,ghc,ghc-bignum,template-haskell \ --enable-executable-dynamic # ON WINDOWS, DO NOT PASS --enable-executable-dynamic ... $ ~/.local/bin/hdb --version # VERIFY IT'S THE LATEST! Haskell Debugger, version 0.11.0.0 The second step is configuring your editor to use the debugger via the Debug Adapter Protocol (DAP). - For VSCode, install the haskell debugger extension. - For Neovim, install nvim-dap and configure it for haskell-debugger - For other editors, consult your DAP documentation and let others know how! Bug reports and discussions are welcome in the haskell-debugger issue tracker. My MuniHac 2025 talk also walks through the installation, usage, and design of the debugger. Do note much has been improved since the talk was given, and much more will still improve. 1.1 A little bit more info The debugger work is sponsored by Mercury. It's the project in which I've spent most of my full working days (for almost a full year now), with the invaluable help from my team at Well-Typed. The debugger is meant to work both on trivial files and on large and complex codebases1. It is a GHC application so all features are supported. Like HLS, it also uses hie-bios to automatically configure the session based on your cabal or stack project. Robustness is a main goal of the debugger. If anything doesn't work, or if you have performance issues, or something crashes, please don't hesitate to submit a bug. We've got a small but respectable testsuite, and have tested performance by debugging G

## Lazy Linearity for a Core Functional Language (POPL 2026)

DevFeed: [Lazy Linearity for a Core Functional Language (POPL 2026)](<https://devfeed.tech/articles/lazy-linearity-for-a-core-functional-language-popl-2026-27919.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2025-11-26-lazy-linearity-popl26.html>)

Published: 2025-11-26T00:00:00Z

Content type: article

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [functional](<https://devfeed.tech/tags/functional.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [language](<https://devfeed.tech/tags/language.md>), [optimisations](<https://devfeed.tech/tags/optimisations.md>), [paper](<https://devfeed.tech/tags/paper.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

The article announces that the paper "Lazy Linearity for a Core Functional Language" will be published at POPL 2026. It explains a type system that captures linearity under Haskell's non-strict evaluation and is intended to support optimisations of linear Core programs.

### Source excerpt

I'm very proud to announce that Lazy Linearity for a Core Functional Language, a paper by myself and Bernardo Toninho, will be published at POPL 26! [DOI, ACM]. The extended version of the paper, which includes all proofs, is available here [arXiv, PDF, DOI]. The short-ish story: In 2023, for my Master's thesis, I reached out to Arnaud Spiwack to discuss how Linear Types had been implemented in GHC. I wanted to research compiler optimisations made possible by linearity. Arnaud was quick to tell me: "Well yes, but you can't!" "Even though Haskell is linearly typed, Core isn't!"1 Linearity is ignored in Core because, as soon as it's optimised, previously valid linear programs become invalid. It turns out that traditional linear type systems are too syntactic, or strict, about understanding linearity - but Haskell, regardless of linear types, is lazily evaluated. Improving optimisations would have to wait. Our paper presents a system which, in contrast, also accepts programs that can only be understood as linear under non-strict evaluation. Including the vast majority of optimised linear Core programs (with proofs!). The key ideas of this paper were developed during my Master's, but it took a few more years of on-and-off work (supported by my employer Well-Typed) with Bernardo to crystalize the understanding of a "lazy linearity" and strengthen the theoretical results. Now, the proof of the pudding is in the eating. Go read it! Abstract Traditionally, in linearly typed languages, consuming a linear resource is synonymous with its syntactic occurrence in the program. However, under the lens of non-strict evaluation, linearity can be further understood semantically, where a syntactic occurrence of a resource does not necessarily entail using that resource when the program is executed. While this distinction has been largely unexplored, it turns out to be inescapable in Haskell's optimising compiler, which heavily rewrites the source program in ways that break syntactic l

## Automatically Packaging a Haskell Library as a Swift Binary XCFramework

DevFeed: [Automatically Packaging a Haskell Library as a Swift Binary XCFramework](<https://devfeed.tech/articles/automatically-packaging-a-haskell-library-as-a-swift-binary-xcframework-27918.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2025-07-05-packaging-a-haskell-library-as-a-swift-binary-xcframework.html>)

Published: 2025-07-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [Library](<https://devfeed.tech/topics/library.md>), [Automation](<https://devfeed.tech/topics/automation.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [macOS](<https://devfeed.tech/topics/macos.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [automation](<https://devfeed.tech/tags/automation.md>), [build](<https://devfeed.tech/tags/build.md>), [building](<https://devfeed.tech/tags/building.md>), [framework](<https://devfeed.tech/tags/framework.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [library](<https://devfeed.tech/tags/library.md>), [macos](<https://devfeed.tech/tags/macos.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This tutorial presents xcframework, a Haskell library released on Hackage that automates packaging Haskell code as a Swift binary XCFramework. It explains how to build the Haskell library with Cabal, create a Swift package from the resulting artifacts, and use the package from Swift projects through XCFramework bundles and headers.

### Source excerpt

Contents 1 Announcing: xcframework 1.1 XCFrameworks 1.2 How to install xcframework 1.3 How to use the XCFramework in XCode 1.4 Building simple Swift package 1.5 Must use Cabal Foreign Library stanza 1.6 Conclusion I've written about Haskell x Swift interoperability before. Calling Haskell from Swift is about marshalling and the foreign function interface. But Creating a macOS app with Haskell and Swift tells the much messier tale of hijacking XCode to vodoo together the Haskell library, its headers, and two handfuls of other magic ingredients into one buildable SwiftUI application. Stop! Don't click on the last link. No, it turns out that my XCode sallies strayed very far from the yellow brick road. The IDE is confused. Recompilation bugs abound. Complexity is through the roof juggling .modulemaps, .xcconfig dynamic settings, and sketchy .sh scripts. Let's walk the happy path. 1 Announcing: xcframework Perhaps obvious in retrospect, the demon-less way to add a Haskell library to the dependencies of a Swift application is to build an independent Swift Package wrapping the Haskell library - something that can be done without XCode in sight. Easy peasy: Build the Haskell library using Cabal Create a Swift package from the Haskell artifacts Add the Swift package as a dependency to the project And it turns out that (1) and (2) can be merged together using Cabal SetupHooks! Moreover, I'm happy to announce I've neatly packaged and released that build process automation as a Haskell library called xcframework on Hackage. Onwards! - for what it does and how to use it. 1.1 XCFrameworks Apple introduced XCFramework bundles back in a WWDC19 session. An XCFramework is a multiplatform binary framework bundle. For our purposes, that means we can create a Swift Package just from a binary linkable artifact and a couple of header files. Then, any Swift project can depend on this binary Swift package and call the functions exposed to the headers and make sure the bundled library will

## Implementing Unsure Calculator in 100 lines of Haskell

DevFeed: [Implementing Unsure Calculator in 100 lines of Haskell](<https://devfeed.tech/articles/implementing-unsure-calculator-in-100-lines-of-haskell-27917.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2025-04-25-unsure-calculator-in-100-lines-of-haskell.html>)

Published: 2025-04-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Development](<https://devfeed.tech/topics/development.md>), [math](<https://devfeed.tech/topics/math.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [expression](<https://devfeed.tech/tags/expression.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [list](<https://devfeed.tech/tags/list.md>), [monad](<https://devfeed.tech/tags/monad.md>), [numbers](<https://devfeed.tech/tags/numbers.md>), [operations](<https://devfeed.tech/tags/operations.md>), [range](<https://devfeed.tech/tags/range.md>)

### AI overview

This tutorial implements an Unsure Calculator in Haskell. It introduces a range operator for uncertain values, models calculations with a probability monad and normal distributions, samples results using pseudo-randomness, and builds an embedded calculator expression language.

### Source excerpt

Contents 1 Unsure Calculator 1.1 Sampling it up 1.2 Calculator Expressions 1.3 Showing up 1.4 Conclusion 1 Unsure Calculator The recently trendy Unsure Calculator makes reasoning about numbers with some uncertainty just as easy as calculating with specific numbers. The key idea is to add a new "range" operator (written ~) to the vocabulary of a standard calculator. The range x~y denotes that a real value is uncertain, but we are 95% sure that it falls between x and y1. Reading the notation is easy: when you see 10~15, you say: "ten to fifteen". Arithmetic operations and friends (e.g. sin, or log) transparently operate on ranges and literal numbers alike. Calculation results in a plot with a range of values that the input expression can take, and with what frequency. The motivation behind the original article is neat, so I'll just recommend you read it there to learn how and why you'd use such a calculator. Here's a real life example they used: 1400~1700 * 0.55~0.65 - 600~700 - 100~200 - 30 - 20 Now, let's implement it. 1.1 Sampling it up Summon a probability monad from the void2. data Dist a where Return :: a -> Dist a Bind :: Dist b -> (b -> Dist a) -> Dist a Normal :: Double -> Double -> Dist Double instance Monad Dist where (>>=) = Bind instance Applicative Dist where pure = Return; (<*>) = ap instance Functor Dist where fmap = liftM The monad instance is free: pure = Return and (>>=) = Bind. The Normal constructor denotes a normal distribution given the standard deviation and mean. With do-notation we can easily construct a complex tree mixing Returns, Binds, and Normals. For instance: d = do s <- Normal 0 1 return (5 + s) desugars to d = Bind (Normal 0 1) (\s -> Return (5 + s)) Then, embue meaning onto a Dist a by allowing an a to be sampled according to the distribution the Dist represents. We use StdGen from random as a source of uniform pseudo-randomness: sample :: StdGen -> Dist a -> a sample g d = case d of Return x -> x Normal mean std_dev -> n1 * std_dev

## React for Two Computers

DevFeed: [React for Two Computers](<https://devfeed.tech/articles/react-for-two-computers-36192.md>)

Original publisher: [Read original article](<https://overreacted.io/react-for-two-computers/>)

Published: 2025-04-09T00:00:00Z

Content type: article

Language: en

Sources: [Dan Abramov](<https://devfeed.tech/sources/dan-abramov.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [haskell](<https://devfeed.tech/tags/haskell.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [react](<https://devfeed.tech/tags/react.md>)

### AI overview

A set of notes complementing a React Conf talk about React Server Components. The article explores the conceptual and behavioral differences between tags and function calls, including how naming and passed information shape developers' expectations across languages.

### Source excerpt

Two things, one origin.

## Replay '25 Day Three: Technical Deep Dives and Temporal Case Studies

DevFeed: [Replay '25 Day Three: Technical Deep Dives and Temporal Case Studies](<https://devfeed.tech/articles/replay-25-day-three-wrapping-up-in-style-35952.md>)

Original publisher: [Read original article](<https://temporal.io/blog/replay-25-day-three>)

Author: Tim Imkin

Published: 2025-03-07T00:00:00Z

Content type: article

Language: en

Sources: [Temporal Blog](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [reliability](<https://devfeed.tech/topics/reliability.md>), [Resilience](<https://devfeed.tech/topics/resilience.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Automation](<https://devfeed.tech/topics/automation.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>), [systems](<https://devfeed.tech/topics/systems.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [control-plane](<https://devfeed.tech/topics/control-plane.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>)

Tags: [access-control](<https://devfeed.tech/tags/access-control.md>), [ai](<https://devfeed.tech/tags/ai.md>), [automation](<https://devfeed.tech/tags/automation.md>), [aws](<https://devfeed.tech/tags/aws.md>), [case-studies](<https://devfeed.tech/tags/case-studies.md>), [community](<https://devfeed.tech/tags/community.md>), [control-plane](<https://devfeed.tech/tags/control-plane.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [reliability](<https://devfeed.tech/tags/reliability.md>), [resilience](<https://devfeed.tech/tags/resilience.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

A recap of the final day of Replay '25, covering reliability, database automation, production patterns, enterprise adoption, and mission-critical applications built with Temporal.

### Source excerpt

The final day of Replay '25 delivered a mix of technical deep dives and real-world case studies before concluding with an unexpected twist.

## Increasing GitHub Actions Disk Space

DevFeed: [Increasing GitHub Actions Disk Space](<https://devfeed.tech/articles/increasing-github-actions-disk-space-37725.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/github-actions-disk-space/>)

Author: Carlos Alexandro Becker

Published: 2024-11-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [GitHub Actions](<https://devfeed.tech/topics/github-actions.md>), [Filesystems](<https://devfeed.tech/topics/filesystems.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [aws](<https://devfeed.tech/tags/aws.md>), [disk-space](<https://devfeed.tech/tags/disk-space.md>), [docker](<https://devfeed.tech/tags/docker.md>), [dotnet](<https://devfeed.tech/tags/dotnet.md>), [github-actions](<https://devfeed.tech/tags/github-actions.md>), [go](<https://devfeed.tech/tags/go.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [jobs](<https://devfeed.tech/tags/jobs.md>), [nix](<https://devfeed.tech/tags/nix.md>), [space](<https://devfeed.tech/tags/space.md>), [yaml](<https://devfeed.tech/tags/yaml.md>)

### AI overview

The article explains why GitHub Actions workers can run out of disk space and describes removing unused preinstalled tools, Docker images, caches, and SDKs through YAML configuration.

### Source excerpt

A couple of days ago, all of a sudden, my jobs started running out of space.

## Planning Weekly Workouts in 100 lines of Haskell

DevFeed: [Planning Weekly Workouts in 100 lines of Haskell](<https://devfeed.tech/articles/planning-weekly-workouts-in-100-lines-of-haskell-27916.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2024-08-14-planning-a-workout-week-with-100-lines-of-haskell.html>)

Published: 2024-08-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [programming](<https://devfeed.tech/tags/programming.md>), [script](<https://devfeed.tech/tags/script.md>)

### AI overview

A short tutorial demonstrates how to build a standalone 100-line Haskell workout planner using the logict logic-programming monad. The program generates weekly schedules satisfying running and bodyweight-exercise constraints.

### Source excerpt

Contents 1 A workout planner in 100 lines of Haskell I have recently started doing some outdoors bodyweight workouts. I also want to start running again, but I'm recovering from a minor knee injury until the start of next month. Tonight I decided to put together a weekly schedule to start following next month. The first pen and paper versions were fine, but I wasn't completely satisfied. The next logical step was to write a quick program to see what possible plans I was missing. The schedule must satisfy a few constraints, but the core of it is that I should do, every week, on one axis, one short run (high-intensity) and one long run (long distance), and, on the other axis, have two pull days (as in pull-ups), two push days (as in push-ups), and two leg days (as in squats). Finding a weekly workout that satisfies certain constraints is an answer-set-programming kind of problem, best solved by some kind of logic programming. Rather than turning to Prolog or Clingo, I decided to just stick to Haskell and use the logic-programming monad from logict! 1 A workout planner in 100 lines of Haskell What follows is mostly just the demonstration of using logict applied to this particular problem. I believe the weeklySchedule function can be easily understood in general, even by anyone unfamiliar with Haskell and/or logic programming - and that's the meat of this short post and program. Note that the program is a cabal shell script which can be run by executing the script file (as in ./ScheduleExercise, as long as cabal is in path). It is standalone, and exactly 100 lines (with comments, shebangs and everything). Feel free to try and modify it! #!/usr/bin/env cabal {- cabal: build-depends: base, logict -} import Control.Applicative import Control.Monad import Control.Monad.Logic import Data.List import Data.Maybe workout = ["Push day", "Pull day", "Leg day", "No workout"] running = ["Long run", "Short run", "No run"] weekdays = ["Seg.", "Ter.", "Qua.", "Qui.", "Sex.", "Sab.", "

## Barycentric Lagrange Interpolation

DevFeed: [Barycentric Lagrange Interpolation](<https://devfeed.tech/articles/barycentric-lagrange-interpolation-40504.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/shortform/2024-06-21-1107/>)

Published: 2024-06-21T18:07:50Z

Content type: article

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [math](<https://devfeed.tech/topics/math.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Computing](<https://devfeed.tech/topics/computing.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [article](<https://devfeed.tech/tags/article.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [math](<https://devfeed.tech/tags/math.md>), [shortform](<https://devfeed.tech/tags/shortform.md>)

### AI overview

The article explains barycentric Lagrange interpolation, a numerically more stable reformulation of the classical Lagrange interpolation formula. It derives the formula by factoring a common polynomial and canceling it through an interpolation identity, while noting its relevance to polynomial approximation and its limited numerical concerns in finite-field secret sharing.

### Source excerpt

In my studies of the Remez algorithm, I learned about the barycentric Lagrange interpolation formula. The context is finding a polynomial of degree at most $n$ that passes through $n+1$ points $(x_0, y_0), \dots, (x_n, y_n)$. The classical Lagrange interpolation formula is what you'd write down if you "just did it." $$f(x) = \sum_{i=0}^n y_i \cdot \prod_{j \neq i}\frac{x - x_j}{x_i - x_j}$$ I wrote a 2014 article deriving this more gently, and implementing it in Haskell for secret sharing.

## Cradle: a simpler, more composable Haskell process library

DevFeed: [Cradle: a simpler, more composable Haskell process library](<https://devfeed.tech/articles/announcing-cradle-32396.md>)

Original publisher: [Read original article](<https://garnix.io/blog/announcing-cradle>)

Published: 2024-05-14T00:00:00Z

Content type: release

Language: en

Sources: [Garnix Blog](<https://devfeed.tech/sources/garnix-blog.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Library](<https://devfeed.tech/topics/library.md>), [Process](<https://devfeed.tech/topics/process.md>)

Tags: [haskell](<https://devfeed.tech/tags/haskell.md>), [library](<https://devfeed.tech/tags/library.md>), [process](<https://devfeed.tech/tags/process.md>)

### AI overview

An announcement for cradle, described as a simpler and more composable Haskell process library.

### Source excerpt

A simpler, more composable Haskell process library

## Calling Haskell from Swift

DevFeed: [Calling Haskell from Swift](<https://devfeed.tech/articles/calling-haskell-from-swift-27915.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2024-04-02-calling-haskell-from-swift.html>)

Published: 2024-04-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [SwiftUI](<https://devfeed.tech/topics/swiftui.md>)

Tags: [data-type](<https://devfeed.tech/tags/data-type.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [ios](<https://devfeed.tech/tags/ios.md>), [macos](<https://devfeed.tech/tags/macos.md>), [metaprogramming](<https://devfeed.tech/tags/metaprogramming.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explains how to call non-trivial Haskell functions from Swift in native macOS and iOS applications. It uses foreign function exports, argument and result marshaling, serialization of user-defined data types, and Swift interoperability so Haskell functions can be exposed through Swift structs, classes, and idiomatic interfaces.

### Source excerpt

Contents 1 Introduction 2 Marshaling Inputs and Outputs 2.1 Haskell's Perspective 2.2 Swift's Perspective 3 Metaprogramming at the boundaries 3.1 Haskell's perspective 3.2 Swift's perspective 4 Remarks This is the second installment of the in-depth series of blog-posts on developing native macOS and iOS applications using both Haskell and Swift/SwiftUI. This post covers how to call (non-trivial) Haskell functions from Swift by using a foreign function calling-convention strategy similar to that described by Calling Purgatory from Heaven: Binding to Rust in Haskell that requires argument and result marshaling. You may find the other blog posts in this series interesting: Creating a macOS app with Haskell and Swift The series of blog posts is further accompanied by a github repository where each commit matches a step of this tutorial. If in doubt regarding any step, check the matching commit to make it clearer. This write-up has been cross-posted to Well-Typed's Blog. 1 Introduction We'll pick up from where the last post ended - we have set up an XCode project that includes our headers generated from Haskell modules with foreign exports and linking against the foreign library declared in the cabal file. We have already been able to call a very simple Haskell function on integers from Swift via Haskell's C foreign export feature and Swift's C interoperability. This part concerns itself with calling idiomatic Haskell functions, which typically involve user-defined datatypes as inputs and outputs, from Swift. Moreover, these functions should be made available to Swift transparently, such that Swift calls them as it does other idiomatic functions, with user defined structs and classes. For the running example, the following not-very-interesting function will suffice to showcase the method we will use to expose this function from Haskell to Swift, which easily scales to other complex data types and functions. data User = User { name :: String , age :: Int } birthday :: Use

## Computed Properties for Haskell Records

DevFeed: [Computed Properties for Haskell Records](<https://devfeed.tech/articles/computed-properties-for-haskell-records-27914.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2023-11-30-computed-properties-for-haskell-records.html>)

Published: 2023-11-30T00:00:00Z

Content type: article

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [properties](<https://devfeed.tech/topics/properties.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [C](<https://devfeed.tech/topics/c.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [data-type](<https://devfeed.tech/tags/data-type.md>), [extension](<https://devfeed.tech/tags/extension.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [properties](<https://devfeed.tech/tags/properties.md>), [rust](<https://devfeed.tech/tags/rust.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This article explains Haskell record types and related syntax extensions, including OverloadedRecordDot and NamedFieldPuns. It then introduces computed properties by comparing Haskell records with properties in Swift, C#, and Java.

### Source excerpt

Contents 1 Records in Haskell 1.1 Overloaded Record Dot 1.2 Named Field Puns 2 Computed Properties 3 Conclusion 1 Records in Haskell Haskell has so-called record types, which are also commonly known as structs, for instance, in C, Swift, and Rust. To define a square, one would write: data Point = Point { x :: Int , y :: Int } data Square = Square { topLeft :: Point , bottomRight :: Point } mySquare = Square{ topLeft = Point{x = 0, y = 0} , bottomRight = Point{x = 2, y = 2} } mySquareWidth = x (bottomRight mySquare) - x (topLeft mySquare) In Haskell record types are just syntactic sugar for ordinary product types paired with functions that get and set these fields. In essence, the above is not fundamentally different from having the following standard product types and functions: data Point = Point Int Int data Square = Square Point Point x, y :: Point -> Int x (Point px _) = px y (Point _ py) = py topLeft, bottomRight :: Square -> Point topLeft (Square tl _) = tl bottomRight (Square _ br) = br -- And setters... 1.1 Overloaded Record Dot However, by turning on the OverloadedRecordDot syntax extension, you can use more syntactic sugar to project the fields of a record instead of using the field name as a standard function: {-# LANGUAGE OverloadedRecordDot #-} mySquareWidth = mySquare.bottomRight.x - mySquare.topLeft.x which is neat! I like OverloadedRecordDot. It looks clean and feels more like using proper property of the record data type. It is also less ambiguous for an LSP to suggest the record properties of a data type by typing after the ., than it is to suggest functions to apply to the record type argument. 1.2 Named Field Puns Since I'm already writing about records, I'll mention another extension I quite enjoy: NamedFieldPuns. Traditionally, when matching on a record, you can list the field names and bind variables to the value associated with that field. Continuing the above example: area :: Square -> Int area Square{topLeft = tl, bottomRight = br} = (br.x

## garn version v0.0.18

DevFeed: [garn version v0.0.18](<https://devfeed.tech/articles/garn-version-v0-0-18-32408.md>)

Original publisher: [Read original article](<https://garnix.io/blog/garn-v0_0_18>)

Published: 2023-11-30T00:00:00Z

Content type: release

Language: en

Sources: [Garnix Blog](<https://devfeed.tech/sources/garnix-blog.md>)

Topics: [version](<https://devfeed.tech/topics/version.md>), [Haskell](<https://devfeed.tech/topics/haskell.md>), [file](<https://devfeed.tech/topics/file.md>)

Tags: [file](<https://devfeed.tech/tags/file.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [release](<https://devfeed.tech/tags/release.md>), [version](<https://devfeed.tech/tags/version.md>)

### AI overview

A release announcement for garn v0.0.17 and v0.0.18, covering improved Haskell support and less confusing file tracking.

### Source excerpt

Release announcement for garn version v0.0.17 and v0.0.18. Includes better Haskell support, and less confusing file tracking.

## Creating a macOS app with Haskell and Swift

DevFeed: [Creating a macOS app with Haskell and Swift](<https://devfeed.tech/articles/creating-a-macos-app-with-haskell-and-swift-27913.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2023-11-10-creating-a-macos-app-with-haskell-and-swift.html>)

Published: 2023-11-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [Development](<https://devfeed.tech/topics/development.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Library](<https://devfeed.tech/topics/library.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [iOS development](<https://devfeed.tech/topics/ios-development.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>)

Tags: [development](<https://devfeed.tech/tags/development.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [ios-development](<https://devfeed.tech/tags/ios-development.md>), [library](<https://devfeed.tech/tags/library.md>), [macos](<https://devfeed.tech/tags/macos.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial series explains how to build a native Apple-platform application with a SwiftUI interface and Haskell-based data and logic. The first part covers setting up a Haskell foreign library, exposing a function through the C FFI, compiling and linking it with a Swift executable, and calling it from a SwiftUI app.

### Source excerpt

Contents 1 Hello, Swift, it's Haskell! 1.1 Setting up the SwiftUI app 1.2 Setting up a Haskell foreign library 1.3 Linking the Haskell library with the executable 1.4 The RTS must be initialized 2 Remarks 2.1 Further Reading This is the first part of an in-depth guide into developing a native applications for Apple platforms (macOS, iOS, etc.) using Haskell with Swift and SwiftUI. This is the first in a series of blog posts - covering the set-up required to call Haskell functions from Swift in an XCode project using SwiftUI. In future installements of the series, I intend to at least discuss calling functions with idiomatic Haskell types with Swift ones (both with and without marshaling), SwiftUI observation, and iOS development which requires GHC to produce code for the iOS compilation target. At the time of writing I'm using XCode 15, Cabal 3.10, and GHC 9.8. There will be some features I use that are only available in these recent versions, however, the general idea of interoperability between Haskell and Swift stands on its own regardless - the now 7 year old swift-haskell-tutorial is still similarly relevant and greatly informed my approach, despite the end result being considerably different. The end goal is to create a multi-(apple)-platform application whose UI is programmed in Swift using SwiftUI while the data and logic of the application is implemented in Haskell which is called from Swift. The series of blog posts is further accompanied by a github repository where each commit matches a step of this tutorial. If in doubt regarding any step, simply checking the matching commit for absolute confidence you are understanding the practical step correctly. Visit this link to the haskell-x-swift-project-steps repository! Furthermore, I'm writing a build tool that will facilitate setting up and building a project like this without having to go through all the manual steps: haskell-swift. This write-up has been cross-posted to Well-Typed's Blog. 1 Hello, Swift, i

## Haskell: Game Programming with GIF Streams

DevFeed: [Haskell: Game Programming with GIF Streams](<https://devfeed.tech/articles/haskell-game-programming-with-gif-streams-30819.md>)

Original publisher: [Read original article](<https://hookrace.net/blog/haskell-game-programming-with-gif-streams/>)

Published: 2023-09-06T22:00:00Z

Content type: tutorial

Language: en

Sources: [Dennis Felsing](<https://devfeed.tech/sources/dennis-felsing.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [image animation](<https://devfeed.tech/topics/image-animation.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [animation](<https://devfeed.tech/tags/animation.md>), [browser](<https://devfeed.tech/tags/browser.md>), [gif](<https://devfeed.tech/tags/gif.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [http](<https://devfeed.tech/tags/http.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

A tutorial for implementing the Snake game in Haskell using the gifstream framework. The game generates animated GIF frames through an HTTP server, displays them in a browser, and accepts WASD input from the terminal.

### Source excerpt

Note: This is translated from the German original, which was used as a homework for the Programming Paradigms course at Karlsruhe Institute of Technology a long long time ago when I was co-holding the practical courses. Snake is a computer game in which a snake has to be moved through a playing field. Eating food increases the snake's length. When the snake collides with a wall or itself the game ends. In this homework you will implement Snake in Haskell. For this you will require the framework from the gifstream repository. The output of the game happens in an animated GIF stream, which you can watch in your browser. 64 colors are supported, which can be respresented as Int tuples of (0,0,0) up to (3,3,3). type RGB = (Int,Int,Int) A single frame of a GIF is defined as a list of rows, wherein each row is a list of RGB values. type Frame = [[RGB]] The framework provides a \texttt{server} function, which runs an HTTP server on the supplied port. The server sends each client a new frame of the GIF animation at the set interval. In the passed logic function new frames will be generated dynamically. server :: PortNumber -> Int -> Logic -> IO () The Snake.hs file contains the basis for writing the Snake game. Compile the game and run it (You'll need to install the network and random Haskell packages too): $ ghc -O3 -threaded Snake.hs [1 of 2] Compiling GifStream ( GifStream.hs, GifStream.o ) [2 of 2] Compiling Main ( Snake.hs, Snake.o ) Linking Snake ... $ ./Snake Listening on http://127.0.0.1:5002/ Open the supplied address in a browser. By pressing the WASD keys in the terminal you can influence the GIF in your browser. Other participants in your network can watch the GIF stream as well, by using your network IP address instead of 127.0.0.1. Furthermore it is possible to record the GIF stream and watch it later: wget -O game.gif http://127.0.0.1:5002/ The most important function in Snake.hs is logic: logic wait getInput sendFrame = initialState >>= go where go (State ol

## Writing prettier Haskell with Unicode Syntax and Vim

DevFeed: [Writing prettier Haskell with Unicode Syntax and Vim](<https://devfeed.tech/articles/writing-prettier-haskell-with-unicode-syntax-and-vim-27911.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2023-06-21-haskell-unicode-syntax-vim.html>)

Published: 2023-06-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Vim](<https://devfeed.tech/topics/vim.md>)

Tags: [haskell](<https://devfeed.tech/tags/haskell.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [vim](<https://devfeed.tech/tags/vim.md>), [writing](<https://devfeed.tech/tags/writing.md>)

### AI overview

This tutorial explains how GHC Haskell's UnicodeSyntax extension lets programmers use Unicode symbols for selected keywords and identifiers. It also shows how Vim digraphs provide convenient two-key input for Unicode symbols, with examples of common Haskell notation and configuration options.

### Source excerpt

Contents 1 Haskell's Unicode Syntax Extension 2 Digraphs in Vim 3 Conclusion 1 Haskell's Unicode Syntax Extension Haskell (well, GHC Haskell) features an extension called UnicodeSyntax. When enabled, this extension allows the use of certain unicode symbols in place of their corresponding keywords. A great example is the forall keyword being equivalent to the unicode symbol ∀, the two of which can be used interchangebly when UnicodeSyntax is enabled. Furthermore, with Haskell being a unicode-friendly language, one can define common Haskell functions, operators or type variables using unicode symbols - which doesn't even require UnicodeSyntax to be enabled. For example, one can define the predicate ∈ on lists as an alias for elem as follows: -- 5 ∈ [1,3,5] == True (∈) :: ∀ α. Eq α => α -> [α] -> Bool (∈) = elem In practice, I use just a handful of unicode symbols both as keywords and as identifiers, but a mostly comprehensive list of the keywords that have unicode alternatives is presented in the GHC user's guide UnicodeSyntax extension page. Specifically, in most of my programs you can be sure to find the following: ∀ instead of forall, which is faster to input than the whole word. A lot of unicode type variables, α, β, τ, σ, δ, κ, ρ - they are really easy to type too. ⊸ instead of %1 ->, to use the so-called "lollipop" notation for linear functions. In my opinion, those are low-hanging niceties (with vim) that make the program look better overall, but there are others that I haven't yet reached for which you may still find good/useful. For example, there's a library in hackage, containers-unicode-symbols, which exposes multiple unicode variants of functions on containers (Maps,Sets,...) such as ∈,∉,∅,∪,∩,⊆,⊈. Finally, I usually add default-extensions: UnicodeSyntax to my cabal file to make the extension available by default on all modules. However, you can also enable it on a per module basis as usual with {-# LANGUAGE UnicodeSyntax #-} at the top of the module. 2 Dig

## God writes Haskell

DevFeed: [God writes Haskell](<https://devfeed.tech/articles/god-writes-haskell-30817.md>)

Original publisher: [Read original article](<https://hookrace.net/blog/god-writes-haskell/>)

Published: 2023-06-02T22:00:00Z

Content type: opinion

Language: en

Sources: [Dennis Felsing](<https://devfeed.tech/sources/dennis-felsing.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [quantum mechanics](<https://devfeed.tech/topics/quantum-mechanics.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>)

Tags: [arrays](<https://devfeed.tech/tags/arrays.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [programming](<https://devfeed.tech/tags/programming.md>), [quantum](<https://devfeed.tech/tags/quantum.md>), [quantum-mechanics](<https://devfeed.tech/tags/quantum-mechanics.md>), [type-system](<https://devfeed.tech/tags/type-system.md>)

### AI overview

A humorous commentary compares Haskell concepts--including lazy evaluation, immutability, linked lists, type checking, and memory retention--to ideas from quantum mechanics and the physical universe.

### Source excerpt

God famously does not play dice with the universe, but he seems to enjoy writing Haskell: Consider the wave-particle duality in quantum mechanics. Every particle behaves as a wave, as long as you haven't interacted with it. Thanks to Haskell's lazy evaluation values are also only evaluated once they are accessed (interacted with particles), and stay unevaluated thunks (waves) in the meantime. Two particles can be Quantum-entangled, so that their states depend on each other, even though the particles are seperated by any distance. In Haskell a value, whether it's evaluated yet or not, can also be shared and then used in a totally different location in the program without having to copy it. The value is even immutable, so that you can't change it from one location and thus influence the other. Similarly for entangled particles you can't manipulate one to change the state of the other particle, which might be far away and thus break the maximum speed of information. Since values are immutable they have to be cleaned up more often in Haskell than typically in imperative languages. GHC, the most commonly used Haskell compiler, allocates new data in a special area. Only after a supernova will the still-relevant data be ejected into the larger universe. Haskell beginners often use lists instead of arrays. You can't do random access in a linked list, but only access the first element and then the rest of the list. The real world also doesn't allow you random access, you are limited by the speed of light and have to go from one location to the next. Time also seems to be a linked list, not even doubly linked, since you can't go back after accessing the current element. Seems like an awkward bug. Since the Haskell type system is so good at catching bugs, you often feel like you don't even need to write tests. This is unfortunately untrue, as the strange physical bugs of our universe demonstrate: The speed of light happens to stay the same, no matter what speed you move at. Th

## Monthly Update on a Haskell Game Engine

DevFeed: [Monthly Update on a Haskell Game Engine](<https://devfeed.tech/articles/monthly-update-on-a-haskell-game-engine-27910.md>)

Original publisher: [Read original article](<http://alt-romes.github.io/posts/2023-01-01-monthly-update-on-a-haskell-game-engine.html>)

Published: 2023-01-01T00:00:00Z

Content type: opinion

Language: en

Sources: [Romes' Musings](<https://devfeed.tech/sources/romes-musings.md>)

Topics: [Haskell](<https://devfeed.tech/topics/haskell.md>), [Game engine](<https://devfeed.tech/topics/game-engine.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [shaders](<https://devfeed.tech/topics/shaders.md>), [glsl](<https://devfeed.tech/topics/glsl.md>), [Graphics](<https://devfeed.tech/topics/graphics.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [haskell](<https://devfeed.tech/tags/haskell.md>), [programming](<https://devfeed.tech/tags/programming.md>), [render](<https://devfeed.tech/tags/render.md>), [shaders](<https://devfeed.tech/tags/shaders.md>), [technical](<https://devfeed.tech/tags/technical.md>), [vulkan](<https://devfeed.tech/tags/vulkan.md>)

### AI overview

A monthly development update on Ghengin, an unreleased Haskell game engine. It describes a procedural-planets demo and outlines the engine's Vulkan renderer, FIR shaders embedded in Haskell, entity management, scene graph, render queue, and supporting libraries.

### Source excerpt

Contents 1 Ghengin 1.1 Bullets on Technical Details 1.2 The Small Victories 1.3 A peek into the code 1 Ghengin I've been working the past month or two in a game engine titled Ghengin (pronounced /ɡɛn-ʤɪn/, never /ɡɛn-ɡɪn/). This is not yet a release, and version 0.1.0 is far into the future. However, I've come a long way and I'd like to share a few pictures of my progress. This post was migrated from the discussion at the Haskell Discourse The demo I've been working on is based on Sebastian Lague's series Procedural Planets. It is a showcase of procedurally generated planets you can move around in and tweak the procedural generation parameters of the planets to create oceans and continents. Fig 1. Screenshot of planets demo 1.1 Bullets on Technical Details I hope to, soon enough, write a more substantial explanation of the engine's technical challenges and overall design decisions so far, and on the game developer's facing side of the engine. In the meantime, here are a few key points regarding the technical feats of the engine along with the main libraries it currently depends on, which help create a picture of how it is working: The renderer is written using the great bindings to the Vulkan API The shaders are crucial in the overall design, and a lot of code depends on their definition (e.g. preparing render pipelines, allocating descriptor sets and textures, everything materials related ...). The shaders are written using FIR, an amazing shader language embedded in Haskell! The entity management, scene graph and render queue are done/created through the apecs entity component system. Vectors and matrices are from geomancy GLFW-b for window management and user input (used as the window backend for vulkan) The dear-imgui bindings for the GUI JuicyPixels for loading textures FIR is a really cool shader library and unlike any you've likely tried before (it's embeded in Haskell, but that's just the start). The shader's "interfaces" are defined at the type level, and in

[Next page](<https://devfeed.tech/tags/haskell.md?cursor=WyIyMDIzLTAxLTAxVDAwOjAwOjAwKzAwOjAwIiwgIjBkZmM2NDRlLTgxOWEtNGRlMC04NWM0LTZhZjI5MWYwZWIyNyJd>)