Skip to content

πŸ—’ Excercises for Functional Style Programming

Notifications You must be signed in to change notification settings

angelogulina/fsp-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

fsp-workshop

πŸ—’ Excercises for Functional Style Programming

Requirements

The only requirement for this to run is to have Node.js > 8

Running the exercises

To run the exercises just type

node index.js

In order not to confuse with results, only the basic exercise is run. It refers to type-of-fruit.js, which will look like:

>>>>>> 🏁  Start tests.
        πŸ›‘  Oops! A bug is eating Red Apples... 🍎 ... πŸ›
        ...
        ...

How to solve the exercises

All the exercises are under the exercises folder. Let's take type-of-fruit.js.

Every exercise has a set of data prepared for you. You will need to inspect to pass the challenge.

It'll be bit like childood math. You can think each step as if it were a question: Alba has a basket of candies. How many blue candies are there? And so on...

So, the file starts witht the data:

const {
    applesList,
    fruitsList,
} = require('./res/fruitsLists');

Below, you will see some variables declared (default to undefined) and then exported. They will be used to check the results.

let onlyRedApples;
let onlyGreenApples;

// ...

module.exports = {
    onlyGreenApples,
    onlyRedApples,
    // ...
};

In order to solve the challenge, you will need to set those variables to the correct answer, staritng from the given data. It's up to you how you get to the result.

The aim of this is to prove a Functional Programming Style more useful and ergonomic.

This is the reason I've provided you with some typical method used in this style to be found in utils/fx.js. Be aware that those are not at all a sufficient and you will need to figure out how to use them (I've tried to add most meaningful documentation).

If you wish to have an overview of more complete libraries and helpers for that, check ramda (it's also good for inspiration).

Have fun πŸ™Œ

Supporting

I believe in Unicorns πŸ¦„ Support me, if you do the same.

License

MIT License

Copyright (c) 2018 A (from Sicily)

About

πŸ—’ Excercises for Functional Style Programming

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published