<div dir="ltr">Implementation-wise, it's no so difficult to include - the lexer needs to be tweaked. But it seems like a specialised use-case that will only affect a minority of users is probably not worthwhile as an extension to the language/compiler.<div><br></div><div>Maybe you can try using OverloadedStrings and implement this as a library?</div><div><br></div><div>```</div><div>newtype Binary = Binary Integer</div><div> deriving Num</div><div><br></div><div>instance IsString Binary where</div><div> fromString binaryLiteral = error "Code here to parse binary literal with underscores"</div><div><br></div><div>binaryVal :: Binary</div><div>binaryVal = "1101_1110_0101"</div><div>```</div><div><br></div><div>Hope that helps,</div><div>Rahul</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 26, 2017 at 8:40 AM, Takenobu Tani <span dir="ltr"><<a href="mailto:takenobu.hs@gmail.com" target="_blank">takenobu.hs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear devs,<br><br>GHC's BinaryLiterals extension is useful.<br>(For example, x = 0b110111000101)<br><br>Is it difficult to include underscore(_) in the format like Verilog-HDL[1] ?<br>(For example, x = 0b1101_1100_0101)<br><br>[1]: <a href="https://inst.eecs.berkeley.edu/~cs150/fa06/Labs/verilog-ieee.pdf#page=20" target="_blank">https://inst.eecs.berkeley.<wbr>edu/~cs150/fa06/Labs/verilog-<wbr>ieee.pdf#page=20</a><br><br>Regards,<br>Takenobu<br><br></div>
<br>______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Rahul Muttineni</div>
</div>