skip to main content
research-article

Adding structure to monoids: thus hopefully ending Haskell's string type confusion

Published:23 September 2013Publication History
Skip Abstract Section

Abstract

This paper presents the rationale and design of monoid-subclasses. This Haskell library consists of a collection of type classes that generalize the interface of several common data types, most importantly those used to represent strings. We demonstrate that the mathematical theory behind monoid-subclasses can bring substantial practical benefits to the Haskell library ecosystem by generalizing attoparsec, one of the most popular Haskell parsing libraries.

References

  1. Alfred V Aho, Brian W Kernighan, and Peter J Weinberger. Awk--pattern scanning and processing language. oftware: Practice and xperience, 9(4):267--79, 1979.Google ScholarGoogle Scholar
  2. Mario Blažević. incremental-parser: Generic parser library capable of providing partial results from partial input. Hackage. http://hackage.haskell.org/package/incremental-parser.Google ScholarGoogle Scholar
  3. Mario Blažević. monoid-attoparsec: an input-generic fork of attoparsec. Bitbucket. https://bitbucket.org/blamario/monoid-attoparsec.Google ScholarGoogle Scholar
  4. Mario Blažević. Coroutine pipelines. The Monad. Reader Issue 19: Parallelism and Concurrency, page 29, 2011.Google ScholarGoogle Scholar
  5. Robin Bate Boerop. attoparsec-csv: A parser for csv files that uses attoparsec. Hackage. http://hackage.haskell.org/package/attoparsec-csv.Google ScholarGoogle Scholar
  6. Alfred H Clifford and Gordon Bamford Preston. The algebraic theory of semigroups, volume 1. American Mathematical Soc., 1961.Google ScholarGoogle ScholarCross RefCross Ref
  7. Duncan Coutts, Don Stewart, and Roman Leshchinskiy. Rewriting Haskell strings. In Practical Aspects of Declarative Languages, pages 50--64. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. David J Farber, Ralph E Griswold, and Ivan P Polonsky. Snobol, a string manipulation language. Journal of the ACM (JACM), 11(1):21--30, 1964. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Robert Gilmer and Tom Parker. Divisibility properties in semigroup rings. The Michigan Mathematical Journal, 21(1):65--86, 1974.Google ScholarGoogle ScholarCross RefCross Ref
  10. John Goerzen. Listlike: Generic support for list-like structures. Hackage. http://hackage.haskell.org/package/ListLike.Google ScholarGoogle Scholar
  11. Ralph E Griswold and Madge T Griswold. The Icon programming language, volume 28. Prentice-Hall Englewood Cliffs NJ, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Thomas Harper. Stream fusion on Haskell unicode strings. In Implementation and Application of Functional Languages, pages 125--140. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Paul Hudak, John Hughes, Simon Peyton Jones, and Philip Wadler. A history of Haskell: being lazy with class. In Proceedings of the third ACM SIGPLAN conference on History of programming languages, pages 12--1. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Oleg Kiselyov. iteratee: Iteratee-based i/o. Hackage. http://hackage.haskell.org/package/iteratee.Google ScholarGoogle Scholar
  15. Oleg Kiselyov. Iteratees. In Proceedings of the 11th international conference on Functional and Logic Programming, pages 166--181. Springer-Verlag, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Daan Leijen and Erik Meijer. Parsec: Direct style monadic parser combinators for the real world. Technical report, Department of Computer Science, Utrecht University, 2001.Google ScholarGoogle Scholar
  17. Bryan O'Sullivan. attoparsec: Fast combinator parsing for bytestrings. Hackage. http://hackage.haskell.org/package/attoparsec.Google ScholarGoogle Scholar
  18. Bryan O'Sullivan. criterion: Robust, reliable performance measurement and analysis. Hackage. http://hackage.haskell.org/package/criterion.Google ScholarGoogle Scholar
  19. Maciej Piechotka. nanoparsec: An implementation of attoparsec-like parser around list-like. Hackage. http://hackage.haskell.org/package/nanoparsec.Google ScholarGoogle Scholar
  20. Larry Wall et al. The Perl programming language, 1994.Google ScholarGoogle Scholar

Index Terms

  1. Adding structure to monoids: thus hopefully ending Haskell's string type confusion

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 48, Issue 12
        Haskell '13
        December 2013
        149 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2578854
        Issue’s Table of Contents
        • cover image ACM Conferences
          Haskell '13: Proceedings of the 2013 ACM SIGPLAN symposium on Haskell
          September 2013
          158 pages
          ISBN:9781450323833
          DOI:10.1145/2503778

        Copyright © 2013 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 23 September 2013

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!