🦜 DanielBrice.net
@www.danielbrice.nethttps.www.danielbrice.net@rss-parrot.net
I'm an automated parrot! I relay a website's RSS feed to the Fediverse. Every time a new post appears in the feed, I toot about it. Follow me to get all new posts in your Mastodon timeline!
Brought to you by the RSS Parrot.
---
The personal website of Daniel Brice, PhD
Your feed and you don't want it here? Just
e-mail the birb.
Math-Haskell Rosetta Stone - Part 1
http://www.danielbrice.nethttps://www.danielbrice.net/blog/math-haskell-rosetta-stone/
Published: September 24, 2024 00:00
This post begins a short series meant to serve as an informal guide to reading Haskell code and translating back and forth with mathematics.
It’s meant to help members of r/CategoryTheory understand posts that use Haskell code to convey ideas.
My hope is…
Understanding Partial Application of Function Composition
http://www.danielbrice.nethttps://www.danielbrice.net/blog/understanding-function-composition/
Published: September 13, 2024 00:00
A recent post on r/haskell solicited help understanding the expression
isAllergicTo :: Allergen -> Int -> Bool
isAllergicTo = (. allergies) . elem
where Allergen is a type and allergies :: Int -> [Allergen].
It’s straightforward to rewrite this function…
Looking for a Needle that Might Not Be in an Infinite Haystack
http://www.danielbrice.nethttps://www.danielbrice.net/blog/looking-for-a-needle-that-might-not-be-in-an-infinite-haystack/
Published: October 26, 2022 00:00
Hand-wavy explanations of my lightning talk of the same title at Mercury’s October 2022 PDX Haskell meetup.
Based on “Infinite sets that admit fast exhaustive search” by MartĂn EscardĂł.
{-# OPTIONS_GHC -Wall -fno-warn-orphans -fno-warn-name-shadowing…
A decent and reliable Haskell dev setup for VS Code in 2022
http://www.danielbrice.nethttps://www.danielbrice.net/blog/haskell-vscode/
Published: July 18, 2022 00:00
The sickest experience possible for Haskell development in July 2022 is undoubtedly VS Code with the Haskell plugin powered by Haskell Language Server (HLS).
When HLS works for your project, that is.
This guide will demonstrate a simpler, lower-featured…
Sets, Classes, and Wabbits
http://www.danielbrice.nethttps://www.danielbrice.net/blog/sets-classes-and-wabbits/
Published: March 14, 2022 00:00
Set theory is a bit of a trickster.
Some of its ideas go back to Plato (forms) and Aristotle (categorical syllogisms), but sets don’t quite capture the objects of these disciplines.
Rather, the objects of those disciplines are captured more closely by the…
Haskell GoF - Abstract Factory
http://www.danielbrice.nethttps://www.danielbrice.net/blog/abstract-factory/
Published: January 19, 2022 00:00
The beginning of a series wherein we show how to implement selected design patterns from
Design Patterns: Elements of Reusable Object-Oriented Software. This week, we take a look at the venerable Abstract Factory pattern.
A common question new Haskell…
Of function instances and abstract syntax
http://www.danielbrice.nethttps://www.danielbrice.net/blog/of-function-instances-and-abstract-syntax/
Published: April 20, 2021 00:00
Some Haskell classes class Myclass a admit an instance for functions
instance Myclass a => Myclass (x -> a) based on the instance for a.
All of these instances have a few things in common: (1) they implement
the class methods in a straightforward way as…
Proving My Point
http://www.danielbrice.nethttps://www.danielbrice.net/blog/proving-my-point/
Published: November 21, 2020 00:00
A coworker of mine has been kind enough to spend his scant spare time guiding a small group of future Haskellers through Hutton’s Programming in Haskell, assigning weekly problems and judging the solutions submitted along the way. What follows here today1…
Simple Linear Regression in One Pass
http://www.danielbrice.nethttps://www.danielbrice.net/blog/simple-linear-regression-in-one-pass/
Published: June 12, 2020 00:00
I recently had to implement linear regression for a hobby project. As I’d never learned how to calculate it, this was a great opportunity to learn. As I dug in, I saw that I’d need to be making two passes over my data. Let’s see if we can fix that.
The…
The IO Rosetta Stone
http://www.danielbrice.nethttps://www.danielbrice.net/blog/the-io-rosetta-stone/
Published: January 1, 2020 00:00
Recently to a friend, I quipped that it’d be a good exercise towards demystifying Haskell’s IO type to write a comparable IO type in your favorite language. In this blog post, I do that for Java, Javascript, Python, and Scala.
TL;DR: Here’s the code.
…