Haskell Allegro?
Tobias Dammers

Does anyone know of Haskell bindings for Allegro? I think it would be cool to have an Allegro monad... something like:

main = 
    withAllegro allegroOptions $ do
        setColorDepth 32
        setGFXmode GfxAutodetect 800 600 0 0
        showSplashScreen
        go defaultGameOptions
where
    go :: GameOptions -> Allegro ()
    go options = do
        selection <- mainMenu options
        case selection of
            SelectionExit -> return ()
            SelectionPlay -> playGame >> go
            SelectionOptions newOptions -> go newOptions

weapon_S

So, I take it you have a new pastime for the next couple of years? ;D

Tobias Dammers

Meh... Haskell is pretty awesome, as a language, and apparently, writing the glue to interface it with C libraries is fairly straightforward, so I was hoping someone had already done it. Maybe when my current project is finished...

AMCerasoli

I didn't even know what Haskell was until you mentioned... :-/

Matthew Leverton

That looks like Allegro 4. :-X

Tobias Dammers

Well yeah, it does. I haven't done enough a5 yet to pump out an example without thinking.

Schyfis

Last time I used Haskell I would get errors on line 54 of a 53-line file. It was always very cryptic to me.

Arthur Kalliokoski
Schyfis said:

Last time I used Haskell I would get errors on line 54 of a 53-line file.

I get errors on the last line of C files, when they can't find a close bracket or something.

Tobias Dammers
Schyfis said:

Last time I used Haskell I would get errors on line 54 of a 53-line file. It was always very cryptic to me.

Well, yeah, the error messages are kind of cryptic...

Dizzy Egg

Haskell is awful to work with! I have no idea why you would want to use it, especially with a c library....use c?

Michael Faerber
SiegeLord

They have a very nice site to learn Haskell interactively ! :)

I tried a few lessons of it and I have to agree with Dizzy Egg... Still, the goal here is the spread of Allegro, not necessarily spread of a horrible language (although one can help another). The more bindings there are to Allegro, the better.

Tobias Dammers

Dunno, I like Haskell. It has minimal boilerplate, it's fast, it aligns well with my desire to avoid state... I like it.

But then, I've never been very pragmatic, so maybe that's why imperative languages sometimes annoy me.

C is actually quite OK, at least it doesn't pretend to be the ultimate language to end all languages - the goal of the language hasn't changed much since the 1970s. PHP, OTOH, is really horrible in this regard.

Thread #608461. Printed from Allegro.cc