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â 
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to