Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/system/Basis/Implementation/mono-vector.sig
ViewVC logotype

View of /sml/trunk/system/Basis/Implementation/mono-vector.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4089 - (download) (as text) (annotate)
Thu Aug 13 11:31:29 2015 UTC (4 years, 9 months ago) by jhr
File size: 1547 byte(s)
  Adding preliminary support for new Basis Library functions.  Specifically, the
  monomorphic vector operations.
(* mono-vector.sig
 *
 * COPYRIGHT (c) 2015 The Fellowship of SML/NJ (http://www.smlnj.org)
 * All rights reserved.
 *
 * Generic interface for monomorphic vector structures.
 *)

signature MONO_VECTOR =
  sig

    type vector
    type elem

    val maxLen : int

  (* vector creation functions *)
    val fromList : elem list -> vector
    val tabulate : int * (int -> elem) -> vector

    val length   : vector -> int
    val sub      : vector * int -> elem
    val concat   : vector list -> vector

    val update : vector * int * elem -> vector

    val appi   : (int * elem -> unit) -> vector -> unit
    val app    : (elem -> unit) -> vector -> unit
    val mapi   : (int * elem -> elem) -> vector -> vector
    val map    : (elem -> elem) -> vector -> vector
    val foldli : (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
    val foldri : (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
    val foldl  : (elem * 'a -> 'a) -> 'a -> vector -> 'a
    val foldr  : (elem * 'a -> 'a) -> 'a -> vector -> 'a

    val findi  : (int * elem -> bool) -> vector -> (int * elem) option
    val find   : (elem -> bool) -> vector -> elem option
    val exists : (elem -> bool) -> vector -> bool
    val all    : (elem -> bool) -> vector -> bool
    val collate: (elem * elem -> order) -> vector * vector -> order

  end

(* includes Basis Library proposal 2015-003 *)
signature MONO_VECTOR_2015 =
  sig
    include MONO_VECTOR

    val toList  : vector -> elem list
    val append  : vector * elem -> vector
    val prepend : elem * vector -> vector

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0