LambdaHack
Haskell game engine library for roguelike dungeon crawlers
... and runs it. The library lets you compile a ready-to-play game binary, using either the supplied or a custom-made main loop. A couple of frontends are available (SDL2 is the default for desktop and there is a JavaScript browser frontend) and many other generic engine components are easily overridden, but the fundamental source of flexibility lies in the strict and enforced with types separation of engine code from the read-only content and of clients (human and AI-controlled) from the server.