Changes between Version 2 and Version 3 of TemplateHaskell/BlogPostChanges


Ignore:
Timestamp:
Oct 8, 2015 3:36:50 AM (2 years ago)
Author:
zilinc
Comment:

trivial: typos

Legend:

Unmodified
Added
Removed
Modified
  • TemplateHaskell/BlogPostChanges

    v2 v3  
    212212f x = [| $x + (True 'c') |]
    213213}}}
    214 because the quote is obviously ill-typed.  Only quotes nested inside top-level splices would avoid the type checker (because if the splice is run in the renamer, we can't typecheck the nexted quote).  For example:
     214because the quote is obviously ill-typed.  Only quotes nested inside top-level splices would avoid the type checker (because if the splice is run in the renamer, we can't typecheck the nested quote).  For example:
    215215{{{
    216216$(f [| True 'c' |])
     
    266266
    267267Points to notice
    268  * Unlike TH, the ''only'' way to construct a value of type `TExp` is with a quote.  You cannot drop into do-ntation, nor use explicit construction of the values in the `Exp` algebraic data type.  That restriction limits expressiveness, but it enables the strong typing guarantees.
     268 * Unlike TH, the ''only'' way to construct a value of type `TExp` is with a quote.  You cannot drop into do-notation, nor use explicit construction of the values in the `Exp` algebraic data type.  That restriction limits expressiveness, but it enables the strong typing guarantees.
    269269
    270270 * There are no declaration, type, or pattern quotes for these typed quotes.  Only terms.
     
    353353 1. Typecheck down to, but not including, the first splice, `$(th1 4)`.  These declarations constitute the first ''declaration group''.
    354354 2. Typecheck and run the splice, which returns a bunch of declarations D1
    355  3. Typecheck the declarations D1 combined with the declarations down to, but not including, the second splice.  These declarations consitute the second declaration group.
     355 3. Typecheck the declarations D1 combined with the declarations down to, but not including, the second splice.  These declarations constitute the second declaration group.
    356356 4. Typecheck and run the next splice, `$(th2 10)`
    357357 5. Rinse and repeat
     
    361361So, in the preceding example:
    362362 * A `reify` inside the splice `$(th1 ..)` would see the definition of `f`.
    363  * A `reify` inside the splice `$(blah)` woudl see the definition of `f`, but would not see any bindings created by `$(th1...)`.
     363 * A `reify` inside the splice `$(blah)` would see the definition of `f`, but would not see any bindings created by `$(th1...)`.
    364364 * A `reify` inside the splice `$(th2..)` would see the definition of `f`, all the bindings created by `$(th1..)`, and teh definition of `h`.
    365365 * A `reify` inside the splice `$(blah2)` would see the same definitions as the splice `$(th2...)`.