Git Product home page Git Product logo

fsharpkoans's Introduction

Functional Koans - F#

The goal of these is to teach you functional programming in general, and F# in specific, through testing.

Quick Start

  1. If you're using Visual Studio (or VS Code), you'll need to install the NUnit 3 Test Adaptor Extension. If you're running Xamarin, you need to be able to run NUnit tests (but, to my everlasting shame, I have not worked with such a setup, and cannot offer advice!). I'm using VS2015, but everything should work with VS2012 upwards โ€” if not, please let me know.

  2. Clone this repository.

  3. Open & build the solution. This should download and install FsUnit and dependencies (via NuGet) for you as well.

  4. Group by class

    Open up the test explorer and set it to group by class.

  5. Test Explorer, VS2015

    Now run all the tests.

Oh no! The tests are all failing! Start with the first test (you should be able to double-click on it), fix it, move on to the next ๐Ÿ˜„. It will help to read all the comments in a file. Each test has something to teach you (I hope!).

Acknowledgements

This repo was originally forked from Chris Marinos' original F# Koans (which was, in turn, inspired by EdgeCase's fantastic Ruby koans). There isn't a lot of Chris's code left โ€” much like Theseus' ship, the vast majority of the "planks" have been replaced! โ€” but this project would probably never have begun had it not been for his work.

Contributions

Contributions, corrections, and better ways of teaching through testing are most welcome! And, of course, bug reports are just as welcome. The usual way of doing these things via GitHub applies ๐Ÿ˜„.

fsharpkoans's People

Contributors

chrismarinos avatar cynic avatar josh1n avatar nataren avatar panesofglass avatar abedra avatar harold avatar marcusoftnet avatar readysetmark avatar patrickmcdonald avatar scitesy avatar skalinets avatar tmpreston avatar tcshao avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Forkers

kim3011

fsharpkoans's Issues

AboutOptions, test 02

Remove the excess brackets. You don't need them. Remember, a tuple is created by the , operator, not by brackets. Brackets only need to be used for grouping. A similar thing holds true for tuple patterns: see the syntax of these in your notes.

AboutTuples

Why are you opening System.Threading.Tasks at the top?

AboutTuples, test 04

You can avoid a warning about incomplete pattern matches by not using a constant pattern in your answer.

AboutRecords, test 03

You don't need to match the Author field at all in the pattern. Remember, fields that are left out are implicitly wildcarded.

AboutBasicTypes, tests 09 and 10

The tests originally look like sprintf __ "perfect" and sprintf __ 9. You're supposed to replace the __ with a single item, rather than replacing it with two items (e.g. "%s %s" "Practice makes" in one of the cases).

AboutBasicTypes, test 17

For the ``without surrounding space``, there's a C# method to do that instead of using .Substring. Also, as a matter of style, remove the brackets in the calls wherever you can.

AboutModules

By doing an open MushroomKingdom at the top, you've missed out on what module 22 was trying to teach you. Remove that line and see if you can get the tests to pass?

AboutParametricPolymorphism, test 02

You don't need brackets here. The only reason that they're used in the next lines is because functions bind tightly โ€” and without the brackets, should equal (4, 5, 5) would get interpreted as ((should) (equal) 4)), 5, 5

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.