2015 003 Additional operations on sequences

John Reppy edited this page Sep 2, 2018 · 9 revisions

2015-003

Additional operations on sequences

Author: John Reppy
Last revised: October 24, 2015
Status: proposed
Discussion: issue #3


This proposal includes the addition of additional operations on the various sequence types provided by the SML Basis Library. They cover common cases that were omitted in the original version of the Basis Library. We put each module on its own page, but the collection of pages is meant to be considered as a single proposal.

Impact

This propsal adds new variables to existing basis modules. Most code should be unaffected, but there are a few uncommon situations where existing code will break. These situations include

  • code that opens an extended structure in a context where the new identifiers are already bound. For example

      fun fold x = x
      open Option
      val y = map fold (SOME 1)
  • code that includes an extended signature in a context where the new identifiers are already bound. For example

      sig
        val fold : 'a -> 'a
        include OPTION
      end
  • structures that match the old signature, but do not include an implementation of the new operations.

Rationale

This proposal adds various useful utility functions to the various sequence types in the Basis Library. Each module has a more detailed discussion of the rationale.

History

  • [2015-10-27] Added find and findi to the ListPair extensions (as suggested by Andreas Rossberg).
  • [2015-10-24] Added mapUnzip and mapUnzipi to the ListPair extensions.
  • [2015-08-12] Various tweaks to the format of the proposal and added impact and rationale sections.
  • [2015-08-03] Proposed

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.