<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>cabal now has the ability to be used for
[scripting](<a class="moz-txt-link-freetext" href="https://github.com/haskell/cabal/pull/5483#issuecomment-409633079">https://github.com/haskell/cabal/pull/5483#issuecomment-409633079</a>)
      which I think addresses your use case (at least, it's easier than
      forking base...).<br>
    </p>
    <div class="moz-cite-prefix">On 11/2/18 6:38 AM, Elliot Cameron
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANPxu=xvYK4=Mi_X29FRSCXArw70AtJcw2NkmWvuVj2XNXm4HA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="auto">Despite these subtleties, I must confess I've
        often wanted to whip up a quick script and been frustrated that
        these functions are missing from base. For example using Haskell
        as a sed/awk alternative can be pleasant *if* the functions you
        need are in base. What's more, in many years I've only really
        wanted one or two versions of this.
        <div dir="auto"><br>
        </div>
        <div dir="auto">What if we added the most flexible of versions
          and included only that? This version would accept
          multicharacter delimiters, always throw them away, and always
          produce a new entry in the result for every occurrence of the
          delimiter. If you don't want the empty entries, you can
          filter. If you don't want leading, you can dropWhile. If you
          want the delimiters back, you can map. This seems like a nice
          trade-off for just being available in base.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Fri, Nov 2, 2018, 1:51 AM Edward Kmett <<a
            href="mailto:ekmett@gmail.com" moz-do-not-send="true">ekmett@gmail.com</a>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">
            <div dir="ltr">The main thing that prevented it from going
              into base is the number of subtleties about what precisely
              it means to properly "split" something.</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">Most languages make fairly arbitrary calls on
              topics such as:</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">* Do you split on list elements (e.g. <font
                face="monospace, monospace">','</font>) or list of
              elements, so you can multi-character delimiters <font
                face="monospace, monospace">", "</font>? What about
              multiple types of thing that are all delimiters, e.g. any
              whitespace character?</div>
            <div dir="ltr">* What do you do with the delimiters?</div>
            <div dir="ltr">* What happens with runs of delimiters? </div>
            <div dir="ltr">* What about initial or final runs of
              delimiters (e.g. leading spaces)? <br>
              <br>
              The end result was that a <font face="monospace,
                monospace">split</font> package was written by Brent
              Yorgey back in 2008 or so that rather comprehensively
              covers the design space, and it was incorporated into the
              Haskell Platform.<br>
            </div>
            <div dir="ltr">
              <div><br>
              </div>
              <div><a
href="http://hackage.haskell.org/package/split-0.2.3.3/docs/Data-List-Split.html"
                  target="_blank" rel="noreferrer"
                  moz-do-not-send="true">http://hackage.haskell.org/package/split-0.2.3.3/docs/Data-List-Split.html</a></div>
              <div><br>
              </div>
              <div>-Edward</div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr">On Thu, Nov 1, 2018 at 1:34 PM Saurabh Nanda
              <<a href="mailto:saurabhnanda@gmail.com"
                target="_blank" rel="noreferrer" moz-do-not-send="true">saurabhnanda@gmail.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">This has certainly been discussed
                    before. A quick Google search turned up the
                    following past discussions:
                    <div>
                      <ul>
                        <li><a
href="https://mail.haskell.org/pipermail/libraries/2006-July/005494.html"
                            target="_blank" rel="noreferrer"
                            moz-do-not-send="true">https://mail.haskell.org/pipermail/libraries/2006-July/005494.html</a><br>
                        </li>
                        <li><a
href="https://mail.haskell.org/pipermail/libraries/2012-July/018228.html"
                            target="_blank" rel="noreferrer"
                            moz-do-not-send="true">https://mail.haskell.org/pipermail/libraries/2012-July/018228.html</a><br>
                        </li>
                      </ul>
                      <div>Is there anything blocking this discussion
                        & implementation? Anything that can be done
                        to unblock it?</div>
                    </div>
                    <div><br>
                    </div>
                    <div>-- Saurabh.</div>
                    <div><br>
                    </div>
                  </div>
                </div>
              </div>
              _______________________________________________<br>
              Libraries mailing list<br>
              <a href="mailto:Libraries@haskell.org" target="_blank"
                rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
              <a
                href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
                rel="noreferrer noreferrer" target="_blank"
                moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
            </blockquote>
          </div>
          _______________________________________________<br>
          Libraries mailing list<br>
          <a href="mailto:Libraries@haskell.org" target="_blank"
            rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
          <a
            href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
            rel="noreferrer noreferrer" target="_blank"
            moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Libraries mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libraries@haskell.org">Libraries@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a>
</pre>
    </blockquote>
    <div class="moz-signature">-- <br>
      <br>
      <br>
      <br>
      <strong
        style="color:#000;font-family:Helvetica,Arial;font-size:116%;">Vanessa
        McHale</strong><br>
      <span
        style="color:#000;font-family:Helvetica,Arial;font-size:100%;"><span
          style="color:#f00">Functional Compiler Engineer |</span>
        Chicago, IL</span>
      <br>
      <br>
      <span
        style="color:#999;font-family:Helvetica,Arial;font-size:85%;">Website:
        <a href="http://iohk.io" style="color:#f00;">www.iohk.io</a></span><br>
      <span
        style="color:#999;font-family:Helvetica,Arial;font-size:85%;">Twitter:
        @vamchale</span><br>
      <span
        style="color:#999;font-family:Helvetica,Arial;font-size:85%;">PGP
        Key ID: 4209B7B5</span><br>
      <br>
      <a href="http://iohk.io"><img
          src="https://static.iohk.io/logo/logo-email.png" alt="Input
          Output" width="200" height="46"></a>
      <br>
      <br>
      <a href="https://twitter.com/InputOutputHK"><img
          src="https://static.iohk.io/images/ic-tw.png" alt="Twitter"
          width="18" height="16"></a>
      <a href="https://github.com/input-output-hk"><img
          src="https://static.iohk.io/images/ic-gh.png" alt="Github"
          width="21" height="16"></a>
      <a href="https://www.linkedin.com/company/input-output-global"><img
          src="https://static.iohk.io/images/ic-li.png" alt="LinkedIn"
          width="19" height="16"></a>
      <br>
      <br>
      <br>
      <span
        style="color:#444;font-family:Helvetica,Arial;font-size:77%;"><small>This
          e-mail and any file transmitted with it are confidential and
          intended solely for the use of the recipient(s) to whom it is
          addressed. Dissemination, distribution, and/or copying of the
          transmission by anyone other than the intended recipient(s) is
          prohibited. If you have received this transmission in error
          please notify IOHK immediately and delete it from your system.
          E-mail transmissions cannot be guaranteed to be secure or
          error free. We do not accept liability for any loss, damage,
          or error arising from this transmission</small></span></div>
  </body>
</html>