fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Implement new Concept Exercise: classes

Open ErikSchierboom opened this issue 5 years ago • 0 comments

This issue describes how to implement the classes concept exercise for the F# track.

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

Goal

The goal of this exercise is to teach the student the basics of the Concept of Classes in F#.

Learning objectives

  • Know what classes are.
  • Know what the difference is between classes and records and when to use which.
  • Know what encapsulation is.
  • Know what fields are.
  • Know how to create an object.
  • Know how to define methods.

Out of scope

  • Static bindings.
  • Mutable values.
  • Properties.
  • Composition.
  • Additional constructors.
  • do bindings in classes.
  • let and val bindings in a class.
  • Interfaces.
  • Inheritance.
  • Properties.
  • Indexers.
  • Structs.
  • Method overloading.

Concepts

The Concepts this exercise unlocks are:

  • classes: know what classes are; know what the difference is between classes and records and when to use which; know what encapsulation is; know what fields are; know how to create an bject; know how to define methods; know how to update state.

Prerequisites

This exercise's prerequisites Concepts are:

  • records: know what records are.
  • tuples: know what tuples are (used for parameter passing).
  • access-control: know about the public and private access control
  • unit: know about the unit type.

Any data types used in this exercise (e.g. strings or integers) should also be added as prerequisites.

Resources to refer to

Hints

After

Representer

This exercise does not require any specific representation logic to be added to the representer.

Analyzer

This exercise does not require any specific logic to be added to the analyzer.

Implementing

To implement this exercise, please follow these instructions.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

ErikSchierboom avatar Mar 26 '20 11:03 ErikSchierboom