Commit 626f0454 authored by Ryan Scott's avatar Ryan Scott Committed by Ben Gamari
Browse files

Document a law for TH's Lift class

Inspired by the discussion in #14296, I've decided to
document a law which is usually in the back of my mind when I'm using
Template Haskell's `Lift` class, but isn't formally stated anywhere.
That is, every `Lift` instance should satisfy (for all `x`):

$(lift x) == x

Test Plan: Read it

Reviewers: austin, goldfire, bgamari

Subscribers: rwbarton, thomie

Differential Revision:
parent 9c05fc4c
......@@ -565,6 +565,9 @@ sequenceQ = sequence
-- Template Haskell has no way of knowing what value @x@ will take on at
-- splice-time, so it requires the type of @x@ to be an instance of 'Lift'.
-- A 'Lift' instance must satisfy @$(lift x) ≡ x@ for all @x@, where @$(...)@
-- is a Template Haskell splice.
-- 'Lift' instances can be derived automatically by use of the @-XDeriveLift@
-- GHC language extension:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment