The personal website of Daniel Brice, PhD.

Made with Jekyll and hosted on GitHub Pages.

I’ll be using this space to muse about Math and coding and games, mostly.

• ## Simple Linear Regression in One Pass

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.

more...
• ## The IO Rosetta Stone

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.

more...
• ## Getting More Meaning From Your Case Classes

This will be a small post where I share some techniques we found for getting some additional type safety from our Scala case classes. We’ll look at case classes that validate their input data and we look at case classes that allow selecting from among multiple instances of the same typeclass.

more...
• ## Denotational Semantics in a Nutshell

Wherein I attempt to give a 10,000-foot overview of semantics of programming languages.

more...
• ## Exception Handling and I/O with MTL

This post is Part 3 of a series on type-safe failure handling. Part 1 is in Scala and examines Scala’s Either class as a mechanism for early-return control flow. Part 2 ports the program to Haskell, where I/O is explicitly encapsulated by the IO type. This post will demonstrate the use of monad transformers to refactor the example from Part 2.

more...