Skip to main content

Strong Types for Describing Offers

  • Chapter
  • First Online:
Practical Haskell
  • 2010 Accesses

Abstract

You’ve already finished two of the main tasks in this book: implementing some data-mining algorithms for analyzing clients and their purchases and looking at several ways to save the information about purchases in a durable container. This chapter is the starting point of the last task: creating a domain-specific language (DSL) for expressing offers to be applied in the Time Machine Store. You will provide a set of combinators to create the offers, which are initially basic offers.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Available at the Idris web site, www.idris-lang.org/documentation/ .

  2. 2.

    Available at the Agda web site, http://wiki.portal.chalmers.se/agda/ .

  3. 3.

    Available at http://adam.chlipala.net/cpdt/ .

  4. 4.

    Available at www.cis.upenn.edu/~bcpierce/sf/ .

  5. 5.

    The following code works on a different module from the Operation type family introduced earlier. If you try to define Operation inside a type class at the same time of the Operation type family, there will be a name collision, and the compiler won’t be able to continue.

  6. 6.

    You can check the definitions that are created by running GHC with the -ddump-splices option.

  7. 7.

    In older versions of GHC kinds always defaulted to * and you had to be more explicit.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Alejandro Serrano Mena

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Serrano Mena, A. (2019). Strong Types for Describing Offers. In: Practical Haskell. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4480-7_13

Download citation

Publish with us

Policies and ethics