[Haskell-cafe] FIXME pragma
Roman Cheplyaka
roma at ro-che.info
Mon May 18 10:42:39 UTC 2015
On 18/05/15 13:12, Tobias Florek wrote:
> Hi,
>
>>> I also wanted such a feature but eventually I just went with:
>>>
>>> __todo :: String -> a
>>> {-# WARNING __todo "TODO" #-}
>>> __todo msg = error $ "TODO: " ++ msg
>>>
>>> __fixme :: a -> a
>>> {-# WARNING __fixme "FIXME" #-}
>>> __fixme = id
>
>> I found WARNING fell short because it doesn't work on module-local
>> definitions, and only triggers on use.
>
> Maybe I am missing things, but `__todo` should generate a warning at use
> site which _is_ the module definition of the thing using it.
Yes, that's right. The downside of __todo is that you can't specify the
text of the compiler warning. (The String argument is the text of the
runtime error.)
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150518/ba4e13b6/attachment.sig>
More information about the Haskell-Cafe
mailing list