Proposal: ValidateMonoLiterals - Initial bikeshed discussion

Joachim Breitner mail at joachim-breitner.de
Mon Feb 9 10:07:56 UTC 2015


Hi,

Am Freitag, den 06.02.2015, 15:54 -0500 schrieb Gershom B:
> I guess the remaining question is then where to add them. I suppose we
> could stick them with special semantics on Num and IsString or the
> like and do it by magic?
> 

speaking about magic. This reminds me of
https://ghc.haskell.org/trac/ghc/ticket/9180 which would add a function
staticError that, if present in the core after RULES had processed,
would emit a library author defined error at compile time.

So if you can implement your validation in terms of RULES, then you can
have RULES insert staticError expressions in the code if validation
fails.

In order to be useful for your purpose, you probably need the RULES
mechanism beefed up a bit, e.g. to allow implications, “magic”
predicates like "isLiteral" and some level of evaluation that might be
beyond what’s possible now, and eventually lead to something like the
static functions discussed in this thread, though.

Greetings,
Joachim




-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20150209/126c618d/attachment.sig>


More information about the ghc-devs mailing list