I've been thinking about how I could use Haskell for programming just the "business logic" for games.

So for a mobile game I might use an existing library such as libgdx or cocos2d for input handling and sprite batching. Where I'd like to use Haskell is for writing the big function to process the inputs and output a sprite list and audio triggers.

Why Haskell? In even a simple 2d platformer there's a lot of polish needed to get the game to feel good to a player. For instance, if I was using box2d physics to take care of movement and collisions, I might still need to detect that inputs indicate applying a force vector opposite to the player's current velocity and the player is "on the floor". A naive game would show the player moon walking. A more sophisticated game would show a skidding player sprite or animation until the player's velocity reaches 0.

I was hoping to use Haskell to capture a lot of little details like that more elegantly than I can in C or Java.

However, my program needs to be compiled for a mobile device.

I'm wary of trying to use GHC to generate arm machine code. I've had bad luck with cross compilers.

It seemed to me that I could design a GADT to model my game actors and their relationships. I would then (misused term I'm sure) "lift" my behavior functions into some context where they can produce Java or C code for use in Xcode or Eclipse. That's my favored approach.

Is there some background I could look at to save myself some dead ends pursuing this?

--
Darrin