Giter Site home page Giter Site logo

Further ToDos about ffp HOT 1 OPEN

tmrdlt avatar tmrdlt commented on August 20, 2024
Further ToDos

from ffp.

Comments (1)

griase94 avatar griase94 commented on August 20, 2024

Description

Minesweepskell is a web implementation of the widely known video game Minesweeper fully written in the Haskell functional programming language.

Features

  • Minesweeper Web App with three predefined difficulties as well as customizable games
  • Slim & blazing fast UI powered by server side events
  • Join other players on their game either to view them playing or to play together
  • Pause games & continue later
  • History of all finished games to revisit your best & worst performances

Architecture

Web application with the Yesod framework
  • REST Backend
  • Frontend fully developped in Yesods shakespearean templating system
  • Server-side events in order to provide live UI rerendering and updates for a flawless User Interface, which even has the possibility to play/view one game on multiple Bowsers/Machines simultaneously
Global mutable in-memory state with TVars
  • Global state of all ongoing games realized with TVars, which provide mutability as well as atomic writing operations
  • The state only contains all ongoing games, paused and finished (lost/won) games are moved from the in-memory state to the database, if a paused game is continued it will be loaded back into the in-memory state
Database with Persistent & MongoDB
  • As just mentioned Minesweepskell stores non-ongoing games in a database this is realized by using the Persistent library to connect a MongoDB
Elegant data accessing/manipulation with Lenses
  • In order to manipulate and query data types more elegantly lenses are used for almost all operations on data types
  • Lenses for matrices are provided by the matrix-lens package and provide elegant manipulation of cells on the game board
Utilisation of Monads
  • Monads are widely used throughout the project, especially the IO monad for things like state manipulation, as well as Yesods Handler Monad for the REST API, own Monads are not defined
  • Problem: Initially we wanted to realize the global mutable state with the State monad, but we could not get it to work in combination with Yesods handler monad. Due to this we switched to TVars for the global in-memory state, which proved to be a better choice, since it even provides atomic writing operations and was astonishingly smooth to implement for our use cases.

from ffp.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.