[Haskell-cafe] Debugging partial functions by the rules

Claus Reinke claus.reinke at talk21.com
Wed Nov 15 05:58:16 EST 2006

>    Couldn't we just use rewrite rules to rewrite *transparently*
>    all uses of fromJust to safeFromJust, tagging the call site
>    with a location?
> Looks good! But that is deceiving: the assert was expanded before the rule
> fired, and refers to the rewrite rule source line (line 19), not the fromJust
> call site (line 12).  Now if we could just have the 'assert' token inserted
> into the AST before it was expanded, we'd be home and dry. Could this be done
> with TH? Or could we arrange for asserts in rewrite rules not to be expanded
> till later?
> Any ideas?



More information about the Glasgow-haskell-users mailing list