A parfait of physics, Linux, LaTeX, and coding tips large and small.

Entries Tagged ‘haskell’:

In the last post, we built a simulator for Conway’s Life in Haskell using repa and OpenGL. The initial life pattern in that implementation was hard coded. In this post, I’ll build a framework for parsing patterns from files.

Haskell is turning out to be a great match for OpenGL. Since we can
offload a lot of the rendering to shader code, we can use mostly pure
Haskell functions to update the game or simulation in response to user
input. Over a few blog posts, I’m going to outline how I’ve been using
OpenGL in Haskell.

First, to use OpenGL we need a way to open a window, get a context, and
respond to user input. There are several different cross-platform
libraries to do this, but for simple projects I prefer
GLFW. The Haskell package
GLFW-b has bindings for
GLFW and exposes a more Haskellish API than the regular GLFW package.
Read the rest…

This article follows how I developed an implementation of the Graham scan algorithm in Haskell,
missteps and all. I think it’s valuable to see the process that others use, especially in a “weird” language like Haskell. At times, it can seem like most of what you’ve learned about developing software doesn’t apply to Haskell, but I think that’s just because the language allows so much of the scaffolding to be cut away once the software is finished. Reading Haskell code written by the masters can feel like looking at the Sistine chapel and wondering where they got such long paint brushes. This will be a step-by-step implementation as I developed it. I’m still learning too, so don’t take this as an example of excellent Haskell style.