VSL - The data.option Structure
# Copyright 2011 Petter Urkedal
#
# This file is part of the Viz Standard Library <http://www.vizlang.org/>.
#
# The Viz Standard Library (VSL) is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# The VSL is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
# more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with the VSL. If not, see <http://www.gnu.org/licenses/>.
open prelude.ubiquitous
type t α := option α
val is_empty : option α → bool
val get : option α → α
val default : α → option α → α
val map : (α → β) → option α → option β
val fold : (α → β → β) → option α → β → β
val for_all : (α → bool) → option α → bool
val for_some : (α → bool) → option α → bool
val filter : (α → bool) → option α → option α
val flatten : option (option α) → option α
include prelude.option