haskellfoundation / haskellfoundation/haskell-2010-revised-report

Restoring the Library Specifications

Open
#29 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Typst
Stars
20
Forks
5
Avg merge
4d 18h
Merged PRs (30d)
6

Description

The following sections of the original report contain various sample implementations (called specifications by the report):

* Chapter 9 (`Prelude`)
* Chapter 14 (`Data.Array`)
* Chapter 17 (`Data.Complex`)
* Chapter 21 (`Data.Maybe`)
* Chapter 22 (`Data.Ratio`)

Some of these also include non-trivial implementations such as `approxRational` from `Data.Ratio`. Are these going to be included? It would be a shame if these where left out of the revised report.

If they are to be included, the new machine checked nature of the specification bring some difficulties. Consider the specification for `showParen`:
```haskell
showParen :: Bool -> ShowS -> ShowS
showParen b p = if b then showChar '(' . p . showChar ')' else p
```
Here, `if` expects the compiler's builtin `Bool` but the current specification defines it's own bool in `Data.Bool`, resulting in a type error.

How should this be tackled? Should `stdlib` be split into definitions that the compiler needs (and their transitive dependencies) and the auxiliary definitions, where the compiler aware ones are left undefined? Should the specifications be rewritten to use less builtins?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the revised report's treatment of the Prelude, Data.Array, Data.Complex, Data.Maybe, and Data.Ratio specifications against the corresponding sections of the original report. Examine the showParen example and its Data.Bool conflict; done means deciding which specifications to restore and documenting or implementing a consistent approach to compiler-built-in definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.