I basically want to create a full screen window and draw text on it in different colors and sizes (and also update the screen). I've used pygame for this in python and I'm looking for a similar library (should be fairly easy to use).
+1 if it handles input too...
If you're looking for a specialized game library, you have a number of options that you can find here. FunGEn is probably your best option out of those libraries. However, your question seems to suggest a game library would be a bit overkill, if all you're looking to do is draw text and receive input. In that case, you might opt for something simpler like HOpenGL or hsSDL. There are also several other libraries listed here.
Edit: After a bit more research, you might do well using haskgame. I've never used it myself, but it looks like it's got a few functions here that do exactly what you're looking for.
Instead of picking individual libraries, I'll have a go at a quick overview at all of them, as listed in the Graphics section on Hackage.
Basic frameworks:
OpenGL
- Part of the Haskell Platform
- Used for many small 2 and 3D games.
- Examples: lambdacube-engine, roguestar-gl, hpong, monadius, raincat, frag
GTK
cabal install cairo
- Used for high quality two-d graphics/vector graphics.
- On Hackage
- Examples: diagrams, 4blocks, gameclock
QTHaskell
- Relatively little use, but when it is used, it is used notably.
- Not on Hackage, found here, due to C++ issues
- Notable users: Nikki and the Robots, a commercial game.
SDL
cabal install sdl
- On Hackage, quite widely used for game-like, interactive apps with 2D graphics.
- Examples: haskgame, Eternal10Seconds, HTicTacToe, RainCat, starrover
X11
cabal install X11
Venerable Unix user interfaces.
Examples: xmonad.
GD
cabal install gd
The GD graphics system. Package on hackage.
Examples: wordcloud, sparklines.
HOgre
cabal install hogre
Bindings to the Ogre game graphics system.
Now, besides these game layers, there are many higher level frameworks and tools:
Diagrams
cabal install diagrams
2D vector diagrams (e.g. for math), built on cairo.
- Examples: fractals.
Gloss
cabal install gloss
2D graphics, very easy interface, relatively new. See TomMD's comment.
- Examples: functional flocking
Cal3D
cabal install cal3d
Bindings to the Cal3D animation package.
Chalkboard
cabal install chalkboard
OpenGL-based combinators for generating images, used in teaching.
TeaHS
cabal install TeaHS
A simple library for use creating 2D games, inspired by the Ruby library Tea.
I'd recommend the new Gloss library as an easy way to get good results.
Gloss hides the pain of drawing simple vector graphics behind a nice data type and a few display functions. Gloss uses OpenGL and GLUT under the hood, but you won't have to worry about any of that. Get something cool on the screen in under 10 minutes.
There are also nice examples, such as:


and a nice example building flocking simulators
Alternatively, if it is vectors and text you want to manipulate, the diagrams package on top of cairo can yield very good results.
You could use Qt. That's what the cross platform Nikki And The Robots is using. You can see their source code and take a look at what they're doing.
来源:https://stackoverflow.com/questions/5612201/haskell-library-for-2d-drawing