Maximum Segment Sum, Monadically (distilled tutorial, with solutions)
The maximum segment sum problem is to compute, given a list of integers, the largest of the sums of the contiguous segments of that list. This problem specification maps directly onto a cubic-time algorithm; however, there is a very elegant linear-time solution too. The problem is a classic exercise...
Saved in:
| Published in: | arXiv.org |
|---|---|
| Main Author: | |
| Format: | Paper |
| Language: | English |
| Published: |
Ithaca
Cornell University Library, arXiv.org
18.11.2011
|
| Subjects: | |
| ISSN: | 2331-8422 |
| Online Access: | Get full text |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| Abstract | The maximum segment sum problem is to compute, given a list of integers, the largest of the sums of the contiguous segments of that list. This problem specification maps directly onto a cubic-time algorithm; however, there is a very elegant linear-time solution too. The problem is a classic exercise in the mathematics of program construction, illustrating important principles such as calculational development, pointfree reasoning, algebraic structure, and datatype-genericity. Here, we take a sideways look at the datatype-generic version of the problem in terms of monadic functional programming, instead of the traditional relational approach; the presentation is tutorial in style, and leavened with exercises for the reader. |
|---|---|
| AbstractList | The maximum segment sum problem is to compute, given a list of integers, the largest of the sums of the contiguous segments of that list. This problem specification maps directly onto a cubic-time algorithm; however, there is a very elegant linear-time solution too. The problem is a classic exercise in the mathematics of program construction, illustrating important principles such as calculational development, pointfree reasoning, algebraic structure, and datatype-genericity. Here, we take a sideways look at the datatype-generic version of the problem in terms of monadic functional programming, instead of the traditional relational approach; the presentation is tutorial in style, and leavened with exercises for the reader. |
| Author | Gibbons, Jeremy |
| Author_xml | – sequence: 1 givenname: Jeremy surname: Gibbons fullname: Gibbons, Jeremy |
| BookMark | eNotjctKAzEAAIMoWGvvHgNeFLprHpvXUUp9QIuH9l6S3URTsolusrb-vQU9zWWYuQLnMUULwA1GdSMZQw96OPrvGmOkaiQkOQMTQimuZEPIJZjlvEcIES4IY3QClmt99P3Yw419720scDP2c7hOUXe-1SH8wLvO5-JDsB0sY0mD12EOD758wJzCWHyK-f4aXDgdsp39cwq2T8vt4qVavT2_Lh5XlWaYVo4jI4jByHSdkMoaw5Rs28ZpbaQRrSaC4MbK9uTRjivrMHOCC2eUtI0idApu_7KfQ_oabS67fRqHeDruCJJccsQ4pb_pGU63 |
| ContentType | Paper |
| Copyright | 2011. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. |
| Copyright_xml | – notice: 2011. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. |
| DBID | 8FE 8FG ABJCF ABUWG AFKRA AZQEC BENPR BGLVJ CCPQU DWQXO HCIFZ L6V M7S PHGZM PHGZT PIMPY PKEHL PQEST PQGLB PQQKQ PQUKI PRINS PTHSS |
| DOI | 10.48550/arxiv.1109.0782 |
| DatabaseName | ProQuest SciTech Collection ProQuest Technology Collection Materials Science & Engineering Collection ProQuest Central (Alumni) ProQuest Central UK/Ireland ProQuest Central Essentials ProQuest Central Technology collection ProQuest One Community College ProQuest Central SciTech Premium Collection ProQuest Engineering Collection Engineering Database ProQuest Central Premium ProQuest One Academic Publicly Available Content Database ProQuest One Academic Middle East (New) ProQuest One Academic Eastern Edition (DO NOT USE) ProQuest One Applied & Life Sciences ProQuest One Academic (retired) ProQuest One Academic UKI Edition ProQuest Central China Engineering Collection |
| DatabaseTitle | Publicly Available Content Database Engineering Database Technology Collection ProQuest One Academic Middle East (New) ProQuest Central Essentials ProQuest One Academic Eastern Edition ProQuest Central (Alumni Edition) SciTech Premium Collection ProQuest One Community College ProQuest Technology Collection ProQuest SciTech Collection ProQuest Central China ProQuest Central ProQuest One Applied & Life Sciences ProQuest Engineering Collection ProQuest One Academic UKI Edition ProQuest Central Korea Materials Science & Engineering Collection ProQuest Central (New) ProQuest One Academic ProQuest One Academic (New) Engineering Collection |
| DatabaseTitleList | Publicly Available Content Database |
| Database_xml | – sequence: 1 dbid: PIMPY name: Publicly Available Content Database url: http://search.proquest.com/publiccontent sourceTypes: Aggregation Database |
| DeliveryMethod | fulltext_linktorsrc |
| Discipline | Physics |
| EISSN | 2331-8422 |
| Genre | Working Paper/Pre-Print |
| GroupedDBID | 8FE 8FG ABJCF ABUWG AFKRA ALMA_UNASSIGNED_HOLDINGS AZQEC BENPR BGLVJ CCPQU DWQXO FRJ HCIFZ L6V M7S M~E PHGZM PHGZT PIMPY PKEHL PQEST PQGLB PQQKQ PQUKI PRINS PTHSS |
| ID | FETCH-LOGICAL-a513-f60b72b10bdd789ebb598cc4faab8b7ca27214e8c60b3d69ef15f767fb98e4923 |
| IEDL.DBID | PIMPY |
| IngestDate | Mon Jun 30 09:27:17 EDT 2025 |
| IsDoiOpenAccess | true |
| IsOpenAccess | true |
| IsPeerReviewed | false |
| IsScholarly | false |
| Language | English |
| LinkModel | DirectLink |
| MergedId | FETCHMERGED-LOGICAL-a513-f60b72b10bdd789ebb598cc4faab8b7ca27214e8c60b3d69ef15f767fb98e4923 |
| Notes | SourceType-Working Papers-1 ObjectType-Working Paper/Pre-Print-1 content type line 50 |
| OpenAccessLink | https://www.proquest.com/publiccontent/docview/2086860563?pq-origsite=%requestingapplication% |
| PQID | 2086860563 |
| PQPubID | 2050157 |
| ParticipantIDs | proquest_journals_2086860563 |
| PublicationCentury | 2000 |
| PublicationDate | 20111118 |
| PublicationDateYYYYMMDD | 2011-11-18 |
| PublicationDate_xml | – month: 11 year: 2011 text: 20111118 day: 18 |
| PublicationDecade | 2010 |
| PublicationPlace | Ithaca |
| PublicationPlace_xml | – name: Ithaca |
| PublicationTitle | arXiv.org |
| PublicationYear | 2011 |
| Publisher | Cornell University Library, arXiv.org |
| Publisher_xml | – name: Cornell University Library, arXiv.org |
| SSID | ssj0002672553 |
| Score | 1.4722952 |
| SecondaryResourceType | preprint |
| Snippet | The maximum segment sum problem is to compute, given a list of integers, the largest of the sums of the contiguous segments of that list. This problem... |
| SourceID | proquest |
| SourceType | Aggregation Database |
| SubjectTerms | Algorithms Functional programming Integers |
| Title | Maximum Segment Sum, Monadically (distilled tutorial, with solutions) |
| URI | https://www.proquest.com/docview/2086860563 |
| hasFullText | 1 |
| inHoldings | 1 |
| isFullTextHit | |
| isPrint | |
| link | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwrV1JTwIxFG4UNPHkHhckPXjQhJHZ2zmZaCB6gEyEA55IV0MyLM4AwX9vXxnwYOLJpLf28NL2Lf3e6_cQuhUQ9LoBcyTl0gk1NzoXBdKhzFXCuAjjNahtNkG6XToYJGn5Pbooyyo3NtEa6jXbM9RtGyPclFMBiLl5stOYmkg8Dh5nnw70kIJca9lQYxdVgXjLraBq-tpJ37eYix8TE0EH62ylpfJqsnw1WlrazQdwlr8ssnUz7cP_FfDICMZmKj9GO2pygvZtsacoTlGrw1aj8WKMe-oDwEHcW4wb2Gg3s0mb7AvfSVD9LFMSz4HkwFzSBgbIFm-v6v0Z6rdb_ecXp2yn4LDICxwdu5z43HO5lIQmivMooUKEmjFOORHMN4_BUFFh1gUyTpT2Ik1ionlCFdC4naPKZDpRFwiHkXATN2TaHG1I4oT6HjdxjwZ2P645u0S1zRYNS5Uohj87cvX39DU6sMAtDFpDlXm-UDdoTyznoyKvo-pTq5u-1aFIs1cvT_gbVsK2dQ |
| linkProvider | ProQuest |
| linkToHtml | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMw1V3JSgNBEC1iVPTkjkvUPigoZHQya89BPGhCQhYCySGeQq8SyGY2k4_yH62eLB4EbzkIc-th6JmqelX1qqcK4EaYoNd2mSUpl5anOdqc70qLMlsJdBHoNWg8bCKsVGijEVUT8LX8F8Ycq1xiYgzUsicMR45JOg0oxt6B-9z_sMzUKFNdXY7QmKtFUc0-MWUbPhVeUb63jpPL1l_y1mKqgMX8jGvpwOahwzM2lzKkkeLcj6gQnmaMUx4K5mBO5Ckq8D5XBpHSGV-HQah5RJXpZoaP3YBND3XdTsJmtVCuvq1IHScIMUR35-XQuFfYIxtMW5O4r-eD8ca_ID_2Y7m9f_YF9vHNWV8NDiChuoewHR9XFcMjyJbZtNUZd0hNvRt6k9TGnTRBfGJx2ak9I3fSgFe7rSQZmTYNaGZpYkhnsjK2-2Oor2PjJ5Ds9rrqFIjnCzuyPaZROb0wiKiT4Ri5adOfkGvOziC1lEFzYdTD5o8Azv9evoadfL1capYKleIF7MY0tLloCpKjwVhdwpaYjFrDwdVCgQg01yywb3TQBi4 |
| openUrl | ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=Maximum+Segment+Sum%2C+Monadically+%28distilled+tutorial%2C+with+solutions%29&rft.jtitle=arXiv.org&rft.au=Gibbons%2C+Jeremy&rft.date=2011-11-18&rft.pub=Cornell+University+Library%2C+arXiv.org&rft.eissn=2331-8422&rft_id=info:doi/10.48550%2Farxiv.1109.0782 |