Overview  Index  Help 
Standard ML Basis Library

Option


structure Option : OPTION =
struct
  open Assembly
  exception Option
  val getOpt : 'a option * 'a -> 'a
  val isSome : 'a option -> bool
  val valOf : 'a option -> 'a
  val filter : ('a -> bool) -> 'a -> 'a option
  val join : 'a option option -> 'a option
  val app : ('a -> unit) -> 'a option -> unit
  val map : ('a -> 'b) -> 'a option -> 'b option
  val mapPartial : ('a -> 'b option) -> 'a option -> 'b option
  val compose : ('a -> 'b) * ('c -> 'a option) -> 'c -> 'b option
  val composePartial : ('a -> 'b option) * ('c -> 'a option) -> 'c -> 'b option
end

       
Value detail

getOpt

val getOpt : 'a option * 'a -> 'a


isSome

val isSome : 'a option -> bool


valOf

val valOf : 'a option -> 'a


filter

val filter : ('a -> bool) -> 'a -> 'a option


join

val join : 'a option option -> 'a option


app

val app : ('a -> unit) -> 'a option -> unit


map

val map : ('a -> 'b) -> 'a option -> 'b option


mapPartial

val mapPartial : ('a -> 'b option) -> 'a option -> 'b option


compose

val compose : ('a -> 'b) * ('c -> 'a option) -> 'c -> 'b option


composePartial

val composePartial : ('a -> 'b option) * ('c -> 'a option) -> 'c -> 'b option

 
Exception detail

Option

exception Option


Overview  Index  Help 
Standard ML Basis Library

This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy.

Copyright © 2003 AT&T and Lucent Technologies. All rights reserved.

Permission is granted for internet users to make one paper copy for their own personal use. Further hardcopy reproduction is strictly prohibited. Permission to distribute the HTML document electronically on any medium other than the internet must be requested from the copyright holders by contacting the editors. Printed versions of the SML Basis Manual are available from Cambridge University Press. To order, please visit www.cup.org (North America) or www.cup.cam.ac.uk (outside North America).