January 2014
Beginner
428 pages
14h 1m
English
CHAPTER 14
![]()
Interpreting Offers with Attributes
This chapter continues the work of the previous one in creating a DSL for expressing offers for the Time Machine Store. As you may remember, deep embedding was chosen as the way to model the offers language in Haskell. A deeply embedded language is partitioned in its syntax, expressed as a set of Haskell data types, and also is partitioned on its interpretation, which is responsible for assigning a meaning to each value in the language. In this example, the interpretation of an offer could be a function that, given a list of products and prices, applies the offers and discounts and returns the new ...
Read now
Unlock full access