SML# Document Version 4.0.0
26 Standard ML Basis Library

26.42 The top-level environment

Commonly used functions defined in libraries are replicated in the top-level environment. This section shows the top-level bindings of identifiers defined in the Standard ML Basis Library.

  • infix declarations

      infix 7 * / div mod
      infix 6 + - ^
      infixr 5 :: @
      infix 4 = <> > >= < <=
      infix 3 := o
      infix 0 before
    
  • type declarations

      type substring = Substring.substring
      datatype order = datatype General.order
    
  • exception declarations

      exception Bind = General.Bind
      exception Chr= General.Chr
      exception Div= General.Div
      exception Domain= General.Domain
      exception Empty = List.Empty
      exception Fail = General.Fail
      exception Match= General.Match
      exception Overflow= General.Overflow
      exception Size= General.Size
      exception Span= General.Span
      exception Subscript = General.Subscript
      exception Option = Option.Option
      exception Span = General.Span
    
  • val declaration

      val = = <builtin> : [’’a. ’’a * ’’a -> bool]}
      val <> = <builtin> : [’’a. ’’a * ’’a -> bool]}
      val ! = General.!
      val := = General.:=
      val @ = List.@
      val ^ = String.^
      val app = List.app
      val before = General.before
      val ceil = Real.ceil
      val chr = Char.chr
      val concat = String.concat
      val exnMessage = General.exnMessage
      val exnName = General.exnName
      val explode = String.explode
      val floor = Real.floor
      val foldl = List.foldl
      val foldr = List.foldr
      val getOpt = Option.getOpt
      val hd = List.hd
      val ignore = General.ignore
      val implode = String.implode
      val isSome = Option.isSome
      val length = List.length
      val map = List.map
      val not = Bool.not
      val null = List.null
      val o = General.o
      val ord = Char.ord
      val print = TextIO.print
      val real = Real.fromInt
      val rev = List.rev
      val round = Real.round
      val size = String.size
      val str = String.str
      val substring = String.substring
      val tl = List.tl
      val trunc = Real.trunc
      val valOf = Option.valOf
      val vector = Vector.fromList
    

    The equality check primitives = and <> are built-in functions that are directly supported by the SML# compiler.

  • Overloaded identifiers

      val * : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf, real, real32}. ’a * ’a -> ’a]
      val + : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf, real, real32}. ’a * ’a -> ’a]
      val - : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf, real, real32}. ’a * ’a -> ’a]
      val / : [’a::{real, real32}. ’a * ’a -> ’a]
      val < : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf, real, real32, string, char}. ’a * ’a -> ’a]
      val <= : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf, real, real32, string, char}. ’a * ’a -> ’a]
      val > : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf, real, real32, string, char}. ’a * ’a -> ’a]
      val >= : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf, real, real32, string, char}. ’a * ’a -> ’a]
      val \ : [’a::{real, real32}. ’a -> ’a]
      val abs : [’a::{int, int8, int16, int64, real, real32}. ’a -> ’a]
      val div : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf}. ’a * ’a -> ’a]
      val mod : [’a::{int, word, int8, word8, int16, word16, int64, word64, intInf}. ’a * ’a -> ’a]