Giter Site home page Giter Site logo

elm-hw01's Introduction

MI-AFP Homework Elm #01

Homework to practice Elm language and the basics of The Elm Architecture.

Scripts

Install dependencies.

npm install

Format elm code.

npm run format

Run tests for Part I.

npm run test

Run for Part II and open in browser.

npm run dev

Part I

The goal of this part is to practice the Elm language. There are several functions in the file src/Lib.elm waiting for your implementation. Each function has a documentation comment with a description of what it is supposed to do. There are also unit tests for these functions in tests/LibTest.elm which can help if something is unclear. You can run the tests using elm-test.

Most of the functions can be implemented using functions from elm/core modules, such as List, Maybe, String or Dict. For the last one, indexOf function, you should find appropriate package at package.elm-lang.org, install it and use it.

Part II

This part focuses on practising The Elm Architecture. The goal is to create a simple application that shows a story separated into three tabs (Introduction, Plot, Conclusion) with navigation between these tabs. When the app is opened, it should display the Introduction tab.

In the file src/Main.elm, there is already a structure for the application prepared. Your goal is to

  • Define necessary messages you need for your implementation,
  • Define the type for the Model and implement init function to return initial Model,
  • Implement the update function to update the model correctly according to the message,
  • Update view functions to
    • Dispatch messages when clicking on tabs,
    • Display correct content based on active tab,
    • Use tabStyleActive for active tab.

To open the application in the web browser, use elm reactor then navigate to http://localhost:8000 and open the Main.elm file.

Expectations

  • Feel free to add more tests (for you), create new modules or install new dependencies (if necessary)
  • No need to implement everything (you will receive some points also for non-complete solution)
  • When not sure what to do or how to do, feel free to ask

License

This project is licensed under the MIT License - see the LICENSE file for more details.

elm-hw01's People

Contributors

denynemec avatar janslifka avatar scheras avatar

Watchers

James Cloos avatar Robert Pergl avatar  avatar Marek Suchánek avatar

Forkers

scheras

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.