
4 Aug
2004
4 Aug
'04
8:26 p.m.
I always thought it would be a good feature if functions inlined via {-# INLINE #-} could 'get at' their inlining point. like {-# INLINE head #-} head (x:_) = x head _ = error $ {-# ERRLOC #-} "head: empty list" the semantics being that when inlining {-# ERRLOC #-} is rewritten to (\s -> "Foo.hs:24: " ++ s) (with Foo.hs and 24 replaced by the inlining point). Note that this is designed so that if the compiler does not support ERRLOC or head could not be inlined for some reason, it degrades gracfully. John -- John Meacham - ⑆repetae.net⑆john⑈