Opened 11 months ago

Last modified 2 months ago

#15003 new feature request

Data.List documentation should list complexities of more functions

Reported by: gbaz Owned by: supersven
Priority: normal Milestone: 8.4.3
Component: libraries/base Version: 8.2.2
Keywords: newcomer Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Lots of functions in Data.List have overtly obvious complexity, like delete. It would still be nice to list all the complexities explicitly, especially for beginners. Also, just to set a good example.

Change History (7)

comment:1 Changed 10 months ago by bgamari

Keywords: newcomer added

comment:2 Changed 10 months ago by supersven

Owner: set to supersven

comment:3 Changed 4 months ago by supersven

I already figured out a bunch of complexities last spring. Then got a bit busy with other projects... I'll update the old branch with the current master, re-check the complexities and try to get it merged.

https://github.com/supersven/ghc/commits/T15003_DataList_complexities

comment:4 Changed 3 months ago by Ben Gamari <ben@…>

In 07e02d57/ghc:

Add some complexities to Data.List documentation (#15003)

Namely for:
- head
- uncons
- tail
- last
- init
- null

comment:5 Changed 2 months ago by Ben Gamari <ben@…>

In 6cf8d0b3/ghc:

Add some complexities to Data.List documentation (#15003)

Describe complexity and add an example for `GHC.List.filter`.

comment:6 Changed 2 months ago by bgamari

I'm a bit unsure of whether there is more to be done here. supersven, feel free to close this if you feel it's done otherwise keep throwing patches my way :)

comment:7 Changed 2 months ago by Ben Gamari <ben@…>

In ae4e4ba/ghc:

Add some complexities to Data.List documentation (#15003)

Namely for:
- stripPrefix
- isPrefixOf
- intersperse
- tails
- map
- scanl
- scanl1
- scanl'
- scanr
- scanr1
- zip
- zipWith

Add examples to `zipWith` and `map`.
Note: See TracTickets for help on using tickets.