Skip to content

[v3] Implement new concept exercise docs and typespecs #692

@angelikatyborska

Description

@angelikatyborska

Learning objectives

  • @moduledoc
  • @doc
  • @spec
  • defining different possible combinations with |
  • defining your own type with @type
  • naming arguments in a typespec
  • the difference between String.t() and string()
  • using atom literals in the typespec is a typical pattern (e.g. {:ok, any()} | {:error, any()})

This exercise should provide a boilerplate with already implemented functions that only need a doc and typespec. The functions should be simple so that the exercise can appear early in the concept tree, e.g. do not use Enum.

Out of scope

Anything that would put this exercise at the end of the concept tree or is not practical for everyday usage, so for example:

  • pid(), reference() types
  • @callback
  • improper lists

Concepts

  • docs
  • typespecs

Prerequisites

Very likely a lot of different data types, like lists, strings, integers, maybe even maps or structs?

Practice exercises

?

Metadata

Metadata

Labels

concept-exerciseAdding or improving a concept exercisev3Related to Exercism v3

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions