Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Haskell Allegro?

This thread is locked; no one can reply to it. rss feed Print
Haskell Allegro?
Tobias Dammers
Member #2,604
August 2002
avatar

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

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

weapon_S
Member #7,859
October 2006
avatar

Tobias Dammers
Member #2,604
August 2002
avatar

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...

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

AMCerasoli
Member #11,955
May 2010
avatar

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

Matthew Leverton
Supreme Loser
January 1999
avatar

That looks like Allegro 4. :-X

Tobias Dammers
Member #2,604
August 2002
avatar

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

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Schyfis
Member #9,752
May 2008
avatar

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

________________________________________________________________________________________________________
[freedwill.us]
[unTied Games]

Arthur Kalliokoski
Second in Command
February 2005
avatar

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.

They all watch too much MSNBC... they get ideas.

Tobias Dammers
Member #2,604
August 2002
avatar

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...

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Dizzy Egg
Member #10,824
March 2009
avatar

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

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Michael Faerber
Member #4,800
July 2004
avatar

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

SiegeLord
Member #7,827
October 2006
avatar

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.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Tobias Dammers
Member #2,604
August 2002
avatar

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.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Go to: