Skip to content

reify never provides the declaration of variables

The information returned by reify when provided a variable Name is

VarI Name Type (Maybe Dec) Fixity

The Dec part, due to be nested in Maybe, is clearly optional. In fact, according to Language.Haskell.TH.Syntax:

-- Nothing for lambda-bound variables, and
-- for anything else TH can't figure out
-- E.g. [| let x = 1 in $(do { d <- reify 'x; .. }) |]

However, the typechecker (TcSplice module) always returns Nothing. So it's simply not implemented.

I suggest either implementing the feature or removing the Dec part of VarI. Either way, the type should be consistent with the features offered in TH.

Trac metadata
Trac field Value
Version 6.8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information