Lane's Blog

Roguestar, Haskell, and Fun

Skip to: Content | Sidebar | Footer

Category: Haskell

FactoryArrow

9 August, 2009 (15:21) | Haskell, RSAGL | By: Lane

I’ve been playing around with an Arrow concept, which to my knowledge is original. I’ve decided to call this a FactoryArrow:

newtype FactoryArrow m n a b = FactoryArrow { runFactory :: m (Kleisli n a b) }

Where m and n are Monads. m is a single-pass initialization monad, while n is a multiple-pass [...]

Vec is Good

5 May, 2009 (15:45) | Haskell, RSAGL | By: Lane

Last night I checked out Scott E. Dillard’s Vec library. It’s a good, fast, pure implementation of the basic matrix operations applicable to 3D graphics. Switching to Vec has shaved off quite a bit of time from one of my demo apps and relieved me of the need to maintain my own matrix [...]

Trends in Profiling Haskell

16 April, 2009 (19:22) | Haskell | By: Lane

I spent some time yesterday profiling roguestar. I do this every few months just to see where things stand, and there are always two culprits at the top of roguestar-gl.prof, every single time:
* typeclass dictionary lookups in inner loops
* Rational
In the first case, I think the simplest solution is to INLINE the puppy. [...]

MaybeArrow?

4 January, 2009 (19:16) | Haskell | By: Lane

As I’ve found myself repeatedly writing a bit of code that looked vaguely like this:

get :: SomeArrow String (Maybe Thing)

foo :: [Thing] -> FooThing

. . .

getAToZ :: SomeArrow () (Maybe FooThing)
getAToZ = proc () ->
do m_a <- get -< “a”
m_b <- get -< “b”
[...]

He Said She Said

27 April, 2008 (08:01) | Haskell | By: Lane

Donald Knuth says: If people do discover nice ways to use the newfangled multithreaded machines, I would expect the discovery to come from people who routinely use literate programming.
This is called Haskell.