You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(56) |
Sep
(40) |
Oct
(30) |
Nov
(144) |
Dec
(23) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(41) |
Feb
(29) |
Mar
(31) |
Apr
(39) |
May
(193) |
Jun
(45) |
Jul
(19) |
Aug
(3) |
Sep
(23) |
Oct
(83) |
Nov
(92) |
Dec
(123) |
| 2007 |
Jan
(90) |
Feb
(267) |
Mar
(120) |
Apr
(51) |
May
(40) |
Jun
(121) |
Jul
(109) |
Aug
(173) |
Sep
(77) |
Oct
(52) |
Nov
(121) |
Dec
(62) |
| 2008 |
Jan
(76) |
Feb
(53) |
Mar
(98) |
Apr
(87) |
May
(26) |
Jun
(27) |
Jul
(23) |
Aug
(136) |
Sep
(79) |
Oct
(68) |
Nov
(29) |
Dec
(14) |
| 2009 |
Jan
(7) |
Feb
(2) |
Mar
(11) |
Apr
(75) |
May
(1) |
Jun
(95) |
Jul
(19) |
Aug
(4) |
Sep
(8) |
Oct
(93) |
Nov
(43) |
Dec
(21) |
| 2010 |
Jan
(20) |
Feb
(23) |
Mar
(18) |
Apr
(6) |
May
(20) |
Jun
(23) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
(6) |
Mar
(15) |
Apr
(5) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(17) |
Jul
(37) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(8) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(4) |
| 2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(7) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(1) |
Sep
(2) |
Oct
(17) |
Nov
(4) |
Dec
(7) |
| 2018 |
Jan
(5) |
Feb
(14) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(5) |
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(5) |
Dec
|
| 2019 |
Jan
(4) |
Feb
(2) |
Mar
(3) |
Apr
(1) |
May
(8) |
Jun
(14) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(9) |
Jun
(4) |
Jul
(16) |
Aug
(10) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
|
| 2021 |
Jan
(11) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(6) |
Nov
(4) |
Dec
(4) |
| 2022 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(13) |
Dec
|
| 2024 |
Jan
(1) |
Feb
|
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(14) |
| 2025 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
|
From: Matthew F. <fl...@ml...> - 2006-11-27 15:08:50
|
Adam Goode's Makefile patches:
Replace all instances of plain old "=" with ":=", except in
packages/freebsd/Makefile since I have no way of testing it. This
should result in faster build times and less possibility for confusion
in the future. Note that bytecode/Makefile actually relied on the
semantics of lazy assignment, so I had to reorder some lines in the
file. I don't believe any other Makefile in the MLton tree was
sensitive to this issue.
bytecode/Makefile is missing the TARGET_OS variable. This could cause
the build to fail strangely when not building from the toplevel
Makefile (which exports TARGET_OS). runtime/Makefile correctly defines
this variable.
----------------------------------------------------------------------
U mlton/trunk/Makefile
U mlton/trunk/basis-library/libs/basis-2002/top-level/Makefile
U mlton/trunk/benchmark/Makefile
U mlton/trunk/bytecode/Makefile
U mlton/trunk/doc/examples/ffi/Makefile
U mlton/trunk/doc/examples/finalizable/Makefile
U mlton/trunk/doc/examples/profiling/Makefile
U mlton/trunk/doc/examples/save-world/Makefile
U mlton/trunk/doc/hacker-guide/Makefile
U mlton/trunk/doc/library-guide/Makefile
U mlton/trunk/doc/mlb-formal/Makefile
U mlton/trunk/doc/style-guide/Makefile
U mlton/trunk/lib/opengl/Makefile
U mlton/trunk/mllex/Makefile
U mlton/trunk/mlnlffigen/Makefile
U mlton/trunk/mlprof/Makefile
U mlton/trunk/mlton/Makefile
U mlton/trunk/mlton/front-end/Makefile
U mlton/trunk/mlyacc/Makefile
U mlton/trunk/runtime/Makefile
----------------------------------------------------------------------
Modified: mlton/trunk/Makefile
===================================================================
--- mlton/trunk/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,47 +6,51 @@
# See the file MLton-LICENSE for details.
##
-export TARGET = self
-export TARGET_ARCH = $(shell bin/host-arch)
-export TARGET_OS = $(shell bin/host-os)
-ROOT = $(shell pwd)
-BUILD = $(ROOT)/build
-SRC = $(ROOT)
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-INC = $(LIB)/include
-COMP = $(SRC)/mlton
-RUN = $(SRC)/runtime
-MLTON = $(BIN)/mlton
-AOUT = mlton-compile
+export TARGET := self
+export TARGET_ARCH := $(shell bin/host-arch)
+export TARGET_OS := $(shell bin/host-os)
+ROOT := $(shell pwd)
+BUILD := $(ROOT)/build
+SRC := $(ROOT)
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+INC := $(LIB)/include
+COMP := $(SRC)/mlton
+RUN := $(SRC)/runtime
+MLTON := $(BIN)/mlton
+AOUT := mlton-compile
ifeq (mingw, $(TARGET_OS))
-EXE = .exe
+EXE := .exe
else
-EXE =
+EXE :=
endif
-MLBPATHMAP = $(LIB)/mlb-path-map
-TARGETMAP = $(LIB)/target-map
-SPEC = package/rpm/mlton.spec
-LEX = mllex
-PROF = mlprof
-YACC = mlyacc
-NLFFIGEN = mlnlffigen
-PATH = $(BIN):$(SRC)/bin:$(shell echo $$PATH)
-CP = /bin/cp -fpR
-GZIP = gzip --force --best
-RANLIB = ranlib
+MLBPATHMAP := $(LIB)/mlb-path-map
+TARGETMAP := $(LIB)/target-map
+SPEC := package/rpm/mlton.spec
+LEX := mllex
+PROF := mlprof
+YACC := mlyacc
+NLFFIGEN := mlnlffigen
+PATH := $(BIN):$(SRC)/bin:$(shell echo $$PATH)
+CP := /bin/cp -fpR
+GZIP := gzip --force --best
+RANLIB := ranlib
# If we're compiling with another version of MLton, then we want to do
# another round of compilation so that we get a MLton built without
# stubs.
ifeq (other, $(shell if [ ! -x $(BIN)/mlton ]; then echo other; fi))
- BOOTSTRAP_OTHER=true
+ BOOTSTRAP_OTHER:=true
else
- BOOTSTRAP_OTHER=false
+ BOOTSTRAP_OTHER:=false
endif
-VERSION ?= $(shell date +%Y%m%d)
-RELEASE ?= 1
+ifeq ($(origin VERSION), undefined)
+ VERSION := $(shell date +%Y%m%d)
+endif
+ifeq ($(origin RELEASE), undefined)
+ RELEASE := 1
+endif
.PHONY: all
all:
@@ -109,7 +113,7 @@
./tmp >$(LIB)/$(TARGET)/constants
rm -f tmp tmp.c
-DEBSRC = mlton-$(VERSION).orig
+DEBSRC := mlton-$(VERSION).orig
.PHONY: deb
deb:
$(MAKE) clean clean-svn version
@@ -157,7 +161,7 @@
bin/make-pdf-guide; \
fi
-BSDSRC = /tmp/mlton-$(VERSION)
+BSDSRC := /tmp/mlton-$(VERSION)
.PHONY: freebsd
freebsd:
$(MAKE) clean clean-svn version
@@ -169,7 +173,7 @@
# do not change "make" to "$(MAKE)" in the following line
cd $(BSDSRC)/package/freebsd && MAINTAINER_MODE=yes make build-package
-LIBRARIES = ckit-lib cml mlnlffi-lib mlyacc-lib smlnj-lib
+LIBRARIES := ckit-lib cml mlnlffi-lib mlyacc-lib smlnj-lib
.PHONY: libraries-no-check
libraries-no-check:
@@ -262,8 +266,8 @@
chmod a+x $(MLTON).count
chmod a+x $(MLTON).time
-TOPDIR = 'TOPDIR-unset'
-SOURCEDIR = $(TOPDIR)/SOURCES/mlton-$(VERSION)
+TOPDIR := 'TOPDIR-unset'
+SOURCEDIR := $(TOPDIR)/SOURCES/mlton-$(VERSION)
.PHONY: rpms
rpms:
$(MAKE) clean clean-svn version
@@ -352,44 +356,44 @@
# The TBIN and TLIB are where the files are going to be after installing.
# The DESTDIR and is added onto them to indicate where the Makefile actually
# puts them.
-DESTDIR = $(CURDIR)/install
-PREFIX = /usr
+DESTDIR := $(CURDIR)/install
+PREFIX := /usr
ifeq ($(TARGET_OS), cygwin)
-PREFIX = /
+PREFIX := /
endif
ifeq ($(TARGET_OS), darwin)
-PREFIX = /usr/local
+PREFIX := /usr/local
endif
ifeq ($(TARGET_OS), mingw)
-PREFIX = /mingw
+PREFIX := /mingw
endif
ifeq ($(TARGET_OS), solaris)
-PREFIX = /usr/local
+PREFIX := /usr/local
endif
-prefix = $(PREFIX)
-MAN_PREFIX_EXTRA =
-TBIN = $(DESTDIR)$(prefix)/bin
-ULIB = lib/mlton
-TLIB = $(DESTDIR)$(prefix)/$(ULIB)
-TMAN = $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1
-TDOC = $(DESTDIR)$(prefix)/share/doc/mlton
+prefix := $(PREFIX)
+MAN_PREFIX_EXTRA :=
+TBIN := $(DESTDIR)$(prefix)/bin
+ULIB := lib/mlton
+TLIB := $(DESTDIR)$(prefix)/$(ULIB)
+TMAN := $(DESTDIR)$(prefix)$(MAN_PREFIX_EXTRA)/man/man1
+TDOC := $(DESTDIR)$(prefix)/share/doc/mlton
ifeq ($(TARGET_OS), cygwin)
-TDOC = $(DESTDIR)$(prefix)/usr/share/doc/mlton
+TDOC := $(DESTDIR)$(prefix)/usr/share/doc/mlton
endif
ifeq ($(TARGET_OS), solaris)
-TDOC = $(DESTDIR)$(prefix)/doc/mlton
+TDOC := $(DESTDIR)$(prefix)/doc/mlton
endif
-TEXM = $(TDOC)/examples
+TEXM := $(TDOC)/examples
-GZIP_MAN = true
+GZIP_MAN := true
ifeq ($(TARGET_OS), solaris)
-GZIP_MAN = false
+GZIP_MAN := false
endif
.PHONY: install
install: install-docs install-no-docs
-MAN_PAGES = \
+MAN_PAGES := \
mllex.1 \
mlnlffigen.1 \
mlprof.1 \
@@ -447,7 +451,7 @@
find $(TEXM)/ -name .svn -type d | xargs rm -rf
find $(TEXM)/ -name .ignore -type f | xargs rm -rf
-TDOCBASE = $(DESTDIR)$(prefix)/share/doc-base
+TDOCBASE := $(DESTDIR)$(prefix)/share/doc-base
.PHONY: post-install-debian
post-install-debian:
Modified: mlton/trunk/basis-library/libs/basis-2002/top-level/Makefile
===================================================================
--- mlton/trunk/basis-library/libs/basis-2002/top-level/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/basis-library/libs/basis-2002/top-level/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -5,7 +5,7 @@
# See the file MLton-LICENSE for details.
##
-GEN = generate-overloads
+GEN := generate-overloads
overloads.sml: $(GEN).sml
mlton $(GEN).sml
Modified: mlton/trunk/benchmark/Makefile
===================================================================
--- mlton/trunk/benchmark/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/benchmark/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,17 +6,17 @@
# See the file MLton-LICENSE for details.
##
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET) \
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET) \
-default-ann 'sequenceNonUnit warn' \
-default-ann 'warnUnused true'
-NAME = benchmark
-PATH = $(BIN):$(shell echo $$PATH)
+NAME := benchmark
+PATH := $(BIN):$(shell echo $$PATH)
all: $(NAME)
@@ -40,19 +40,19 @@
tags:
etags *.fun *.sig *.sml
-BENCH = barnes-hut boyer checksum count-graphs DLXSimulator fft fib flat-array hamlet imp-for knuth-bendix lexgen life logic mandelbrot matrix-multiply md5 merge mlyacc model-elimination mpuz nucleic output1 peek psdes-random ratio-regions ray raytrace simple smith-normal-form tailfib tak tensor tsp tyan vector-concat vector-rev vliw wc-input1 wc-scanStream zebra zern
-FPBENCH = barnes-hut fft hamlet mandelbrot matrix-multiply nucleic ray raytrace simple tensor tsp tyan vliw zern
+BENCH := barnes-hut boyer checksum count-graphs DLXSimulator fft fib flat-array hamlet imp-for knuth-bendix lexgen life logic mandelbrot matrix-multiply md5 merge mlyacc model-elimination mpuz nucleic output1 peek psdes-random ratio-regions ray raytrace simple smith-normal-form tailfib tak tensor tsp tyan vector-concat vector-rev vliw wc-input1 wc-scanStream zebra zern
+FPBENCH := barnes-hut fft hamlet mandelbrot matrix-multiply nucleic ray raytrace simple tensor tsp tyan vliw zern
-BFLAGS = -mlton "/usr/bin/mlton" -mlton "mlton -optimize-ssa {false,true}"
-BFLAGS = -wiki -mlton "/usr/bin/mlton" -mlkit -mosml -poly -smlnj
-BFLAGS = -mlton "$(BIN)/mlton"
+BFLAGS := -mlton "/usr/bin/mlton" -mlton "mlton -optimize-ssa {false,true}"
+BFLAGS := -wiki -mlton "/usr/bin/mlton" -mlkit -mosml -poly -smlnj
+BFLAGS := -mlton "$(BIN)/mlton"
.PHONY: test
test: $(NAME)
cd tests && ../benchmark $(BFLAGS) $(BENCH)
-QBENCH = $(BENCH)
-QBFLAGS = -mlton "mlton{-stable,.cvs.HEAD -detect-overflow {false,true}}"
+QBENCH := $(BENCH)
+QBFLAGS := -mlton "mlton{-stable,.cvs.HEAD -detect-overflow {false,true}}"
.PHONY: qtest
qtest: $(NAME)
Modified: mlton/trunk/bytecode/Makefile
===================================================================
--- mlton/trunk/bytecode/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/bytecode/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -5,19 +5,13 @@
# See the file MLton-LICENSE for details.
##
-TARGET_ARCH = $(shell ../bin/host-arch)
+TARGET_ARCH := $(shell ../bin/host-arch)
+TARGET_OS := $(shell ../bin/host-os)
all: interpret.o interpret-gdb.o print-opcodes
-CC = gcc -std=gnu99
-CFLAGS = -fomit-frame-pointer -I../runtime -I../include -Wall
-DEBUGFLAGS = $(CFLAGS)
-ifneq ($(TARGET_ARCH), ia64)
-ifneq ($(TARGET_ARCH), powerpc)
-DEBUGFLAGS += -gstabs+
-endif
-endif
-DEBUGFLAGS += -g2
+CC := gcc -std=gnu99
+CFLAGS := -fomit-frame-pointer -I../runtime -I../include -Wall
ifeq ($(TARGET_ARCH), amd64)
CFLAGS += -m32
@@ -32,6 +26,14 @@
CFLAGS += -I/usr/local/include
endif
+DEBUGFLAGS := $(CFLAGS)
+ifneq ($(TARGET_ARCH), ia64)
+ifneq ($(TARGET_ARCH), powerpc)
+DEBUGFLAGS += -gstabs+
+endif
+endif
+DEBUGFLAGS += -g2
+
interpret.o: interpret.c interpret.h opcode.h
$(CC) $(CFLAGS) -c -O2 $(OPTFLAGS) interpret.c
Modified: mlton/trunk/doc/examples/ffi/Makefile
===================================================================
--- mlton/trunk/doc/examples/ffi/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/examples/ffi/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,9 +6,9 @@
# See the file MLton-LICENSE for details.
##
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
-mlton = mlton -default-ann 'allowFFI true'
+mlton := mlton -default-ann 'allowFFI true'
.PHONY: all
all: import import2 export iimport test_quot
Modified: mlton/trunk/doc/examples/finalizable/Makefile
===================================================================
--- mlton/trunk/doc/examples/finalizable/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/examples/finalizable/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -5,9 +5,9 @@
# See the file MLton-LICENSE for details.
##
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
-mlton = mlton -default-ann 'allowFFI true'
+mlton := mlton -default-ann 'allowFFI true'
all:
$(mlton) finalizable.sml cons.c
Modified: mlton/trunk/doc/examples/profiling/Makefile
===================================================================
--- mlton/trunk/doc/examples/profiling/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/examples/profiling/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,14 +6,14 @@
# See the file MLton-LICENSE for details.
##
-mlton = mlton
-mlprof = mlprof
-ALLOC_EX = list-rev
-COUNT_EX = tak
-MULT_EX = fib-tak
-TIME_EX = tak
+mlton := mlton
+mlprof := mlprof
+ALLOC_EX := list-rev
+COUNT_EX := tak
+MULT_EX := fib-tak
+TIME_EX := tak
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
.PHONY: all
all: profile-time profile-alloc profile-count profile-stack profile-multiple
Modified: mlton/trunk/doc/examples/save-world/Makefile
===================================================================
--- mlton/trunk/doc/examples/save-world/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/examples/save-world/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,9 +6,9 @@
# See the file MLton-LICENSE for details.
##
-PATH = ../../../build/bin:$(shell echo $$PATH)
+PATH := ../../../build/bin:$(shell echo $$PATH)
-mlton = mlton
+mlton := mlton
all: test
Modified: mlton/trunk/doc/hacker-guide/Makefile
===================================================================
--- mlton/trunk/doc/hacker-guide/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/hacker-guide/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,7 +6,7 @@
# See the file MLton-LICENSE for details.
##
-TEX_FILES = \
+TEX_FILES := \
abstract.tex \
basis-library.tex \
main.tex \
@@ -16,7 +16,7 @@
runtime.tex \
sources.tex \
-FIG_FILES = \
+FIG_FILES := \
structure.ps \
all: main.ps
Modified: mlton/trunk/doc/library-guide/Makefile
===================================================================
--- mlton/trunk/doc/library-guide/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/library-guide/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,12 +6,12 @@
# See the file MLton-LICENSE for details.
##
-TEX_FILES = \
+TEX_FILES := \
abstract.tex \
main.tex \
macros.tex \
-FIG_FILES = \
+FIG_FILES := \
all: main.ps
Modified: mlton/trunk/doc/mlb-formal/Makefile
===================================================================
--- mlton/trunk/doc/mlb-formal/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/mlb-formal/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -5,7 +5,7 @@
# See the file MLton-LICENSE for details.
##
-TEX_FILES = \
+TEX_FILES := \
bib.bib \
mlb-formal.tex
Modified: mlton/trunk/doc/style-guide/Makefile
===================================================================
--- mlton/trunk/doc/style-guide/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/doc/style-guide/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,12 +6,12 @@
# See the file MLton-LICENSE for details.
##
-TEX_FILES = \
+TEX_FILES := \
abstract.tex \
main.tex \
macros.tex \
-FIG_FILES = \
+FIG_FILES := \
all: main.ps
Modified: mlton/trunk/lib/opengl/Makefile
===================================================================
--- mlton/trunk/lib/opengl/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/lib/opengl/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -1,11 +1,11 @@
-mlton = mlton
-MLTON_FLAGS = \
+mlton := mlton
+MLTON_FLAGS := \
-default-ann 'allowFFI true' \
-target-link-opt cygwin '-L/lib/w32api -lglut32 -lglu32 -lopengl32' \
-target-link-opt darwin '-framework GLUT -framework OpenGL -framework Foundation' \
-target-link-opt linux '-lglut -lGLU -lGL'
-GL_OBJS = GL_c.o GLUT_c.o
+GL_OBJS := GL_c.o GLUT_c.o
%_h.h: %.cm %.sig %.sml
$(mlton) $(MLTON_FLAGS) -export-header $@ -stop tc $<
Modified: mlton/trunk/mllex/Makefile
===================================================================
--- mlton/trunk/mllex/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/mllex/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,15 +6,15 @@
# See the file MLton-LICENSE for details.
##
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET)
-NAME = mllex
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET)
+NAME := mllex
+PATH := $(BIN):$(shell echo $$PATH)
all: $(NAME)
Modified: mlton/trunk/mlnlffigen/Makefile
===================================================================
--- mlton/trunk/mlnlffigen/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/mlnlffigen/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -5,15 +5,15 @@
# See the file MLton-LICENSE for details.
##
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET) -default-ann 'sequenceNonUnit warn'
-NAME = mlnlffigen
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET) -default-ann 'sequenceNonUnit warn'
+NAME := mlnlffigen
+PATH := $(BIN):$(shell echo $$PATH)
all: $(NAME)
Modified: mlton/trunk/mlprof/Makefile
===================================================================
--- mlton/trunk/mlprof/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/mlprof/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,15 +6,15 @@
# See the file MLton-LICENSE for details.
##
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET) -default-ann 'sequenceNonUnit warn' -default-ann 'warnUnused true'
-NAME = mlprof
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET) -default-ann 'sequenceNonUnit warn' -default-ann 'warnUnused true'
+NAME := mlprof
+PATH := $(BIN):$(shell echo $$PATH)
all: $(NAME)
Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/mlton/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,38 +6,38 @@
# See the file MLton-LICENSE for details.
##
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-HOST_ARCH = $(shell $(SRC)/bin/host-arch)
-HOST_OS = $(shell $(SRC)/bin/host-os)
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-AOUT = mlton-compile
-UP = upgrade-basis.sml
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+HOST_ARCH := $(shell $(SRC)/bin/host-arch)
+HOST_OS := $(shell $(SRC)/bin/host-os)
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+AOUT := mlton-compile
+UP := upgrade-basis.sml
+PATH := $(BIN):$(shell echo $$PATH)
-FLAGS = @MLton max-heap 640m ram-slop 0.7 gc-summary $(RUNTIME_ARGS) --
+FLAGS := @MLton max-heap 640m ram-slop 0.7 gc-summary $(RUNTIME_ARGS) --
ifeq (self, $(shell if [ -x $(BIN)/mlton ]; then echo self; fi))
# We're compiling MLton with itself, so don't use any stubs.
- FILE = mlton.mlb
+ FILE := mlton.mlb
FLAGS += -default-ann 'sequenceNonUnit warn'
FLAGS += -default-ann 'warnUnused true'
else
ifeq (cygwin, $(HOST_OS))
# The stubs don't work on Cygwin, since they define spawn in terms of
# fork, and fork doesn't work on Cygwin. So, make without the stubs.
- FILE = mlton.cm
+ FILE := mlton.cm
else
ifeq (mingw, $(HOST_OS))
# Ditto for MinGW.
- FILE = mlton.cm
+ FILE := mlton.cm
else
# We're compiling MLton with an older version of itself, so use the stubs for
# the MLton structure.
- FILE = mlton-stubs.cm
+ FILE := mlton-stubs.cm
endif
endif
endif
@@ -54,7 +54,7 @@
endif
FLAGS += $(COMPILE_ARGS)
-SOURCES = \
+SOURCES := \
$(FILE) \
$(UP) \
front-end/ml.lex.sml \
@@ -102,7 +102,7 @@
# Manager (CM) installed. You may need to replace the following with
# 'sml-cm'.
#
-SML = sml
+SML := sml
.PHONY: def-use
def-use:
Modified: mlton/trunk/mlton/front-end/Makefile
===================================================================
--- mlton/trunk/mlton/front-end/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/mlton/front-end/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,10 +6,10 @@
# See the file MLton-LICENSE for details.
##
-SRC = $(shell cd ../.. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd ../.. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+PATH := $(BIN):$(shell echo $$PATH)
.PHONY: all
all: ml.lex.sml ml.grm.sig ml.grm.sml mlb.lex.sml mlb.grm.sig mlb.grm.sml
Modified: mlton/trunk/mlyacc/Makefile
===================================================================
--- mlton/trunk/mlyacc/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/mlyacc/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,15 +6,15 @@
# See the file MLton-LICENSE for details.
##
-SRC = $(shell cd .. && pwd)
-BUILD = $(SRC)/build
-BIN = $(BUILD)/bin
-LIB = $(BUILD)/lib
-MLTON = mlton
-TARGET = self
-FLAGS = -target $(TARGET)
-NAME = mlyacc
-PATH = $(BIN):$(shell echo $$PATH)
+SRC := $(shell cd .. && pwd)
+BUILD := $(SRC)/build
+BIN := $(BUILD)/bin
+LIB := $(BUILD)/lib
+MLTON := mlton
+TARGET := self
+FLAGS := -target $(TARGET)
+NAME := mlyacc
+PATH := $(BIN):$(shell echo $$PATH)
all: $(NAME)
Modified: mlton/trunk/runtime/Makefile
===================================================================
--- mlton/trunk/runtime/Makefile 2006-11-27 12:37:26 UTC (rev 4862)
+++ mlton/trunk/runtime/Makefile 2006-11-27 23:08:46 UTC (rev 4863)
@@ -6,15 +6,15 @@
# See the file MLton-LICENSE for details.
##
-PATH = ../bin:$(shell echo $$PATH)
+PATH := ../bin:$(shell echo $$PATH)
-TARGET = self
-TARGET_ARCH = $(shell ../bin/host-arch)
-TARGET_OS = $(shell ../bin/host-os)
-GCC_VERSION = $(shell gcc -v 2>&1 | grep 'gcc version' | sed 's/.*gcc version \(.\).*/\1/')
+TARGET := self
+TARGET_ARCH := $(shell ../bin/host-arch)
+TARGET_OS := $(shell ../bin/host-os)
+GCC_VERSION := $(shell gcc -v 2>&1 | grep 'gcc version' | sed 's/.*gcc version \(.\).*/\1/')
-FLAGS =
-OPTFLAGS = -fomit-frame-pointer
+FLAGS :=
+OPTFLAGS := -fomit-frame-pointer
ifeq ($(TARGET_ARCH), x86)
ifneq ($(findstring $(GCC_VERSION), 3 4),)
@@ -46,17 +46,17 @@
endif
ifeq ($(TARGET), self)
-AR = ar rc
-RANLIB = ranlib
+AR := ar rc
+RANLIB := ranlib
else
-AR = $(TARGET)-ar rc
-RANLIB = $(TARGET)-ranlib
+AR := $(TARGET)-ar rc
+RANLIB := $(TARGET)-ranlib
FLAGS += -b $(TARGET)
endif
-CC = gcc -std=gnu99
-CFLAGS = -O2 -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 $(FLAGS) $(OPTFLAGS)
-DEBUGFLAGS = $(CFLAGS)
+CC := gcc -std=gnu99
+CFLAGS := -O2 -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 $(FLAGS) $(OPTFLAGS)
+DEBUGFLAGS := $(CFLAGS)
ifneq ($(TARGET_ARCH), ia64)
ifneq ($(TARGET_ARCH), powerpc)
DEBUGFLAGS += -gstabs+
@@ -64,35 +64,35 @@
endif
DEBUGFLAGS += -g2
-CFILES = \
+CFILES := \
$(shell find basis -type f | grep '\.c$$' | grep -v Real/) \
$(shell find Posix -type f | grep '\.c$$') \
gc.c \
platform.c
-HFILES = \
+HFILES := \
gc.h \
types.h \
platform.h \
platform/$(TARGET_OS).h
-FILES = $(basename $(CFILES))
+FILES := $(basename $(CFILES))
# EXTRA_CFILES is for files that we don't want compiled in the big
# lump when compiling COMPILE_FAST.
# Real/*.c can't be there because gcc -O2 messes some of them up.
-EXTRA_CFILES = \
+EXTRA_CFILES := \
$(shell find basis/Real -type f | grep '\.c$$') \
platform/$(TARGET_OS).c
-EXTRA_FILES = $(basename $(EXTRA_CFILES))
+EXTRA_FILES := $(basename $(EXTRA_CFILES))
ifeq ($(COMPILE_FAST), yes)
- OBJS = runtime.o
- DEBUG_OBJS = runtime-gdb.o
+ OBJS := runtime.o
+ DEBUG_OBJS := runtime-gdb.o
else
- OBJS = $(foreach f, $(FILES), $(f).o)
- DEBUG_OBJS = $(foreach f, $(FILES), $(f)-gdb.o)
+ OBJS := $(foreach f, $(FILES), $(f).o)
+ DEBUG_OBJS := $(foreach f, $(FILES), $(f)-gdb.o)
endif
OBJS += $(foreach f, $(EXTRA_FILES), $(f).o)
|
|
From: Vesa K. <ve...@ml...> - 2006-11-27 04:37:32
|
Added minimal implementations of dlopen, dlclose, dlsym, and dlerror for
MinGW.
Emulation of dlopen(NULL, ...) behavior is problematic. The current
implementation just returns GetModuleHandle(NULL) which has a similar
meaning. Unfortunately, you can't access the C runtime from the returned
handle nor can you access symbols that have not been explicitly exported.
----------------------------------------------------------------------
U mlton/trunk/runtime/platform/mingw.c
----------------------------------------------------------------------
Modified: mlton/trunk/runtime/platform/mingw.c
===================================================================
--- mlton/trunk/runtime/platform/mingw.c 2006-11-27 09:36:16 UTC (rev 4861)
+++ mlton/trunk/runtime/platform/mingw.c 2006-11-27 12:37:26 UTC (rev 4862)
@@ -748,3 +748,91 @@
WSAStartup (version, &wsaData);
}
}
+
+/* ------------------------------------------------- */
+/* libdl */
+/* ------------------------------------------------- */
+
+static DWORD dlerror_last = ERROR_SUCCESS;
+/* This is for emulating the ugly stateful behavior of dlerror. */
+
+static HMODULE dl_main_module = NULL;
+/* Handle to the main module returned by GetModuleHandle(NULL). It is
+ * assumed that the main module isn't freed during the lifetime of the
+ * process.
+ */
+
+void *dlopen(const char *filename, int flag_IGNORED) {
+ if (!filename) {
+ if (!dl_main_module)
+ dl_main_module = GetModuleHandle(NULL);
+
+ if (!dl_main_module)
+ dlerror_last = GetLastError();
+
+ return dl_main_module;
+ }
+
+ {
+ HMODULE result = LoadLibrary(filename);
+
+ if (!result)
+ dlerror_last = GetLastError();
+
+ return result;
+ }
+}
+
+const char *dlerror(void) {
+ if (ERROR_SUCCESS == dlerror_last) {
+ return NULL;
+ } else {
+ static char buffer[256];
+
+ if (!FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL, dlerror_last, 0,
+ buffer, sizeof(buffer),
+ NULL))
+ snprintf(buffer, sizeof(buffer),
+ "Failed to format error message");
+
+ dlerror_last = ERROR_SUCCESS;
+
+ return buffer;
+ }
+}
+
+void *dlsym(void *void_hmodule, const char *symbol) {
+ HMODULE hmodule = void_hmodule;
+
+ if (!hmodule) {
+ dlerror_last = ERROR_INVALID_HANDLE;
+ return NULL;
+ }
+
+ {
+ void* result = GetProcAddress(hmodule, symbol);
+
+ if (!result)
+ dlerror_last = GetLastError();
+
+ return result;
+ }
+}
+
+int dlclose(void *void_hmodule) {
+ HMODULE hmodule = void_hmodule;
+
+ if (!hmodule || hmodule == dl_main_module)
+ return 0;
+
+ {
+ int result = !FreeLibrary(hmodule);
+
+ if (result)
+ dlerror_last = GetLastError();
+
+ return result;
+ }
+}
|
|
From: Vesa K. <ve...@ml...> - 2006-11-27 01:36:19
|
Changed to import malloc and free statically rather than dynamically
(through dl* functions). The reason for this change is that dynamic
import of malloc and free is problematic on at least the MinGW platform
and there seems to be no reason to prefer dynamic import.
----------------------------------------------------------------------
U mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml
----------------------------------------------------------------------
Modified: mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml
===================================================================
--- mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml 2006-11-22 16:50:00 UTC (rev 4860)
+++ mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml 2006-11-27 09:36:16 UTC (rev 4861)
@@ -21,6 +21,7 @@
type addr = Ptr.t
type addr' = addr
+(*
structure DL = DynLinkage
fun main's s = DL.lib_symbol (DL.main_lib, s)
@@ -37,8 +38,8 @@
let val p_u = _import * : MLton.Pointer.t -> addr -> unit;
in p_u (DL.addr free_h) a
end
+*)
-(*
fun sys_malloc (n : Word32.word) =
let val w_p = _import "malloc" : Word32.word -> addr;
val a = w_p n
@@ -49,7 +50,6 @@
let val p_u = _import "free" : addr -> unit;
in p_u a
end
-*)
fun alloc bytes = sys_malloc bytes
fun free a = sys_free a
|
|
From: Vesa K. <ve...@ml...> - 2006-11-22 08:50:13
|
Documentation.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/reader.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/writer.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/reader.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/reader.sig 2006-11-22 16:26:48 UTC (rev 4859)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/reader.sig 2006-11-22 16:50:00 UTC (rev 4860)
@@ -13,9 +13,12 @@
val return : 'a -> ('a, 's) t
val >>= : ('a, 's) t * ('a -> ('b, 's) t) -> ('b, 's) t
+ (** == Functor Interface == *)
+
+ val map : ('a -> 'b) -> ('a, 's) t -> ('b, 's) t
+
(** == Useful Combinators == *)
- val map : ('a -> 'b) -> ('a, 's) t -> ('b, 's) t
val >>& : ('a, 's) t * ('b, 's) t -> (('a, 'b) Product.t, 's) t
(** == Typing == *)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/writer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/writer.sig 2006-11-22 16:26:48 UTC (rev 4859)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/writer.sig 2006-11-22 16:50:00 UTC (rev 4860)
@@ -8,7 +8,7 @@
signature WRITER = sig
type ('a, 'b) t = 'a * 'b -> 'b
- (** == Useful Combinators == *)
+ (** == Functor Interface == *)
val map : ('b -> 'a) -> ('a, 's) t -> ('b, 's) t
|
|
From: Vesa K. <ve...@ml...> - 2006-11-22 08:27:11
|
Minor refactoring.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml 2006-11-22 16:26:08 UTC (rev 4858)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml 2006-11-22 16:26:48 UTC (rev 4859)
@@ -17,7 +17,11 @@
== = isEqual o cmp, != = not o isEqual o cmp,
> = isGreater o cmp, >= = not o isLess o cmp}
- fun max cmp (x, y) = if isLess (cmp (x, y)) then y else x
- fun min cmp (x, y) = if isGreater (cmp (x, y)) then y else x
+ local
+ fun mk is cmp (x, y) = if is (cmp (x, y)) then y else x
+ in
+ fun max ? = mk isLess ?
+ fun min ? = mk isGreater ?
+ end
end
end
|
|
From: Vesa K. <ve...@ml...> - 2006-11-22 08:26:15
|
Minor refactoring.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun 2006-11-22 16:04:16 UTC (rev 4857)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun 2006-11-22 16:26:08 UTC (rev 4858)
@@ -17,12 +17,15 @@
in
open MonoArray Common
end
- fun duplicate a = tabulate (length a, fn i => sub (a, i))
+ local
+ fun mk tabulate length sub ? = tabulate (length ?, fn i => sub (?, i))
+ in
+ fun duplicate ? = mk tabulate length sub ?
+ fun fromVector ? = mk tabulate MonoVector.length MonoVector.sub ?
+ fun toPoly ? = mk Array.tabulate length sub ?
+ fun fromPoly ? = mk tabulate Array.length Array.sub ?
+ end
val toVector = vector
- fun fromVector v =
- tabulate (MonoVector.length v, fn i => MonoVector.sub (v, i))
val isoVector = (toVector, fromVector)
- fun toPoly a = Array.tabulate (length a, fn i => sub (a, i))
- fun fromPoly a = tabulate (Array.length a, fn i => Array.sub (a, i))
val isoPoly = (toPoly, fromPoly)
end
|
|
From: Vesa K. <ve...@ml...> - 2006-11-22 08:04:30
|
Removed unnecessary doc comments.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml 2006-11-22 07:19:22 UTC (rev 4856)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml 2006-11-22 16:04:16 UTC (rev 4857)
@@ -4,7 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(** == Extended mono sequence modules common to all compilers == *)
+(* Extended mono sequence modules common to all compilers *)
structure Word8Vector = MkMonoVectorExt (Word8Vector)
structure Word8VectorSlice =
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml 2006-11-22 07:19:22 UTC (rev 4856)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml 2006-11-22 16:04:16 UTC (rev 4857)
@@ -4,7 +4,7 @@
* See the file MLton-LICENSE for details.
*)
-(** == Extended scalar modules common to all compilers == *)
+(* Extended scalar modules common to all compilers *)
structure Int = MkIntegerExt (Int)
structure LargeInt = MkIntegerExt (LargeInt)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml 2006-11-22 07:19:22 UTC (rev 4856)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml 2006-11-22 16:04:16 UTC (rev 4857)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {VectorSlice :> VECTOR_SLICE} structure.
- *)
structure VectorSlice : VECTOR_SLICE = struct
open VectorSlice
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml 2006-11-22 07:19:22 UTC (rev 4856)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml 2006-11-22 16:04:16 UTC (rev 4857)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {Vector :> VECTOR} structure.
- *)
structure Vector : VECTOR = struct
local
structure Common = MkSeqCommonExt (Vector)
|
|
From: Vesa K. <ve...@ml...> - 2006-11-21 23:19:27
|
Added span, takeWhile, and dropWhile.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-21 11:48:26 UTC (rev 4855)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-22 07:19:22 UTC (rev 4856)
@@ -83,4 +83,17 @@
fun contains l x = exists (fn y => x = y) l
fun maximum cmp = foldl1 (Cmp.max cmp o Pair.swap)
fun minimum cmp = foldl1 (Cmp.min cmp o Pair.swap)
+ local
+ fun mk combine init pred xs = let
+ fun lp (ts, []) = (ts, [])
+ | lp (ts, x::xs) =
+ if pred x then lp (combine (x, ts), xs) else (ts, x::xs)
+ in
+ lp (init, xs)
+ end
+ in
+ fun span ? = Pair.map (rev, Fn.id) o mk op :: [] ?
+ fun takeWhile ? = rev o #1 o mk op :: [] ?
+ fun dropWhile ? = #2 o mk ignore () ?
+ end
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig 2006-11-21 11:48:26 UTC (rev 4855)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig 2006-11-22 07:19:22 UTC (rev 4856)
@@ -25,14 +25,6 @@
* {Empty} if the list is empty.
*)
- val split : 'a t * Int.t -> 'a t Sq.t
- (**
- * {split (l, i)} returns a pair f the first {i} and last {length l -
- * i} elements of the list {l}. Raises {Subscript} if {i < 0 orelse
- * length l < i}. Specifically, {split (l, n) = (take (l, n), drop (l,
- * n))}.
- *)
-
(** == Transformations == *)
val intersperse : 'a -> 'a t UnOp.t
@@ -91,6 +83,28 @@
val unfoldr : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list
val unfoldr' : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list * 'a
+ (** == Extracting sublists == *)
+
+ val split : 'a t * Int.t -> 'a t Sq.t
+ (**
+ * {split (l, i)} returns a pair f the first {i} and last {length l -
+ * i} elements of the list {l}. Raises {Subscript} if {i < 0 orelse
+ * length l < i}. Specifically, {split (l, n) = (take (l, n), drop (l,
+ * n))}.
+ *)
+
+ val takeWhile : 'a UnPr.t -> 'a t UnOp.t
+ (**
+ * {takeWhile p xs} returns the longest prefix of {xs} of elements that
+ * satisfy {p}.
+ *)
+
+ val dropWhile : 'a UnPr.t -> 'a t UnOp.t
+ (** {dropWhile p xs} returns the suffix remaining after {takeWhile p xs}. *)
+
+ val span : 'a UnPr.t -> 'a t -> 'a t Sq.t
+ (** {span p xs = (takeWhile p xs, dropWhile p xs)}. *)
+
(** == Set Operations == *)
val contains : ''a t -> ''a UnPr.t
|
|
From: Vesa K. <ve...@ml...> - 2006-11-21 03:48:45
|
Exposed unfoldl' and unfoldr'. Also made some minor implementation
tweaks.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-21 07:43:19 UTC (rev 4854)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-21 11:48:26 UTC (rev 4855)
@@ -17,22 +17,25 @@
fun unfoldl f = #1 o unfoldl' f
fun unfoldr f = #1 o unfoldr' f
fun intersperse d =
- fn [] => [] | x::xs => x::rev (foldl (fn (x, ys) => x::d::ys) [] xs)
+ fn [] => [] | x::xs => x::foldr (fn (x, ys) => d::x::ys) [] xs
local
fun headsAndTails xss =
Pair.map (rev, rev)
(foldl (fn (h::t, (hs, ts)) => (h::hs, t::ts) | ([], ?) => ?)
([], []) xss)
in
- fun transpose xss =
- case xss of
- [] => []
- | []::xss => transpose xss
- | (x::xs)::xss => let
- val (hs, ts) = headsAndTails xss
- in
- (x::hs)::transpose (xs::ts)
- end
+ fun transpose xss = let
+ fun lp yss =
+ fn [] => rev yss
+ | []::xss => lp yss xss
+ | (x::xs)::xss => let
+ val (hs, ts) = headsAndTails xss
+ in
+ lp ((x::hs)::yss) (xs::ts)
+ end
+ in
+ lp [] xss
+ end
end
fun foldl1 f = fn [] => raise Empty | x::xs => foldl f x xs
fun foldr1 f = foldl1 f o rev
@@ -58,7 +61,7 @@
in
lp
end
- fun concatMap f = rev o foldl (fn (x, ys) => revAppend (f x, ys)) []
+ fun concatMap f = rev o foldl (revAppend o Pair.map (f, Fn.id)) []
fun appr e = app e o rev
fun foldli f y = #2 o foldl (fn (x, (i, y)) => (i+1, f (i+1, x, y))) (~1, y)
fun foldri f y xs = let
@@ -76,7 +79,7 @@
fun appri e = foldri (fn (i, x, ()) => e (i, x)) ()
fun existsi p = Option.isSome o findi p
fun alli p = Option.isNone o findi (not o p)
- fun index ? = mapi (fn ? => ?) ?
+ fun index ? = mapi Fn.id ?
fun contains l x = exists (fn y => x = y) l
fun maximum cmp = foldl1 (Cmp.max cmp o Pair.swap)
fun minimum cmp = foldl1 (Cmp.min cmp o Pair.swap)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig 2006-11-21 07:43:19 UTC (rev 4854)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig 2006-11-21 11:48:26 UTC (rev 4855)
@@ -87,7 +87,9 @@
(** == Unfolding == *)
val unfoldl : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list
+ val unfoldl' : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list * 'a
val unfoldr : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list
+ val unfoldr' : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list * 'a
(** == Set Operations == *)
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 23:43:22
|
Minor simplification.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-21 06:32:34 UTC (rev 4853)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-21 07:43:19 UTC (rev 4854)
@@ -8,12 +8,14 @@
open List
val sub = nth
fun init l = rev (tl (rev l))
- fun unfoldl f x = let
- fun lp (ys, x) = case f x of NONE => ys | SOME (y, x) => lp (y::ys, x)
+ fun unfoldl' f x = let
+ fun lp (ys, x) = case f x of NONE => (ys, x) | SOME (y, x) => lp (y::ys, x)
in
lp ([], x)
end
- fun unfoldr f = rev o unfoldl f
+ fun unfoldr' f = Pair.map (rev, Fn.id) o unfoldl' f
+ fun unfoldl f = #1 o unfoldl' f
+ fun unfoldr f = #1 o unfoldr' f
fun intersperse d =
fn [] => [] | x::xs => x::rev (foldl (fn (x, ys) => x::d::ys) [] xs)
local
@@ -36,13 +38,13 @@
fun foldr1 f = foldl1 f o rev
fun push (r, x) = r := x :: !r
fun pop r = case !r of x::xs => (r := xs ; SOME x) | [] => NONE
- fun split (l, i) = let
- fun lp (hs, ts, 0) = (rev hs, ts)
- | lp (_, [], _) = raise Subscript
- | lp (hs, t::ts, n) = lp (t::hs, ts, n-1)
- in
- if i < 0 then raise Subscript else lp ([], l, i)
- end
+ fun split (l, i) =
+ if i < 0 then raise Subscript
+ else Pair.map (Fn.id, #1)
+ (unfoldr' (fn (_, 0) => NONE
+ | ([], _) => raise Subscript
+ | (x::xs, n) => SOME (x, (xs, n-1)))
+ (l, i))
fun findi p l = let
fun lp (_, []) = NONE
| lp (i, x::xs) = if p (i, x) then SOME (i, x) else lp (i+1, xs)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-21 06:32:34 UTC (rev 4853)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-21 07:43:19 UTC (rev 4854)
@@ -112,7 +112,7 @@
end
basis Option = bas public/option.sig detail/option.sml end
basis List = let
- open Cmp Option Products
+ open Cmp Fn Option Products
in
bas public/list.sig detail/list.sml end
end
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 22:32:39
|
Added maximum, minimum, unfoldl, and unfoldr.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-21 06:31:41 UTC (rev 4852)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-21 06:32:34 UTC (rev 4853)
@@ -112,7 +112,7 @@
end
basis Option = bas public/option.sig detail/option.sml end
basis List = let
- open Option
+ open Cmp Option Products
in
bas public/list.sig detail/list.sml end
end
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 22:32:04
|
Added maximum, minimum, unfoldl, and unfoldr.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-21 02:52:35 UTC (rev 4851)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-21 06:31:41 UTC (rev 4852)
@@ -8,14 +8,19 @@
open List
val sub = nth
fun init l = rev (tl (rev l))
+ fun unfoldl f x = let
+ fun lp (ys, x) = case f x of NONE => ys | SOME (y, x) => lp (y::ys, x)
+ in
+ lp ([], x)
+ end
+ fun unfoldr f = rev o unfoldl f
fun intersperse d =
fn [] => [] | x::xs => x::rev (foldl (fn (x, ys) => x::d::ys) [] xs)
local
- fun cross (f, g) (x, y) = (f x, g y)
fun headsAndTails xss =
- cross (rev, rev)
- (foldl (fn (h::t, (hs, ts)) => (h::hs, t::ts) | ([], ?) => ?)
- ([], []) xss)
+ Pair.map (rev, rev)
+ (foldl (fn (h::t, (hs, ts)) => (h::hs, t::ts) | ([], ?) => ?)
+ ([], []) xss)
in
fun transpose xss =
case xss of
@@ -71,4 +76,6 @@
fun alli p = Option.isNone o findi (not o p)
fun index ? = mapi (fn ? => ?) ?
fun contains l x = exists (fn y => x = y) l
+ fun maximum cmp = foldl1 (Cmp.max cmp o Pair.swap)
+ fun minimum cmp = foldl1 (Cmp.min cmp o Pair.swap)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig 2006-11-21 02:52:35 UTC (rev 4851)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig 2006-11-21 06:31:41 UTC (rev 4852)
@@ -79,6 +79,16 @@
val existsi : (Int.t * 'a) UnPr.t -> 'a t UnPr.t
val findi : (Int.t * 'a) UnPr.t -> 'a t -> (Int.t * 'a) Option.t
+ (** == Special Folds == *)
+
+ val maximum : 'a Cmp.t -> 'a t -> 'a
+ val minimum : 'a Cmp.t -> 'a t -> 'a
+
+ (** == Unfolding == *)
+
+ val unfoldl : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list
+ val unfoldr : ('a -> ('b * 'a) Option.t) -> 'a -> 'b list
+
(** == Set Operations == *)
val contains : ''a t -> ''a UnPr.t
|
|
From: Matthew F. <fl...@ml...> - 2006-11-20 18:53:06
|
Merge trunk revisions 4811:4850 into x86_64 branch
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/Makefile
A mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-darwin/
A mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-darwin/c-types.sml
U mlton/branches/on-20050822-x86_64-branch/bin/mlton-script
U mlton/branches/on-20050822-x86_64-branch/bin/mmake
U mlton/branches/on-20050822-x86_64-branch/bin/msed
U mlton/branches/on-20050822-x86_64-branch/mllex/Makefile
U mlton/branches/on-20050822-x86_64-branch/mlton/Makefile
U mlton/branches/on-20050822-x86_64-branch/mlton/cm/cm.sml
U mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sig
U mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sml
U mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun
U mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
_U mlton/branches/on-20050822-x86_64-branch/mlyacc/
U mlton/branches/on-20050822-x86_64-branch/mlyacc/.ignore
U mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile
U mlton/branches/on-20050822-x86_64-branch/mlyacc/doc/Makefile
U mlton/branches/on-20050822-x86_64-branch/package/debian/changelog
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U mlton/branches/on-20050822-x86_64-branch/util/cmcat/cmcat.sml
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/Makefile 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/Makefile 2006-11-21 02:52:35 UTC (rev 4851)
@@ -440,8 +440,8 @@
; do \
$(CP) "$(SRC)/regression/$$f.sml" "$(TEXM)/"; \
done
- $(GZIP) -c "$(LEX)/$(LEX).ps" >"$(TDOC)/$(LEX).ps.gz"
- $(GZIP) -c "$(YACC)/$(YACC).ps" >"$(TDOC)/$(YACC).ps.gz"
+ $(CP) $(LEX)/$(LEX).pdf $(TDOC)
+ $(CP) $(YACC)/$(YACC).pdf $(TDOC)
find "$(TDOC)/" -name .svn -type d | xargs rm -rf
find "$(TDOC)/" -name .ignore -type f | xargs rm -rf
find "$(TEXM)/" -name .svn -type d | xargs rm -rf
Added: mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-darwin/c-types.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-darwin/c-types.sml 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/config/c/x86-darwin/c-types.sml 2006-11-21 02:52:35 UTC (rev 4851)
@@ -0,0 +1,132 @@
+(* Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh
+ * Jagannathan, and Stephen Weeks.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+
+(* C *)
+structure C_Bool = WordToBool (type t = Word8.word val zero: t = 0wx0 val one: t = 0wx1)
+structure C_Char = struct open Int8 type t = int end
+functor C_Char_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int8 (A)
+structure C_SChar = struct open Int8 type t = int end
+functor C_SChar_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int8 (A)
+structure C_UChar = struct open Word8 type t = word end
+functor C_UChar_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A)
+structure C_Short = struct open Int16 type t = int end
+functor C_Short_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A)
+structure C_SShort = struct open Int16 type t = int end
+functor C_SShort_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int16 (A)
+structure C_UShort = struct open Word16 type t = word end
+functor C_UShort_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word16 (A)
+structure C_Int = struct open Int32 type t = int end
+functor C_Int_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SInt = struct open Int32 type t = int end
+functor C_SInt_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_UInt = struct open Word32 type t = word end
+functor C_UInt_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_Long = struct open Int32 type t = int end
+functor C_Long_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SLong = struct open Int32 type t = int end
+functor C_SLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_ULong = struct open Word32 type t = word end
+functor C_ULong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_LongLong = struct open Int64 type t = int end
+functor C_LongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_SLongLong = struct open Int64 type t = int end
+functor C_SLongLong_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_ULongLong = struct open Word64 type t = word end
+functor C_ULongLong_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A)
+structure C_Float = struct open Real32 type t = real end
+functor C_Float_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real32 (A)
+structure C_Double = struct open Real64 type t = real end
+functor C_Double_ChooseRealN (A: CHOOSE_REALN_ARG) = ChooseRealN_Real64 (A)
+structure C_Size = struct open Word32 type t = word end
+functor C_Size_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+structure C_Pointer = struct open Word32 type t = word end
+functor C_Pointer_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_String = struct open Word32 type t = word end
+functor C_String_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_StringArray = struct open Word32 type t = word end
+functor C_StringArray_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* Generic integers *)
+structure C_Fd = C_Int
+functor C_Fd_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+structure C_Signal = C_Int
+functor C_Signal_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+structure C_Status = C_Int
+functor C_Status_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+structure C_Sock = C_Int
+functor C_Sock_ChooseIntN (A: CHOOSE_INTN_ARG) = C_Int_ChooseIntN (A)
+
+(* C99 *)
+structure C_Ptrdiff = struct open Int32 type t = int end
+functor C_Ptrdiff_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_Intmax = struct open Int64 type t = int end
+functor C_Intmax_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_UIntmax = struct open Word64 type t = word end
+functor C_UIntmax_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word64 (A)
+structure C_Intptr = struct open Int32 type t = int end
+functor C_Intptr_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_UIntptr = struct open Word32 type t = word end
+functor C_UIntptr_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <dirent.h> *)
+structure C_DirP = struct open Word32 type t = word end
+functor C_DirP_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <poll.h> *)
+structure C_NFds = struct open Word32 type t = word end
+functor C_NFds_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <resource.h> *)
+structure C_RLim = struct open Int64 type t = int end
+functor C_RLim_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+
+(* from <sys/types.h> *)
+structure C_Clock = struct open Word32 type t = word end
+functor C_Clock_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_Dev = struct open Int32 type t = int end
+functor C_Dev_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_GId = struct open Word32 type t = word end
+functor C_GId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_Id = struct open Word32 type t = word end
+functor C_Id_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_INo = struct open Word32 type t = word end
+functor C_INo_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+structure C_Mode = struct open Word16 type t = word end
+functor C_Mode_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word16 (A)
+structure C_NLink = struct open Word16 type t = word end
+functor C_NLink_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word16 (A)
+structure C_Off = struct open Int64 type t = int end
+functor C_Off_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int64 (A)
+structure C_PId = struct open Int32 type t = int end
+functor C_PId_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SSize = struct open Int32 type t = int end
+functor C_SSize_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_SUSeconds = struct open Int32 type t = int end
+functor C_SUSeconds_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_Time = struct open Int32 type t = int end
+functor C_Time_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_UId = struct open Word32 type t = word end
+functor C_UId_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <sys/socket.h> *)
+structure C_Socklen = struct open Word32 type t = word end
+functor C_Socklen_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from <termios.h> *)
+structure C_CC = struct open Word8 type t = word end
+functor C_CC_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word8 (A)
+structure C_Speed = struct open Int32 type t = int end
+functor C_Speed_ChooseIntN (A: CHOOSE_INTN_ARG) = ChooseIntN_Int32 (A)
+structure C_TCFlag = struct open Word32 type t = word end
+functor C_TCFlag_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
+(* from "gmp.h" *)
+structure C_MPLimb = struct open Word32 type t = word end
+functor C_MPLimb_ChooseWordN (A: CHOOSE_WORDN_ARG) = ChooseWordN_Word32 (A)
+
Modified: mlton/branches/on-20050822-x86_64-branch/bin/mlton-script
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bin/mlton-script 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/bin/mlton-script 2006-11-21 02:52:35 UTC (rev 4851)
@@ -67,10 +67,6 @@
# You may need to add a line with -link-opt '-L/path/to/libgmp' so
# that the linker can find libgmp.
-if [ -d '/sw/lib' ]; then
- darwinLinkOpts='-L/sw/lib'
-fi
-
doit "$lib" \
-cc "$gcc" \
-cc-opt "-I$lib/include" \
@@ -79,7 +75,7 @@
-mlb-path-map "$lib/mlb-path-map" \
-target-as-opts amd64 '-m32 -mtune=opteron' \
-target-cc-opts amd64 '-m32 -mtune=opteron' \
- -target-cc-opts darwin '-I/sw/include' \
+ -target-cc-opts darwin '-I/opt/local/include -I/sw/include' \
-target-cc-opts freebsd '-I/usr/local/include' \
-target-cc-opts netbsd '-I/usr/pkg/include' \
-target-cc-opts openbsd '-I/usr/local/include' \
@@ -97,7 +93,7 @@
-target-link-opts aix '-lgmp' \
-target-link-opts amd64 '-m32' \
-target-link-opts cygwin '-lgmp' \
- -target-link-opts darwin "$darwinLinkOpts -lgmp" \
+ -target-link-opts darwin '-L/opt/local/lib -L/sw/lib -lgmp' \
-target-link-opts freebsd '-L/usr/local/lib/ -lgmp' \
-target-link-opts hpux '-lgmp' \
-target-link-opts linux '-lgmp' \
Modified: mlton/branches/on-20050822-x86_64-branch/bin/mmake
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bin/mmake 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/bin/mmake 2006-11-21 02:52:35 UTC (rev 4851)
@@ -9,6 +9,8 @@
if gmake -v >/dev/null 2>&1; then
make='gmake'
+elif gnumake -v >/dev/null 2>&1; then
+ make='gnumake'
elif make -v 2>&1 | grep -q GNU; then
make=`which make`
else
Modified: mlton/branches/on-20050822-x86_64-branch/bin/msed
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bin/msed 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/bin/msed 2006-11-21 02:52:35 UTC (rev 4851)
@@ -9,6 +9,8 @@
if gsed --version >/dev/null 2>&1; then
sed='gsed'
+elif gnused --version >/dev/null 2>&1; then
+ sed='gnused'
elif sed --version 2>&1 | grep -q GNU; then
sed=`which sed`
else
Modified: mlton/branches/on-20050822-x86_64-branch/mllex/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mllex/Makefile 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mllex/Makefile 2006-11-21 02:52:35 UTC (rev 4851)
@@ -47,7 +47,7 @@
../bin/clean
.PHONY: docs
-docs: mllex.ps
+docs: mllex.pdf
.PHONY: test
test: $(NAME)
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/Makefile 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/Makefile 2006-11-21 02:52:35 UTC (rev 4851)
@@ -18,7 +18,7 @@
UP = upgrade-basis.sml
PATH = $(BIN):$(shell echo $$PATH)
-FLAGS = @MLton ram-slop 0.7 gc-summary $(RUNTIME_ARGS) --
+FLAGS = @MLton max-heap 640m ram-slop 0.7 gc-summary $(RUNTIME_ARGS) --
ifeq (self, $(shell if [ -x "$(BIN)/mlton" ]; then echo self; fi))
# We're compiling MLton with itself, so don't use any stubs.
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/cm/cm.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/cm/cm.sml 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/cm/cm.sml 2006-11-21 02:52:35 UTC (rev 4851)
@@ -73,17 +73,20 @@
List.push (files, finalize m')
in
Control.checkFile
- (m, fail, fn () =>
- case File.suffix m of
- SOME "cm" =>
- loop (m, 0, relativize)
- | SOME "sml" => sml ()
- | SOME "sig" => sml ()
- | SOME "fun" => sml ()
- | SOME "ML" => sml ()
- | _ =>
- fail (concat ["MLton can't process ",
- m]))
+ (m,
+ {fail = fail,
+ name = m,
+ ok = fn () =>
+ case File.suffix m of
+ SOME "cm" =>
+ loop (m, 0, relativize)
+ | SOME "sml" => sml ()
+ | SOME "sig" => sml ()
+ | SOME "fun" => sml ()
+ | SOME "ML" => sml ()
+ | _ =>
+ fail (concat ["MLton can't process ",
+ m])})
end
end)
end)
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sig 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sig 2006-11-21 02:52:35 UTC (rev 4851)
@@ -32,7 +32,9 @@
(*------------------------------------*)
(* Error Reporting *)
(*------------------------------------*)
- val checkFile: File.t * (string -> 'a) * (unit -> 'a) -> 'a
+ val checkFile: File.t * {fail: string -> 'a,
+ name: string,
+ ok: unit -> 'a} -> 'a
val checkForErrors: string -> unit
val error: Region.t * Layout.t * Layout.t -> unit
val errorStr: Region.t * string -> unit
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sml 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/control/control.sml 2006-11-21 02:52:35 UTC (rev 4851)
@@ -235,15 +235,15 @@
then die (concat ["compilation aborted: ", name, " reported errors"])
else ()
-fun checkFile (f: File.t, error: string -> 'a, k: unit -> 'a): 'a =
- let
- fun check (test, msg, k) =
- if not (test f)
- then error (concat ["File ", f, " ", msg])
- else k ()
+fun checkFile (f: File.t, {fail: string -> 'a, name, ok: unit -> 'a}): 'a = let
+ fun check (test, msg, k) =
+ if test f then
+ k ()
+ else
+ fail (concat ["File ", name, " ", msg])
in
check (File.doesExist, "does not exist", fn () =>
- check (File.canRead, "cannot be read", k))
+ check (File.canRead, "cannot be read", ok))
end
(*---------------------------------------------------*)
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/front-end/mlb-front-end.fun 2006-11-21 02:52:35 UTC (rev 4851)
@@ -216,63 +216,67 @@
("fileUse", File.layout fileUse),
("relativize", Option.layout Dir.layout relativize)])
regularize
- fun lexAndParseProg {fileAbs: File.t, fileUse: File.t,
+ fun lexAndParseProg {fileAbs: File.t, fileOrig: File.t, fileUse: File.t,
fail: String.t -> Ast.Program.t} =
Ast.Basdec.Prog
({fileAbs = fileAbs, fileUse = fileUse},
Promise.delay
(fn () =>
Control.checkFile
- (fileUse, fail, fn () => FrontEnd.lexAndParseFile fileUse)))
+ (fileUse, {fail = fail,
+ name = fileOrig,
+ ok = fn () => FrontEnd.lexAndParseFile fileUse})))
and lexAndParseMLB {relativize: Dir.t option,
seen: (File.t * File.t * Region.t) list,
- fileAbs: File.t, fileUse: File.t,
+ fileAbs: File.t, fileOrig: File.t, fileUse: File.t,
fail: String.t -> Ast.Basdec.t, reg: Region.t} =
Ast.Basdec.MLB
({fileAbs = fileAbs, fileUse = fileUse},
Promise.delay
(fn () =>
Control.checkFile
- (fileUse, fail, fn () =>
- let
- val seen' = (fileAbs, fileUse, reg) :: seen
- in
- if List.exists (seen, fn (fileAbs', _, _) =>
- String.equals (fileAbs, fileAbs'))
- then (let open Layout
- in
- Control.error
- (reg, seq [str "Basis forms a cycle with ",
- File.layout fileUse],
- align (List.map (seen', fn (_, f, r) =>
- seq [Region.layout r,
- str ": ",
- File.layout f])))
- ; Ast.Basdec.empty
- end)
- else
- let
- val (_, basdec) =
- HashSet.lookupOrInsert
- (psi, String.hash fileAbs, fn (fileAbs', _) =>
- String.equals (fileAbs, fileAbs'), fn () =>
- let
- val cwd = OS.Path.dir fileAbs
- val basdec =
- Promise.delay
- (fn () =>
- wrapLexAndParse
- ({cwd = cwd,
- relativize = relativize,
- seen = seen'},
- lexAndParseFile, fileUse))
- in
- (fileAbs, basdec)
- end)
- in
- Promise.force basdec
- end
- end)))
+ (fileUse,
+ {fail = fail,
+ name = fileOrig,
+ ok = fn () => let
+ val seen' = (fileAbs, fileUse, reg) :: seen
+ in
+ if List.exists (seen, fn (fileAbs', _, _) =>
+ String.equals (fileAbs, fileAbs'))
+ then (let open Layout
+ in
+ Control.error
+ (reg, seq [str "Basis forms a cycle with ",
+ File.layout fileUse],
+ align (List.map (seen', fn (_, f, r) =>
+ seq [Region.layout r,
+ str ": ",
+ File.layout f])))
+ ; Ast.Basdec.empty
+ end)
+ else
+ let
+ val (_, basdec) =
+ HashSet.lookupOrInsert
+ (psi, String.hash fileAbs, fn (fileAbs', _) =>
+ String.equals (fileAbs, fileAbs'), fn () =>
+ let
+ val cwd = OS.Path.dir fileAbs
+ val basdec =
+ Promise.delay
+ (fn () =>
+ wrapLexAndParse
+ ({cwd = cwd,
+ relativize = relativize,
+ seen = seen'},
+ lexAndParseFile, fileUse))
+ in
+ (fileAbs, basdec)
+ end)
+ in
+ Promise.force basdec
+ end
+ end})))
and lexAndParseProgOrMLB {cwd, relativize, seen}
(fileOrig: File.t, reg: Region.t) =
let
@@ -289,23 +293,28 @@
end
val mlbExts = ["mlb"]
val progExts = ["ML","fun","sig","sml"]
- fun err () = fail (Ast.Basdec.Seq []) "has an unknown extension"
+ fun err () =
+ fail (Ast.Basdec.Seq [])
+ (concat ["File ", fileOrig, " has an unknown extension"])
in
case File.extension fileUse of
NONE => err ()
| SOME s =>
- if List.contains (mlbExts, s, String.equals)
- then lexAndParseMLB {relativize = relativize,
- seen = seen,
- fileAbs = fileAbs,
- fileUse = fileUse,
- fail = fail Ast.Basdec.empty,
- reg = reg}
- else if List.contains (progExts, s, String.equals)
- then lexAndParseProg {fileAbs = fileAbs,
- fileUse = fileUse,
- fail = fail Ast.Program.empty}
- else err ()
+ if List.contains (mlbExts, s, String.equals) then
+ lexAndParseMLB {relativize = relativize,
+ seen = seen,
+ fileAbs = fileAbs,
+ fileOrig = fileOrig,
+ fileUse = fileUse,
+ fail = fail Ast.Basdec.empty,
+ reg = reg}
+ else if List.contains (progExts, s, String.equals) then
+ lexAndParseProg {fileAbs = fileAbs,
+ fileOrig = fileOrig,
+ fileUse = fileUse,
+ fail = fail Ast.Program.empty}
+ else
+ err ()
end
and wrapLexAndParse (state, lexAndParse, arg) =
Ref.fluidLet
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun 2006-11-21 02:52:35 UTC (rev 4851)
@@ -1091,8 +1091,10 @@
Place.CM => compileCM input
| Place.SML =>
Control.checkFile
- (input, fn s => raise Fail s,
- fn () => compileSml [input])
+ (input,
+ {fail = fn s => raise Fail s,
+ name = input,
+ ok = fn () => compileSml [input]})
| Place.MLB => compileMLB input
| Place.Generated => compileCSO (input :: csoFiles)
| Place.O => compileCSO (input :: csoFiles)
Property changes on: mlton/branches/on-20050822-x86_64-branch/mlyacc
___________________________________________________________________
Name: svn:ignore
- *.call-graph.dot
*.ssa
mlyacc
mlyacc.exe
mlyacc.ps
mlyacc.sml
+ *.call-graph.dot
*.ssa
mlyacc.pdf
mlyacc.ps
mlyacc.sml
mlyacc
Modified: mlton/branches/on-20050822-x86_64-branch/mlyacc/.ignore
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlyacc/.ignore 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlyacc/.ignore 2006-11-21 02:52:35 UTC (rev 4851)
@@ -1,6 +1,7 @@
*.call-graph.dot
*.ssa
-mlyacc
-mlyacc.exe
+mlyacc.pdf
mlyacc.ps
mlyacc.sml
+mlyacc
+
Modified: mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlyacc/Makefile 2006-11-21 02:52:35 UTC (rev 4851)
@@ -38,15 +38,21 @@
doc/mlyacc.ps:
$(MAKE) -C doc mlyacc.ps
+doc/mlyacc.pdf:
+ $(MAKE) -C doc mlyacc.pdf
+
mlyacc.ps: doc/mlyacc.ps
cp doc/mlyacc.ps .
+mlyacc.pdf: doc/mlyacc.pdf
+ cp doc/mlyacc.pdf .
+
.PHONY: clean
clean:
../bin/clean
.PHONY: docs
-docs: mlyacc.ps
+docs: mlyacc.pdf
.PHONY: test
test: $(NAME)
Modified: mlton/branches/on-20050822-x86_64-branch/mlyacc/doc/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlyacc/doc/Makefile 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/mlyacc/doc/Makefile 2006-11-21 02:52:35 UTC (rev 4851)
@@ -6,7 +6,7 @@
# See the file MLton-LICENSE for details.
##
-all: mlyacc.ps
+all: mlyacc.pdf
html/index.html: $(TEX_FILES)
mkdir -p html
Modified: mlton/branches/on-20050822-x86_64-branch/package/debian/changelog
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/package/debian/changelog 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/package/debian/changelog 2006-11-21 02:52:35 UTC (rev 4851)
@@ -1,3 +1,10 @@
+mlton (20061107-1) unstable; urgency=low
+
+ * new upstream version
+ * Use max-heap 640m instead of fixed-heap 512m. hopefully closes: #396980
+
+ -- Stephen Weeks <sw...@sw...> Tue, 07 Nov 2006 14:01:53 -0800
+
mlton (20061026-1) unstable; urgency=low
* new upstream version
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2006-11-21 02:52:35 UTC (rev 4851)
@@ -29,9 +29,9 @@
ifeq ($(TARGET_ARCH), x86)
ifeq ($(findstring $(GCC_MAJOR_VERSION), 3 4),$(GCC_MAJOR_VERSION))
-FLAGS += -falign-loops=2 -falign-jumps=2 -falign-functions=5
+OPTFLAGS += -falign-loops=2 -falign-jumps=2 -falign-functions=5
else
-FLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5
+OPTFLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5
endif
ifeq ($(findstring $(GCC_VERSION), 3.3 3.4 4.0),$(GCC_VERSION))
GCOPTFLAGS += --param max-inline-insns-single=1000
@@ -49,10 +49,10 @@
ifeq ($(TARGET_ARCH), amd64)
FLAGS += -m32
ifeq ($(findstring $(GCC_MAJOR_VERSION), 3),$(GCC_MAJOR_VERSION))
-FLAGS += -mcpu=opteron
+OPTFLAGS += -mcpu=opteron
endif
ifeq ($(findstring $(GCC_MAJOR_VERSION), 4),$(GCC_MAJOR_VERSION))
-FLAGS += -mtune=opteron
+OPTFLAGS += -mtune=opteron
endif
ifeq ($(findstring $(GCC_VERSION), 3.4 4.0),$(GCC_VERSION))
GCOPTFLAGS += --param inline-unit-growth=75 --param max-inline-insns-single=1000
@@ -65,6 +65,10 @@
FLAGS += -m32 -mcpu=v8 -Wa,-xarch=v8plusa
endif
+ifeq ($(TARGET_OS), darwin)
+FLAGS += -I/sw/include -I/opt/local/include
+endif
+
ifeq ($(TARGET_OS), freebsd)
FLAGS += -I/usr/local/include
endif
Modified: mlton/branches/on-20050822-x86_64-branch/util/cmcat/cmcat.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/util/cmcat/cmcat.sml 2006-11-20 23:44:26 UTC (rev 4850)
+++ mlton/branches/on-20050822-x86_64-branch/util/cmcat/cmcat.sml 2006-11-21 02:52:35 UTC (rev 4851)
@@ -108,7 +108,7 @@
fun closure () =
if List.length (!todo) = 0
then ()
- else DynamicWind.withEscape
+ else Exn.withEscape
(fn esc =>
let
val (srcdescr,finish) = List.pop todo
@@ -640,7 +640,7 @@
then
(comments := true;
loop args)
- else if String.isPrefix {prefix = "-D", string = flag}
+ else if String.hasPrefix (flag, {prefix = "-D"})
then
(defines := String.extract (flag, 2, NONE) :: !defines
; loop args)
|
|
From: Matthew F. <fl...@ml...> - 2006-11-20 15:44:50
|
cmcat: catching up with some old changes to mltonlib
----------------------------------------------------------------------
U mlton/trunk/util/cmcat/cmcat.sml
----------------------------------------------------------------------
Modified: mlton/trunk/util/cmcat/cmcat.sml
===================================================================
--- mlton/trunk/util/cmcat/cmcat.sml 2006-11-20 19:44:30 UTC (rev 4849)
+++ mlton/trunk/util/cmcat/cmcat.sml 2006-11-20 23:44:26 UTC (rev 4850)
@@ -108,7 +108,7 @@
fun closure () =
if List.length (!todo) = 0
then ()
- else DynamicWind.withEscape
+ else Exn.withEscape
(fn esc =>
let
val (srcdescr,finish) = List.pop todo
@@ -640,7 +640,7 @@
then
(comments := true;
loop args)
- else if String.isPrefix {prefix = "-D", string = flag}
+ else if String.hasPrefix (flag, {prefix = "-D"})
then
(defines := String.extract (flag, 2, NONE) :: !defines
; loop args)
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 11:44:32
|
Added Exn.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/ext.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
----------------------------------------------------------------------
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/ext.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/ext.sml 2006-11-20 19:36:40 UTC (rev 4848)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/ext.sml 2006-11-20 19:44:30 UTC (rev 4849)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Ext = struct
+ structure Exn = struct
+ fun addMessager _ = ()
+ val history = SMLofNJ.exnHistory
+ end
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/ext.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm 2006-11-20 19:36:40 UTC (rev 4848)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm 2006-11-20 19:44:30 UTC (rev 4849)
@@ -19,6 +19,7 @@
../../public/effect.sig
../../public/emb.sig
../../public/exit.sig
+ ../../public/exn.sig
../../public/fix.sig
../../public/fn.sig
../../public/int-inf.sig
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm 2006-11-20 19:36:40 UTC (rev 4848)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm 2006-11-20 19:44:30 UTC (rev 4849)
@@ -20,6 +20,7 @@
../effect.sml
../emb.sml
../exit.sml
+ ../exn.sml
../fix.sml
../fn.sml
../iso.sml
@@ -47,4 +48,5 @@
../vector-slice.sml
../vector.sml
../writer.sml
+ ext.sml
sigs.cm
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 11:37:23
|
Added Exn.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb
U mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2006-11-20 19:36:40 UTC (rev 4848)
@@ -6,6 +6,7 @@
(* Minimal modules for bootstrapping. *)
+structure Exn = struct type t = exn end
structure Fn = struct type ('a, 'b) t = 'a -> 'b end
structure Unit = struct type t = unit end
structure Bool = struct open Bool type t = bool end
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml 2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Exn : EXN = struct
+ open Exn Ext.Exn
+ val name = General.exnName
+ val message = General.exnMessage
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exn.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml 2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Ext = struct
+ structure Exn = struct
+ fun addMessager _ = ()
+ fun history _ = []
+ end
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ext.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb 2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+local
+ $(SML_LIB)/basis/basis.mlb
+in
+ ../ext.sml
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/extensions.mlb
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml 2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Ext = struct
+ structure Exn = struct
+ local
+ open MLton.Exn
+ in
+ val addMessager = addExnMessager
+ val history = history
+ end
+ end
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/ext.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb 2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+local
+ $(MLTON_ROOT)/basis/mlton.mlb
+in
+ ext.sml
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/extensions.mlb
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-20 19:36:40 UTC (rev 4848)
@@ -29,13 +29,21 @@
"warnUnused true"
in
local
- (* Workarounds (if any) *)
+ (* Workarounds (if any). *)
detail/$(SML_COMPILER)/workarounds.mlb
(* Minimal modules for bootstrapping. *)
detail/bootstrap.sml
+ (* Compiler specific extensions (if any). *)
+ basis Ext = bas detail/$(SML_COMPILER)/extensions.mlb end
+
basis Fn = bas public/fn.sig detail/fn.sml end
+ basis Exn = let
+ open Ext
+ in
+ bas public/exn.sig detail/exn.sml end
+ end
basis Unit = bas public/unit.sig end
basis Sq = bas public/sq.sig detail/sq.sml end
basis UnOp = bas public/un-op.sig detail/un-op.sml end
@@ -167,7 +175,7 @@
open BinOp BinPr Bool Buffer
open Cmp
- open Effect Emb Exit
+ open Effect Emb Exit Exn
open Fix Fn
open Iso
open List
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig 2006-11-20 19:36:40 UTC (rev 4848)
@@ -0,0 +1,36 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(** Utilities for dealing with exceptions. *)
+signature EXN = sig
+ type t = exn
+
+ val addMessager : (t -> String.t Option.t) Effect.t
+ (**
+ * Adds a pretty-printer to be used by {message} for converting
+ * exceptions to strings. Messagers are tried in order from most
+ * recently added to least recently added.
+ *)
+
+ (** == Examining Exceptions == *)
+
+ val message : t -> String.t
+ (** Same as {General.exnMessage}. *)
+
+ val name : t -> String.t
+ (** Same as {General.exnName}. *)
+
+ val history : t -> String.t List.t
+ (**
+ * Returns call stack at the point that the exception was first raised.
+ * Each element of the list is a file position. The elements are in
+ * reverse chronological order, i.e. the function called last is at the
+ * front of the list.
+ *
+ * {history} will likely return {[]} unless the program is compiled
+ * with a compiler dependent option to support exception history.
+ *)
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/public/exn.sig
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml 2006-11-20 14:49:27 UTC (rev 4847)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml 2006-11-20 19:36:40 UTC (rev 4848)
@@ -17,6 +17,7 @@
signature EFFECT = EFFECT
signature EMB = EMB
signature EXIT = EXIT
+signature EXN = EXN
signature FIX = FIX
signature FN = FN
signature INTEGER = INTEGER
@@ -67,6 +68,7 @@
structure Effect : EFFECT = Effect
structure Emb : EMB = Emb
structure Exit : EXIT = Exit
+structure Exn : EXN = Exn
structure Fix : FIX = Fix
structure Fn : FN = Fn
structure Int : INTEGER = Int
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 06:49:29
|
Eliminated warning.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml 2006-11-20 14:22:54 UTC (rev 4846)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml 2006-11-20 14:49:27 UTC (rev 4847)
@@ -5,6 +5,6 @@
*)
structure Fix :> FIX = struct
- type 'a t = 'a UnOp.t -> 'a
+ open Fix
exception Fix
end
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 06:22:59
|
Almost working build files for SML/NJ.
Compilation (with v110.59) gives the errors:
public/export.sml:97.29-98.34 Error: unmatched value specification: unfoldi
public/export.sml:97.29-98.34 Error: unmatched value specification: toList
public/export.sml:97.29-98.34 Error: unmatched value specification: isoList
public/export.sml:105.66-106.34 Error: unmatched value specification: map
public/export.sml:105.66-106.34 Error: unmatched type specification: univ
public/export.sml:105.66-106.34 Error: unmatched type specification: u
public/export.sml:105.66-106.34 Error: unmatched value specification: polymorphically
This looks like a bug in SML/NJ, because simply moving the Vector and
Writer structure bindings in export.sml before all the other structure
bindings makes compilation finish without errors.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/bootstrap.cm
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2006-11-20 12:03:09 UTC (rev 4845)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2006-11-20 14:22:54 UTC (rev 4846)
@@ -41,6 +41,7 @@
structure Thunk = struct type 'a t = Unit.t -> 'a end
structure UnOp = struct type 'a t = 'a -> 'a end
structure UnPr = struct type 'a t = 'a -> Bool.t end
+structure Fix = struct type 'a t = 'a UnOp.t -> 'a end
structure Reader = struct type ('a, 'b) t = 'b -> ('a * 'b) Option.t end
structure Writer = struct type ('a, 'b) t = 'a * 'b -> 'b end
structure Cmp = struct type 'a t = 'a Sq.t -> Order.t end
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/bootstrap.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/bootstrap.cm 2006-11-20 12:03:09 UTC (rev 4845)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/bootstrap.cm 2006-11-20 14:22:54 UTC (rev 4846)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+group
+ library(workarounds/basis.cm)
+ source(-)
+is
+ ../bootstrap.sml
+ workarounds/basis.cm
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm 2006-11-20 12:03:09 UTC (rev 4845)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/funs.cm 2006-11-20 14:22:54 UTC (rev 4846)
@@ -4,7 +4,10 @@
* See the file MLton-LICENSE for details.
*)
-group is
+group
+ group(bootstrap.cm)
+ source(-)
+is
../mk-int-inf-ext.fun
../mk-integer-ext.fun
../mk-mono-array-ext.fun
@@ -16,4 +19,4 @@
../mk-seq-common-ext.fun
../mk-text-ext.fun
../mk-word-ext.fun
- workarounds/basis.cm
+ bootstrap.cm
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm 2006-11-20 12:03:09 UTC (rev 4845)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm 2006-11-20 14:22:54 UTC (rev 4846)
@@ -0,0 +1,55 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+group
+ group(funs.cm)
+ source(-)
+is
+ ../../public/array-slice.sig
+ ../../public/array.sig
+ ../../public/bin-op.sig
+ ../../public/bin-pr.sig
+ ../../public/bool.sig
+ ../../public/buffer.sig
+ ../../public/char.sig
+ ../../public/cmp.sig
+ ../../public/effect.sig
+ ../../public/emb.sig
+ ../../public/exit.sig
+ ../../public/fix.sig
+ ../../public/fn.sig
+ ../../public/int-inf.sig
+ ../../public/integer.sig
+ ../../public/iso.sig
+ ../../public/list.sig
+ ../../public/mono-array-slice.sig
+ ../../public/mono-array.sig
+ ../../public/mono-vector-slice.sig
+ ../../public/mono-vector.sig
+ ../../public/option.sig
+ ../../public/order.sig
+ ../../public/pair.sig
+ ../../public/product-type.sig
+ ../../public/product.sig
+ ../../public/reader.sig
+ ../../public/real.sig
+ ../../public/ref.sig
+ ../../public/sq.sig
+ ../../public/string.sig
+ ../../public/substring.sig
+ ../../public/sum.sig
+ ../../public/text.sig
+ ../../public/thunk.sig
+ ../../public/tie.sig
+ ../../public/un-op.sig
+ ../../public/un-pr.sig
+ ../../public/unit.sig
+ ../../public/univ.sig
+ ../../public/vector-slice.sig
+ ../../public/vector.sig
+ ../../public/word.sig
+ ../../public/writer.sig
+ funs.cm
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm 2006-11-20 12:03:09 UTC (rev 4845)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm 2006-11-20 14:22:54 UTC (rev 4846)
@@ -4,36 +4,32 @@
* See the file MLton-LICENSE for details.
*)
-group is
- ../../public/array-slice.sig
- ../../public/array.sig
- ../../public/bool.sig
- ../../public/char.sig
- ../../public/emb.sig
- ../../public/int-inf.sig
- ../../public/integer.sig
- ../../public/iso.sig
- ../../public/list.sig
- ../../public/mono-array-slice.sig
- ../../public/mono-array.sig
- ../../public/mono-vector-slice.sig
- ../../public/mono-vector.sig
- ../../public/option.sig
- ../../public/real.sig
- ../../public/string.sig
- ../../public/substring.sig
- ../../public/text.sig
- ../../public/vector-slice.sig
- ../../public/vector.sig
- ../../public/word.sig
+group
+ group(sigs.cm)
+ source(-)
+is
../array-slice.sml
../array.sml
+ ../bin-op.sml
+ ../bin-pr.sml
../bool.sml
- ../common.sml
+ ../buffer.sml
+ ../cmp.sml
+ ../common-mono-seqs.sml
+ ../common-scalars.sml
+ ../effect.sml
../emb.sml
+ ../exit.sml
+ ../fix.sml
+ ../fn.sml
../iso.sml
../list.sml
../option.sml
+ ../order.sml
+ ../pair.sml
+ ../product.sml
+ ../reader.sml
+ ../ref.sml
../smlnj/ints.sml
../smlnj/mono-array-slices.sml
../smlnj/mono-arrays.sml
@@ -41,7 +37,14 @@
../smlnj/mono-vectors.sml
../smlnj/reals.sml
../smlnj/words.sml
+ ../sq.sml
+ ../sum.sml
+ ../thunk.sml
+ ../tie.sml
+ ../un-op.sml
+ ../un-pr.sml
+ ../univ.sml
../vector-slice.sml
../vector.sml
- funs.cm
- workarounds/basis.cm
+ ../writer.sml
+ sigs.cm
|
|
From: Vesa K. <ve...@ml...> - 2006-11-20 04:03:10
|
Merged the basic lib into the extended-basis lib. The merge was done because it became apparent (to me) that it is just too painful to have them separated. One problem is that there were many little utilities in the basic lib that I wanted to use in the extended-basis lib while implementing new extensions (will appear later) and I don't want to keep duplicating stuff. This (at least temporarily) breaks the build files on compilers except MLton (and possibly MLKit). It seems that it will take some work to support SML/NJ's CM, but I definitely plan to do it as soon as I figure out how to do it least painfully. ---------------------------------------------------------------------- D mltonlib/trunk/com/ssh/basic/ ---------------------------------------------------------------------- |
|
From: Vesa K. <ve...@ml...> - 2006-11-20 04:02:35
|
Merged the basic lib into the extended-basis lib.
The merge was done because it became apparent (to me) that it is just too
painful to have them separated. One problem is that there were many
little utilities in the basic lib that I wanted to use in the
extended-basis lib while implementing new extensions (will appear later)
and I don't want to keep duplicating stuff.
This (at least temporarily) breaks the build files on compilers except
MLton (and possibly MLKit). It seems that it will take some work to
support SML/NJ's CM, but I definitely plan to do it as soon as I figure
out how to do it least painfully.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-op.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-pr.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/buffer.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml
D mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/effect.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exit.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/order.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/pair.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/product.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/reader.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ref.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sq.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sum.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/thunk.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/tie.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-op.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-pr.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/writer.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-op.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-pr.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/buffer.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/cmp.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/effect.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/exit.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/fix.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/fn.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/infixes.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/int-inf.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/integer.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/iso.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-array-slice.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-array.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-vector-slice.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-vector.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/option.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/order.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/pair.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/product-type.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/product.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/reader.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/real.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/ref.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/sq.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/string.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/substring.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/sum.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/thunk.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/tie.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/top-level.sml
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/un-op.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/un-pr.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/unit.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/univ.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/vector-slice.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/vector.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/word.sig
A mltonlib/trunk/com/ssh/extended-basis/unstable/public/writer.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,10 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {ArraySlice :> ARRAY_SLICE} structure.
- *)
structure ArraySlice : ARRAY_SLICE = struct
open ArraySlice
- type 'a t = 'a slice
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,15 +4,8 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {Array :> ARRAY} structure.
- *)
structure Array : ARRAY = struct
local
- structure Array = struct
- open Array
- type 'a t = 'a array
- end
structure Common = MkSeqCommonExt (Array)
in
open Array Common
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-op.sml (from rev 4841, mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml 2006-11-19 19:56:24 UTC (rev 4841)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-op.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,10 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure BinOp :> BIN_OP = struct
+ open BinOp
+ fun map (b2a, a2b) = Fn.map (Sq.map b2a, a2b)
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-pr.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/bin-pr.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/bin-pr.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-pr.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,9 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure BinPr :> BIN_PR = struct
+ open BinPr
+end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,13 +4,9 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {Bool : BOOL} structure.
- *)
structure Bool : BOOL = struct
open Bool
- type t = bool
- val equal = op = : bool * bool -> bool
+ val equal = op = : t BinOp.t
val compare = fn (false, true) => LESS
| (true, false) => GREATER
| (_, _) => EQUAL
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,50 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(* Minimal modules for bootstrapping. *)
+
+structure Fn = struct type ('a, 'b) t = 'a -> 'b end
+structure Unit = struct type t = unit end
+structure Bool = struct open Bool type t = bool end
+structure Option = struct open Option type 'a t = 'a option end
+structure String = struct open String type t = string end
+structure Int = struct open Int type t = int end
+structure LargeInt = struct open LargeInt type t = int end
+structure Word = struct open Word type t = word end
+structure LargeWord = struct open LargeWord type t = word end
+structure LargeReal = struct open LargeReal type t = real end
+structure Word8Vector = struct open Word8Vector type t = vector end
+structure Array = struct open Array type 'a t = 'a array end
+structure ArraySlice = struct open ArraySlice type 'a t = 'a slice end
+structure Vector = struct open Vector type 'a t = 'a vector end
+structure VectorSlice = struct open VectorSlice type 'a t = 'a slice end
+structure List = struct open List type 'a t = 'a list end
+structure Effect = struct type 'a t = 'a -> Unit.t end
+structure Order = struct datatype t = datatype order end
+structure Pair = struct
+ type ('a, 'b) pair = 'a * 'b
+ type ('a, 'b) t = ('a, 'b) pair
+end
+structure Product = struct
+ datatype ('a, 'b) product = & of 'a * 'b
+ type ('a, 'b) t = ('a, 'b) product
+end
+structure Ref = struct type 'a t = 'a ref end
+structure Sum = struct
+ datatype ('a, 'b) sum = INL of 'a | INR of 'b
+ type('a, 'b) t = ('a, 'b) sum
+end
+structure Sq = struct type 'a t = 'a * 'a end
+structure Thunk = struct type 'a t = Unit.t -> 'a end
+structure UnOp = struct type 'a t = 'a -> 'a end
+structure UnPr = struct type 'a t = 'a -> Bool.t end
+structure Reader = struct type ('a, 'b) t = 'b -> ('a * 'b) Option.t end
+structure Writer = struct type ('a, 'b) t = 'a * 'b -> 'b end
+structure Cmp = struct type 'a t = 'a Sq.t -> Order.t end
+structure BinOp = struct type 'a t = 'a Sq.t -> 'a end
+structure BinPr = struct type 'a t = 'a Sq.t UnPr.t end
+structure Emb = struct type ('a, 'b) t = ('a -> 'b) * ('b -> 'a Option.t) end
+structure Iso = struct type ('a, 'b) t = ('a -> 'b) * ('b -> 'a) end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/buffer.sml (from rev 4843, mltonlib/trunk/com/ssh/basic/unstable/detail/buffer.sml)
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml (from rev 4839, mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml 2006-11-19 19:45:33 UTC (rev 4839)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Cmp :> CMP = struct
+ open Cmp
+
+ fun map b2a = Fn.map (Sq.map b2a, Fn.id)
+
+ local
+ open Order
+ in
+ fun mkRelOps cmp =
+ {< = isLess o cmp, <= = not o isGreater o cmp,
+ == = isEqual o cmp, != = not o isEqual o cmp,
+ > = isGreater o cmp, >= = not o isLess o cmp}
+
+ fun max cmp (x, y) = if isLess (cmp (x, y)) then y else x
+ fun min cmp (x, y) = if isGreater (cmp (x, y)) then y else x
+ end
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml (from rev 4833, mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,24 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(** == Extended mono sequence modules common to all compilers == *)
+
+structure Word8Vector = MkMonoVectorExt (Word8Vector)
+structure Word8VectorSlice =
+ MkMonoVectorSliceExt (structure MonoVectorSlice = Word8VectorSlice)
+structure Word8Array = MkMonoArrayExt (structure MonoArray = Word8Array
+ structure MonoVector = Word8Vector)
+structure Word8ArraySlice =
+ MkMonoArraySliceExt (structure MonoArraySlice = Word8ArraySlice)
+
+structure Text = MkTextExt (Text)
+structure Char = Text.Char
+structure CharArray = Text.CharArray
+structure CharArraySlice = Text.CharArraySlice
+structure CharVector = Text.CharVector
+structure CharVectorSlice = Text.CharVectorSlice
+structure String = Text.String
+structure Substring = Text.Substring
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml (from rev 4833, mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(** == Extended scalar modules common to all compilers == *)
+
+structure Int = MkIntegerExt (Int)
+structure LargeInt = MkIntegerExt (LargeInt)
+structure Position = MkIntegerExt (Position)
+
+structure LargeReal = MkRealExt (LargeReal)
+structure Real = MkRealExt (Real)
+
+structure LargeWord = MkWordExt (LargeWord)
+structure Word = MkWordExt (Word)
+structure Word8 = MkWordExt (Word8)
Deleted: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -1,35 +0,0 @@
-(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- *)
-
-(** == Extended modules common to all compilers == *)
-
-structure Int = MkIntegerExt (Int)
-structure LargeInt = MkIntegerExt (LargeInt)
-structure Position = MkIntegerExt (Position)
-
-structure LargeReal = MkRealExt (LargeReal)
-structure Real = MkRealExt (Real)
-
-structure LargeWord = MkWordExt (LargeWord)
-structure Word = MkWordExt (Word)
-structure Word8 = MkWordExt (Word8)
-
-structure Word8Vector = MkMonoVectorExt (Word8Vector)
-structure Word8VectorSlice =
- MkMonoVectorSliceExt (structure MonoVectorSlice = Word8VectorSlice)
-structure Word8Array = MkMonoArrayExt (structure MonoArray = Word8Array
- structure MonoVector = Word8Vector)
-structure Word8ArraySlice =
- MkMonoArraySliceExt (structure MonoArraySlice = Word8ArraySlice)
-
-structure Text = MkTextExt (Text)
-structure Char = Text.Char
-structure CharArray = Text.CharArray
-structure CharArraySlice = Text.CharArraySlice
-structure CharVector = Text.CharVector
-structure CharVectorSlice = Text.CharVectorSlice
-structure String = Text.String
-structure Substring = Text.Substring
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/effect.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/effect.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/effect.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/effect.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,13 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Effect :> EFFECT = struct
+ open Effect
+ val ignore = ignore
+ val nop = ignore
+ fun obs ef x = (ef x : unit ; x)
+ fun past ef x = (ef () : unit ; x)
+end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,15 +4,16 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Structure for embeddings.
- *)
structure Emb :> EMB = struct
- type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
- type ('a, 'b) t = ('a, 'b) emb
+ open Emb
- val id = (fn a => a, SOME)
+ infix <-->
- fun to (a2b, _) = a2b
- fun from (_, b2a) = b2a
+ val id = (Fn.id, SOME)
+
+ val to = Pair.fst
+ val from = Pair.snd
+
+ fun (a2b, b2aOpt) <--> (c2a, a2cOpt) =
+ (a2b o c2a, Option.composePartial (a2cOpt, b2aOpt))
end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exit.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/exit.sml)
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/fix.sml)
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/fn.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/fn.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,24 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Fn :> FN = struct
+ open Fn
+ fun map (f, g) h = g o h o f
+ fun const x _ = x
+ fun curry f x y = f (x, y)
+ fun failing e _ = raise e
+ fun flip f x y = f y x
+ fun id x = x
+ fun uncurry f (x, y) = f x y
+ val op o = op o
+ fun undefined _ = raise Fail "undefined"
+ fun op <\ (x, f) y = f (x, y)
+ fun op \> (f, y) = f y
+ fun op /> (f, y) x = f (x, y)
+ fun op </ (x, f) = f x
+ val op >| = op </
+ val op |< = op \>
+end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,15 +4,26 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Structure for isomorphisms.
- *)
structure Iso :> ISO = struct
- type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
- type ('a, 'b) t = ('a, 'b) iso
+ open Iso
- val id = (fn a => a, fn a => a)
+ infix <-->
- fun to (a2b, _) = a2b
- fun from (_, b2a) = b2a
+ val id = (Fn.id, Fn.id)
+
+ val to = Pair.fst
+ val from = Pair.snd
+ val swap = Pair.swap
+
+ fun (a2b, b2a) <--> (c2a, a2c) = (a2b o c2a, a2c o b2a)
+
+ fun map (l, r) iso = r <--> iso <--> l
+
+ local
+ fun mk map = Pair.map map o Pair.swizzle
+ in
+ fun op --> ? = mk (Fn.map, Fn.map) ?
+ fun op +` ? = mk (Sum.map, Sum.map) ?
+ fun op *` ? = mk (Product.map, Product.map) ?
+ end
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,12 +4,8 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {List :> LIST} structure.
- *)
structure List : LIST = struct
open List
- type 'a t = 'a list
val sub = nth
fun init l = rev (tl (rev l))
fun intersperse d =
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {INT_INF} modules.
- *)
functor MkIntInfExt (I : INT_INF) = struct
local
structure E = MkIntegerExt (I)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {INTEGER} modules.
- *)
functor MkIntegerExt (I : INTEGER) = struct
open I
type t = int
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {MONO_ARRAY} modules.
- *)
functor MkMonoArrayExt (structure MonoVector : MONO_VECTOR
structure MonoArray : MONO_ARRAY
where type elem = MonoVector.elem
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {MONO_ARRAY_SLICE} modules.
- *)
functor MkMonoArraySliceExt (structure MonoArraySlice : MONO_ARRAY_SLICE) =
struct
open MonoArraySlice
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor to make common sequence (array or vector) extensions.
- *)
functor MkMonoSeqCommonExt (type t
type elem
val foldr : (elem * 'a -> 'a) -> 'a -> t -> 'a
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {MONO_VECTOR} modules.
- *)
functor MkMonoVectorExt (MonoVector : MONO_VECTOR) = struct
local
structure MonoVector = struct
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {MONO_VECTOR_SLICE} modules.
- *)
functor MkMonoVectorSliceExt (structure MonoVectorSlice : MONO_VECTOR_SLICE) =
struct
open MonoVectorSlice
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {REAL} modules.
- *)
functor MkRealExt (R : REAL) = struct
open R
type t = real
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor to make common sequence (array or vector) extensions.
- *)
functor MkSeqCommonExt (type 'a t
val foldr : ('a * 'b -> 'b) -> 'b -> 'a t -> 'b
val fromList : 'a list -> 'a t
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {TEXT} modules.
- *)
functor MkTextExt (T : TEXT) = struct
open T
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Functor for extending {WORD} modules.
- *)
functor MkWordExt (W : WORD) = struct
open W
type t = word
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,12 +4,8 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {Option : OPTION} structure.
- *)
structure Option : OPTION = struct
open Option
- type 'a t = 'a option
val isNone = fn NONE => true
| SOME _ => false
end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/order.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/order.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/order.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/order.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,17 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Order :> ORDER = struct
+ open Order
+ val swap = fn LESS => GREATER
+ | EQUAL => EQUAL
+ | GREATER => LESS
+ fun isEqual x = x = EQUAL
+ fun isGreater x = x = GREATER
+ fun isLess x = x = LESS
+ val orWhenEq = fn (EQUAL, th) => th ()
+ | (other, _) => other
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/pair.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/pair.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/pair.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/pair.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,51 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Pair : PAIR = struct
+ open Pair
+
+ val isoTuple2 as (fromTuple2, toTuple2) =
+ (fn (a, b) => (a, b),
+ fn (a, b) => (a, b))
+ val isoTuple3 as (fromTuple3, toTuple3) =
+ (fn (a, b, c) => ((a, b), c),
+ fn ((a, b), c) => (a, b, c))
+ val isoTuple4 as (fromTuple4, toTuple4) =
+ (fn (a, b, c, d) => (((a, b), c), d),
+ fn (((a, b), c), d) => (a, b, c, d))
+
+ fun swap (a, b) = (b, a)
+ fun swizzle ((a, b), (c, d)) = ((a, c), (b, d))
+
+ fun fst (a, _) = a
+ fun snd (_, b) = b
+
+ fun app (ea, eb) (a, b) = (ea a : unit ; eb b : unit)
+ fun appFst eA = app (eA, Effect.ignore)
+ fun appSnd eB = app (Effect.ignore, eB)
+
+ fun map (fa, fb) (a, b) = (fa a, fb b)
+ fun mapFst fA = map (fA, Fn.id)
+ fun mapSnd fB = map (Fn.id, fB)
+
+ local
+ fun mk p (fA, fB) (a, b) = let
+ val a = fA a
+ in
+ if p a then a else fB b
+ end
+ in
+ fun all ? = mk Bool.isFalse ?
+ fun exists ? = mk Bool.isTrue ?
+ fun equal ? = mk Bool.isFalse ? o swizzle
+ fun collate ? = mk Order.isEqual ? o swizzle
+ end
+
+ fun foldl (fa, fb) ((a, b), s) = fb (b, fa (a, s))
+ fun foldr (fa, fb) ((a, b), s) = fa (a, fb (b, s))
+
+ fun thunk (na, nb) () = (na (), nb ())
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/product.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/product.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/product.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/product.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,53 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Product : PRODUCT = struct
+ open Product
+
+ infix &
+
+ val isoTuple2 as (fromTuple2, toTuple2) =
+ (fn (a, b) => a & b,
+ fn a & b => (a, b))
+ val isoTuple3 as (fromTuple3, toTuple3) =
+ (fn (a, b, c) => a & b & c,
+ fn a & b & c => (a, b, c))
+ val isoTuple4 as (fromTuple4, toTuple4) =
+ (fn (a, b, c, d) => a & b & c & d,
+ fn a & b & c & d => (a, b, c, d))
+
+ fun swap (a & b) = b & a
+ fun swizzle ((a & b), (c & d)) = ((a, c) & (b, d))
+
+ fun fst (a & _) = a
+ fun snd (_ & b) = b
+
+ fun app (eA, eB) (a & b) = (eA a : unit ; eB b : unit)
+ fun appFst eA = app (eA, Effect.ignore)
+ fun appSnd eB = app (Effect.ignore, eB)
+
+ fun map (fA, fB) (a & b) = fA a & fB b
+ fun mapFst fA = map (fA, Fn.id)
+ fun mapSnd fB = map (Fn.id, fB)
+
+ local
+ fun mk p (fA, fB) (a & b) = let
+ val a = fA a
+ in
+ if p a then a else fB b
+ end
+ in
+ fun all ? = mk Bool.isFalse ?
+ fun exists ? = mk Bool.isTrue ?
+ fun equal ? = mk Bool.isFalse ? o swizzle
+ fun collate ? = mk Order.isEqual ? o swizzle
+ end
+
+ fun foldl (fA, fB) (a & b, s) = fB (b, fA (a, s))
+ fun foldr (fA, fB) (a & b, s) = fA (a, fB (b, s))
+
+ fun thunk (nA, nB) () = nA () & nB ()
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/reader.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/reader.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/reader.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/reader.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,27 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Reader :> READER = struct
+ open Reader
+
+ infix >>= >>&
+
+ fun return a s = SOME (a, s)
+ fun rA >>= a2rB = Option.mapPartial (Fn.uncurry a2rB) o rA
+
+ fun map a2b rA = rA >>= return o a2b
+ fun rA >>& rB = rA >>= (fn a => rB >>= (fn b => return (Product.& (a, b))))
+
+ type univ = Univ.t
+ type 'a u = ('a, univ) t
+
+ fun polymorphically uA2uB = let
+ val (to, from) = Univ.newIso ()
+ fun map f = Option.map (Pair.map (Fn.id, f))
+ in
+ Fn.map (to, map from) o uA2uB o Fn.map (from, map to)
+ end
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ref.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/ref.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/ref.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ref.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,24 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Ref : REF = struct
+ open Ref
+ val new = ref
+ val ! = !
+ val op := = op :=
+ fun op :=: (r1, r2) = let
+ val v1 = !r1
+ val v2 = !r2
+ in
+ r1 := v2
+ ; r2 := v1
+ end
+ fun exchange (r, v) = !r before r := v
+ fun app ef = ef o !
+ fun map f = new o f o !
+ fun modify f r = r := f (!r)
+ val equal = op =
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sq.sml (from rev 4836, mltonlib/trunk/com/ssh/basic/unstable/detail/sq.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/sq.sml 2006-11-19 18:08:26 UTC (rev 4836)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sq.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Sq :> SQ = struct
+ open Sq
+ fun mk x = (x, x)
+ fun map f (x, y) = (f x, f y)
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sum.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/sum.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/sum.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sum.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,42 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Sum : SUM = struct
+ open Sum
+
+ exception Sum
+
+ fun sum (fA, fB) = fn INL a => fA a | INR b => fB b
+
+ val swap = fn INL x => INR x | INR x => INL x
+
+ val out = fn INL x => x | INR x => x
+
+ val app = sum
+ fun map (fA, fB) = sum (INL o fA, INR o fB)
+
+ val isL = fn INL _ => true | INR _ => false
+ val outL = fn INL l => l | INR _ => raise Sum
+ val getL = fn INL x => (fn _ => x) | INR _ => (fn x => x)
+ fun mapL f = map (f, fn r => r)
+
+ fun isR ? = (isL o swap) ?
+ fun outR ? = (outL o swap) ?
+ fun getR ? = (getL o swap) ?
+ fun mapR f = swap o mapL f o swap
+
+ fun equal (eqA, eqB) =
+ fn (INL l, INL r) => eqA (l, r)
+ | (INL _, INR _) => false
+ | (INR _, INL _) => false
+ | (INR l, INR r) => eqB (l, r)
+
+ fun collate (cmpA, cmpB) =
+ fn (INL l, INL r) => cmpA (l, r)
+ | (INL _, INR _) => LESS
+ | (INR _, INL _) => GREATER
+ | (INR l, INR r) => cmpB (l, r)
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/thunk.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/thunk.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/thunk.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/thunk.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,10 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Thunk :> THUNK = struct
+ open Thunk
+ val mk = Fn.const
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/tie.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/tie.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/tie.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/tie.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Tie :> TIE = struct
+ type 'a t_domain = Unit.t
+ type 'a t_range = 'a * 'a UnOp.t
+ type 'a t = 'a t_domain -> 'a t_range
+ fun fix a f = let val (a, ta) = a () in ta (f a) end
+ val pure = Fn.id
+ fun tier th = (fn (a, ta) => (a, Fn.const a o ta)) o th
+ fun iso tb iso = Pair.map (Iso.from iso, Fn.map iso) o tb
+ fun op *` (a, b) = Pair.map (Product.&, Product.map) o
+ Pair.swizzle o Pair.map (a, b) o Sq.mk
+ fun tuple2 (a, b) = iso (op *` (a, b)) Product.isoTuple2
+ fun option () = (NONE, Fn.id)
+ fun fromRef rf x = !rf x
+ fun function ? =
+ tier (fn () => Pair.map (fromRef, Fn.curry op :=)
+ (Sq.mk (ref (Fn.failing Fix.Fix)))) ?
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-op.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/un-op.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/un-op.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-op.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,9 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure UnOp :> UN_OP = struct
+ open UnOp
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-pr.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/un-pr.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/un-pr.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-pr.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure UnPr :> UN_PR = struct
+ open UnPr
+ fun op andAlso (p, q) ? = p ? andalso q ?
+ fun op orElse (p, q) ? = p ? orelse q ?
+ fun negate p = not o p
+end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/univ.sml)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -9,5 +9,4 @@
*)
structure VectorSlice : VECTOR_SLICE = struct
open VectorSlice
- type 'a t = 'a slice
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -9,10 +9,6 @@
*)
structure Vector : VECTOR = struct
local
- structure Vector = struct
- open Vector
- type 'a t = 'a vector
- end
structure Common = MkSeqCommonExt (Vector)
in
open Vector Common
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/writer.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/writer.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/writer.sml 2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/writer.sml 2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,21 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Writer :> WRITER = struct
+ open Writer
+
+ fun map b2a wA = wA o Pair.map (b2a, Fn.id)
+
+ type univ = Univ.t
+ type 'a u = ('a, univ) t
+
+ fun polymorphically uA2uB = let
+ val (to, from) = Univ.newIso ()
+ fun map f = Pair.map (Fn.id, f)
+ in
+ Fn.map (map to, from) o uA2uB o Fn.map (map from, to)
+ end
+end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2006-11-20 12:02:01 UTC (rev 4844)
@@ -29,72 +29,161 @@
"warnUnused true"
in
local
- (* NOTE: Order matters. *)
-
(* Workarounds (if any) *)
detail/$(SML_COMPILER)/workarounds.mlb
- (* New {Iso :> ISO} and {Emb :> EMB} modules *)
- public/emb.sig
- detail/emb.sml
- public/iso.sig
- detail/iso.sml
+ (* Minimal modules for bootstrapping. *)
+ detail/bootstrap.sml
- (* Extension functors *)
- detail/mk-integer-ext.fun
- detail/mk-int-inf-ext.fun
- detail/mk-real-ext.fun
- detail/mk-word-ext.fun
- detail/mk-seq-common-ext.fun
- detail/mk-mono-seq-common-ext.fun
- detail/mk-mono-vector-ext.fun
- detail/mk-mono-vector-slice-ext.fun
- detail/mk-mono-array-ext.fun
- detail/mk-mono-array-slice-ext.fun
- detail/mk-text-ext.fun
+ basis Fn = bas public/fn.sig detail/fn.sml end
+ basis Unit = bas public/unit.sig end
+ basis Sq = bas public/sq.sig detail/sq.sml end
+ basis UnOp = bas public/un-op.sig detail/un-op.sml end
+ basis Thunk = let
+ open Fn
+ in
+ bas public/thunk.sig detail/thunk.sml end
+ end
+ basis Univ = bas public/univ.sig detail/univ.sml end
+ basis BinOp = let
+ open Fn Sq
+ in
+ bas public/bin-op.sig detail/bin-op.sml end
+ end
+ basis Effect = bas public/effect.sig detail/effect.sml end
+ basis Fix = bas public/fix.sig detail/fix.sml end
+ basis UnPr = bas public/un-pr.sig detail/un-pr.sml end
+ basis Order = bas public/order.sig detail/order.sml end
+ basis BinPr = bas public/bin-pr.sig detail/bin-pr.sml end
+ basis Cmp = let
+ open Fn Order Sq
+ in
+ bas public/cmp.sig detail/cmp.sml end
+ end
+ basis Ref = bas public/ref.sig detail/ref.sml end
+ basis Bool = bas public/bool.sig detail/bool.sml end
+ basis Products = let
+ open Bool Effect Fn Order
+ in
+ bas
+ public/product-type.sig
+ public/pair.sig
+ detail/pair.sml
+ public/product.sig
+ detail/product.sml
+ end
+ end
+ basis Sum = bas public/sum.sig detail/sum.sml end
+ basis Emb = let
+ open Fn Products
+ in
+ bas public/emb.sig detail/emb.sml end
+ end
+ basis Iso = let
+ open Fn Products Sum
+ in
+ bas public/iso.sig detail/iso.sml end
+ end
+ basis Tie = let
+ open Fix Fn Iso Products Sq
+ in
+ bas public/tie.sig detail/tie.sml end
+ end
+ basis Seqs = bas
+ detail/mk-seq-common-ext.fun
- (* Extended signatures *)
- public/bool.sig
- public/option.sig
- public/int-inf.sig
- public/integer.sig
- public/real.sig
- public/word.sig
- public/list.sig
- public/vector.sig
- public/vector-slice.sig
- public/array.sig
- public/array-slice.sig
- public/mono-vector.sig
- public/mono-vector-slice.sig
- public/mono-array.sig
- public/mono-array-slice.sig
- public/char.sig
- public/string.sig
- public/substring.sig
- public/text.sig
+ public/array.sig
+ detail/array.sml
+ public/array-slice.sig
+ detail/array-slice.sml
- (* Extended modules *)
- detail/bool.sml
- detail/option.sml
- detail/list.sml
- detail/vector.sml
- detail/vector-slice.sml
- detail/array.sml
- detail/array-slice.sml
- detail/common.sml
- detail/$(SML_COMPILER)/ints.sml
- detail/$(SML_COMPILER)/reals.sml
- detail/$(SML_COMPILER)/words.sml
- detail/$(SML_COMPILER)/mono-vectors.sml
- detail/$(SML_COMPILER)/mono-vector-slices.sml
- detail/$(SML_COMPILER)/mono-arrays.sml
- detail/$(SML_COMPILER)/mono-array-slices.sml
- detail/$(SML_COMPILER)/texts.sml
+ public/vector.sig
+ detail/vector.sml
+ public/vector-slice.sig
+ detail/vector-slice.sml
+ end
+ basis Option = bas public/option.sig detail/option.sml end
+ basis List = let
+ open Option
+ in
+ bas public/list.sig detail/list.sml end
+ end
+ basis Buffer = let
+ open Seqs List Fn Products
+ in
+ bas public/buffer.sig detail/buffer.sml end
+ end
+ basis Reader = let
+ open Fn Products Univ
+ in
+ bas public/reader.sig detail/reader.sml end
+ end
+ basis Writer = let
+ open Fn Products Univ
+ in
+ bas public/writer.sig detail/writer.sml end
+ end
+ basis Exit = bas public/exit.sig detail/exit.sml end
+ basis Scalars = bas
+ detail/mk-integer-ext.fun
+ detail/mk-int-inf-ext.fun
+ detail/mk-real-ext.fun
+ detail/mk-word-ext.fun
+
+ public/int-inf.sig
+ public/integer.sig
+ public/real.sig
+ public/word.sig
+
+ detail/common-scalars.sml
+ detail/$(SML_COMPILER)/ints.sml
+ detail/$(SML_COMPILER)/reals.sml
+ detail/$(SML_COMPILER)/words.sml
+ end
+ basis MonoSeqs = bas
+ detail/mk-mono-seq-common-ext.fun
+ detail/mk-mono-vector-ext.fun
+ detail/mk-mono-vector-slice-ext.fun
+ detail/mk-mono-array-ext.fun
+ detail/mk-mono-array-slice-ext.fun
+ detail/mk-text-ext.fun
+
+ public/mono-vector.sig
+ public/mono-vector-slice.sig
+ public/mono-array.sig
+ public/mono-array-slice.sig
+ public/char.sig
+ public/string.sig
+ public/substring.sig
+ public/text.sig
+
+ detail/common-mono-seqs.sml
+ detail/$(SML_COMPILER)/mono-vectors.sml
+ detail/$(SML_COMPILER)/mono-vector-slices.sml
+ detail/$(SML_COMPILER)/mono-arrays.sml
+ detail/$(SML_COMPILER)/mono-array-slices.sml
+ detail/$(SML_COMPILER)/texts.sml
+ end
+
+ open BinOp BinPr Bool Buffer
+ open Cmp
+ open Effect Emb Exit
+ open Fix Fn
+ open Iso
+ open List
+ open MonoSeqs
+ open Option Order
+ open Products
+ open Reader Ref
+ open Scalars Seqs Sq Sum
+ open Thunk Tie
+ open Unit Univ UnOp UnPr
+ open Writer
in
public/export-$(SML_COMPILER).sml
public/export.sml
public/top-level.sml
+ public/infixes.sml
end
end
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,14 +4,10 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {ARRAY_SLICE} signature.
- *)
+(** Extended {ARRAY_SLICE} signature. *)
signature ARRAY_SLICE = sig
include ARRAY_SLICE
type 'a t = 'a slice
- (**
- * Convenience alias.
- *)
+ (** Convenience alias. *)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,16 +4,12 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Extended {ARRAY} signature.
- *)
+(** Extended {ARRAY} signature. *)
signature ARRAY = sig
include ARRAY
type 'a t = 'a array
- (**
- * Convenience alias.
- *)
+ (** Convenience alias. *)
val duplicate : 'a t -> 'a t
(**
@@ -21,7 +17,7 @@
* equivalent to {tabulate (length a, fn i => sub (a, i))}.
*)
- val unfoldi : (int * 'b -> 'a * 'b) -> int * 'b -> 'a t * 'b
+ val unfoldi : (Int.t * 'b -> 'a * 'b) -> Int.t * 'b -> 'a t * 'b
(**
* {unfoldi f (n, b)} constructs an array a of length {n}, whose
* elements {ai} are determined by the equations {b0 = b} and {(ai,
@@ -30,7 +26,7 @@
(** == Conversions == *)
- val fromVector : 'a vector -> 'a array
+ val fromVector : 'a Vector.t -> 'a t
(**
* Creates a new array from the given vector. Specifically, the
* expression {fromVector v} is equivalent to the expression
@@ -38,13 +34,13 @@
*> tabulate (Vector.length v, fn i => Vector.sub (v, i))
*)
- val toList : 'a array -> 'a list
+ val toList : 'a t -> 'a List.t
(**
* Generates a list from the given array. Specifically, the result of
* {toList a} is equivalent to {foldr op :: [] a}.
*)
- val toVector : 'a array -> 'a vector
+ val toVector : 'a t -> 'a Vector.t
(**
* Generates a vector from the given array. Specifically, the result
* of {toVector a} is equivalent to
@@ -54,14 +50,14 @@
(** == Isomorphisms == *)
- val isoList : ('a array, 'a list) Iso.t
+ val isoList : ('a t, 'a List.t) Iso.t
(**
* An isomorphism between arrays and lists. It is always equivalent to
* {(toList, fromList)}. Note that the isomorphism does not preserve
* identity.
*)
- val isoVector : ('a array, 'a vector) Iso.t
+ val isoVector : ('a t, 'a Vector.t) Iso.t
(**
* An isomorphism between arrays and vectors. It is always equivalent
* to {(toVector, fromVector)}. Note that the isomorphism does not
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-op.sig (from rev 4841, mltonlib/trunk/com/ssh/basic/unstable/public/bin-op.sig)
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-pr.sig (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/bin-pr.sig)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig 2006-11-20 12:02:01 UTC (rev 4844)
@@ -11,15 +11,15 @@
type t = bool
(** Convenience alias. *)
- val isTrue : t -> t
+ val isTrue : t UnPr.t
(** {isTrue x = x = true} *)
- val isFalse : t -> t
+ val isFalse : t UnPr.t
(** {isFalse x = x = false} *)
- val equal : t * t -> t
+ val equal : t BinPr.t
(** Equivalent to {op =}. *)
- val compare : t * t -> order
+ val compare : t Cmp.t
(** An ordering on booleans. {false} is defined less than {true}. *)
end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/buffer.sig (from rev 4843, mltonlib/trunk/com/ssh/basic/unstable/public/buffer.sig)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig 2006-11-20 12:02:01 UTC (rev 4844)
@@ -17,18 +17,18 @@
(** == Bounds == *)
- val minOrd : Int.int
+ val minOrd : Int.t
(**
* The least character code. It always equals {0}.
*)
- val boundsChar : char * char
+ val boundsChar : t Sq.t
(**
* Pair of the least and greatest characters. It always equals
* {(minChar, maxChar)}.
*)
- val boundsOrd : Int.int * Int.int
+ val boundsOrd : Int.t Sq.t
(**
* Pair of the least and greatest character codes. It always equals
* {(minOrd, maxOrd)}.
@@ -36,7 +36,7 @@
(** == Isomorphisms == *)
- val isoInt : (char, Int.int) Iso.t
+ val isoInt : (t, Int.t) Iso.t
(**
* An isomorphism between characters and character codes. It always
* equals {(ord, chr)}. Note that the projection part of the
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/cmp.sig (from rev 4839, mltonlib/trunk/com/ssh/basic/unstable/public/cmp.sig)
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/effect.sig (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/effect.sig)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig 2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig 2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,33 +4,23 @@
* See the file MLton-LICENSE for details.
*)
-(**
- * Signature for the {Emb} structure for embeddings.
- *)
+(** Signature for the {Emb} structure for embeddings. *)
signature EMB = sig
- type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
- (**
- * Embedding of {'a} into {'b} with injection and projection functions.
- *)
+ type ('a, 'b) t = ('a -> 'b) * ('b -> 'a Option.t)
+ (** Embedding of {'a} into {'b} with injection and projection functions. *)
- type ('a, 'b) t = ('a, 'b) emb
+ val id : ('a, 'a) t
(**
- * Convenience alias.
- *)
-
- val id : ('a, 'a) emb
- (**
* The identity embedding. This is always equivalent to {(fn a => a,
* SOME)}.
*)
- val to : ('a, 'b) emb -> 'a -> 'b
- (**
- * Extracts the injection part of the given embedding.
- *)
+ val to : ('a, 'b) t -> 'a -> 'b
+ (** Extracts the injection part of the given embedding. *)
- val from : ('a, 'b) emb -> 'b -> 'a option
- (**
- * Extracts the projection part of the given embedding.
- *)
+ val from : ('a, 'b) t -> 'b -> 'a Option.t
+ (** Extracts the projection part of the given embedding. *)
+
+ val <--> : ('a, 'b) t * ('c, 'a) t -> ('c, 'b) t
+ (** Embedding composition. *)
end
Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/exit.sig (from rev 4833, mltonlib/trunk/com/ssh/...
[truncated message content] |
|
From: Vesa K. <ve...@ml...> - 2006-11-19 12:04:00
|
Added pushBuffer and pushList.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/basic/unstable/detail/buffer.sml
U mltonlib/trunk/com/ssh/basic/unstable/public/buffer.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/basic/unstable/detail/buffer.sml
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/buffer.sml 2006-11-19 20:03:10 UTC (rev 4842)
+++ mltonlib/trunk/com/ssh/basic/unstable/detail/buffer.sml 2006-11-19 20:03:55 UTC (rev 4843)
@@ -28,22 +28,30 @@
end
end
local
- fun mk sLength sSub sCopy (b as IN {length, data}, s) =
+ fun mk sLength sAny sCopy (b as IN {length, data}, s) =
case sLength s of
0 => ()
| n => let
val newLength = !length + n
- in ensureCap b newLength (sSub (s, 0))
+ in ensureCap b newLength (sAny s)
; sCopy {src = s, dst = !data, di = !length} : unit
; length := newLength
end
+ infixr />
+ val op /> = Fn./>
in
- fun push ? = mk (Fn.const 1) Pair.fst
- (fn {src, dst, di} => A.update (dst, di, src)) ?
- fun pushArray ? = mk A.length A.sub A.copy ?
- fun pushArraySlice ? = mk AS.length AS.sub AS.copy ?
- fun pushVector ? = mk V.length V.sub A.copyVec ?
- fun pushVectorSlice ? = mk VS.length VS.sub AS.copyVec ?
+ fun push ? =
+ mk (Fn.const 1) Fn.id (fn {src, dst, di} => A.update (dst, di, src)) ?
+ fun pushArray ? = mk A.length (A.sub /> 0) A.copy ?
+ fun pushArraySlice ? = mk AS.length (AS.sub /> 0) AS.copy ?
+ fun pushBuffer (b, s) =
+ pushArraySlice (b, AS.slice (data s, 0, SOME (length s)))
+ fun pushList ? =
+ mk List.length List.hd
+ (fn {src, dst, di} =>
+ List.appi (fn (i, x) => A.update (dst, di+i, x)) src) ?
+ fun pushVector ? = mk V.length (V.sub /> 0) A.copyVec ?
+ fun pushVectorSlice ? = mk VS.length (VS.sub /> 0) AS.copyVec ?
end
local
fun mk tabulate b = tabulate (length b, fn i => sub (b, i))
Modified: mltonlib/trunk/com/ssh/basic/unstable/public/buffer.sig
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/public/buffer.sig 2006-11-19 20:03:10 UTC (rev 4842)
+++ mltonlib/trunk/com/ssh/basic/unstable/public/buffer.sig 2006-11-19 20:03:55 UTC (rev 4843)
@@ -20,6 +20,8 @@
val pushArray : ('a t * 'a Array.t) Effect.t
val pushArraySlice : ('a t * 'a ArraySlice.t) Effect.t
+ val pushBuffer : ('a t * 'a t) Effect.t
+ val pushList : ('a t * 'a List.t) Effect.t
val pushVector : ('a t * 'a Vector.t) Effect.t
val pushVectorSlice : ('a t * 'a VectorSlice.t) Effect.t
|
|
From: Matthew F. <fl...@ml...> - 2006-11-19 12:03:11
|
MacPorts installs GNU sed as 'gnused'
----------------------------------------------------------------------
U mlton/trunk/bin/mmake
U mlton/trunk/bin/msed
----------------------------------------------------------------------
Modified: mlton/trunk/bin/mmake
===================================================================
--- mlton/trunk/bin/mmake 2006-11-19 19:56:24 UTC (rev 4841)
+++ mlton/trunk/bin/mmake 2006-11-19 20:03:10 UTC (rev 4842)
@@ -9,6 +9,8 @@
if gmake -v >/dev/null 2>&1; then
make='gmake'
+elif gnumake -v >/dev/null 2>&1; then
+ make='gnumake'
elif make -v 2>&1 | grep -q GNU; then
make=`which make`
else
Modified: mlton/trunk/bin/msed
===================================================================
--- mlton/trunk/bin/msed 2006-11-19 19:56:24 UTC (rev 4841)
+++ mlton/trunk/bin/msed 2006-11-19 20:03:10 UTC (rev 4842)
@@ -9,6 +9,8 @@
if gsed --version >/dev/null 2>&1; then
sed='gsed'
+elif gnused --version >/dev/null 2>&1; then
+ sed='gnused'
elif sed --version 2>&1 | grep -q GNU; then
sed=`which sed`
else
|
|
From: Vesa K. <ve...@ml...> - 2006-11-19 11:56:25
|
Added map.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/basic/unstable/basic.mlb
U mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml
U mltonlib/trunk/com/ssh/basic/unstable/public/bin-op.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/basic/unstable/basic.mlb
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/basic.mlb 2006-11-19 19:52:20 UTC (rev 4840)
+++ mltonlib/trunk/com/ssh/basic/unstable/basic.mlb 2006-11-19 19:56:24 UTC (rev 4841)
@@ -32,7 +32,7 @@
bas public/univ.sig detail/univ.sml end
end
basis BinOp = let
- open Sq
+ open Fn Sq
in
bas public/bin-op.sig detail/bin-op.sml end
end
Modified: mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml 2006-11-19 19:52:20 UTC (rev 4840)
+++ mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml 2006-11-19 19:56:24 UTC (rev 4841)
@@ -6,4 +6,5 @@
structure BinOp :> BIN_OP = struct
type 'a t = 'a Sq.t -> 'a
+ fun map (b2a, a2b) = Fn.map (Sq.map b2a, a2b)
end
Modified: mltonlib/trunk/com/ssh/basic/unstable/public/bin-op.sig
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/public/bin-op.sig 2006-11-19 19:52:20 UTC (rev 4840)
+++ mltonlib/trunk/com/ssh/basic/unstable/public/bin-op.sig 2006-11-19 19:56:24 UTC (rev 4841)
@@ -8,4 +8,7 @@
signature BIN_OP = sig
type 'a t = 'a Sq.t -> 'a
(** Type of binary operators (e.g. {+, -, @, ...}). *)
+
+ val map : ('b, 'a) Iso.t -> 'a t -> 'b t
+ (** Change the sort of a binary operator. *)
end
|
|
From: Matthew F. <fl...@ml...> - 2006-11-19 11:52:22
|
For *-darwin:
- added include search path /opt/local/include
- added linker search path /opt/local/lib
This is where MacPorts (aka, DarwinPorts) installs Gnu MP.
This commit 'biases' the search paths in favor of MacPorts.
----------------------------------------------------------------------
U mlton/trunk/bin/mlton-script
U mlton/trunk/bytecode/Makefile
U mlton/trunk/runtime/Makefile
U mlton/trunk/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/trunk/bin/mlton-script
===================================================================
--- mlton/trunk/bin/mlton-script 2006-11-19 19:45:33 UTC (rev 4839)
+++ mlton/trunk/bin/mlton-script 2006-11-19 19:52:20 UTC (rev 4840)
@@ -62,8 +62,8 @@
# about -m. Someday, when we think we won't run into older gcc's,
# these should be changed to -f.
-# You may need to add a line with -cc-opt 'I/path/to/gmp.h' so the
-# C compiler can find gmp.h
+# You may need to add a line with -cc-opt 'I/path/to/gmp.h' so
+# that the C compiler can find gmp.h
# You may need to add a line with -link-opt '-L/path/to/libgmp' so
# that the linker can find libgmp.
@@ -79,7 +79,7 @@
-target-cc-opt amd64 \
'-m32
-mtune=opteron' \
- -target-cc-opt darwin '-I/sw/include' \
+ -target-cc-opt darwin '-I/opt/local/include -I/sw/include' \
-target-cc-opt freebsd '-I/usr/local/include' \
-target-cc-opt solaris \
'-Wa,-xarch=v8plusa
@@ -95,7 +95,7 @@
-target-link-opt aix '-lgmp' \
-target-link-opt amd64 '-m32' \
-target-link-opt cygwin '-lgmp' \
- -target-link-opt darwin "-L/sw/lib -lgmp" \
+ -target-link-opt darwin '-L/opt/local/lib -L/sw/lib -lgmp' \
-target-link-opt freebsd '-L/usr/local/lib/ -lgmp' \
-target-link-opt hpux '-lgmp' \
-target-link-opt linux '-lgmp' \
Modified: mlton/trunk/bytecode/Makefile
===================================================================
--- mlton/trunk/bytecode/Makefile 2006-11-19 19:45:33 UTC (rev 4839)
+++ mlton/trunk/bytecode/Makefile 2006-11-19 19:52:20 UTC (rev 4840)
@@ -25,7 +25,7 @@
endif
ifeq ($(TARGET_OS), darwin)
-CFLAGS += -I/sw/include
+CFLAGS += -I/opt/local/include -I/sw/include
endif
ifeq ($(TARGET_OS), freebsd)
Modified: mlton/trunk/runtime/Makefile
===================================================================
--- mlton/trunk/runtime/Makefile 2006-11-19 19:45:33 UTC (rev 4839)
+++ mlton/trunk/runtime/Makefile 2006-11-19 19:52:20 UTC (rev 4840)
@@ -34,7 +34,7 @@
endif
ifeq ($(TARGET_OS), darwin)
-FLAGS += -I/sw/include
+FLAGS += -I/opt/local/include -I/sw/include
endif
ifeq ($(TARGET_OS), freebsd)
Modified: mlton/trunk/runtime/platform.h
===================================================================
--- mlton/trunk/runtime/platform.h 2006-11-19 19:45:33 UTC (rev 4839)
+++ mlton/trunk/runtime/platform.h 2006-11-19 19:52:20 UTC (rev 4840)
@@ -39,16 +39,17 @@
/* C99-specific headers */
#include <inttypes.h>
-/* On FreeBSD and OpenBSD the default gmp.h is installed in /usr/include,
- * but that is version 2. We want gmp version 4, which is installed in
- * /usr/local/include, and is ensured to exist because it is required by the
- * MLton package.
- * On NetBSD, we want gmp to be installed into the pkg tree (which represents
- * the FreeBSD ports tree). For now we use the same method as in the FreeBSD
- * case, but we note that this should be changed so the makefile provides the
- * correct -I flags to the compiler.
- * On MacOS X, many users will use fink to install gmp, in which case gmp.h
- * will be installed in /sw/include.
+/* On FreeBSD and OpenBSD the default gmp.h is installed in
+ * /usr/include, but that is version 2. We want gmp version 4, which
+ * is installed in /usr/local/include, and is ensured to exist because
+ * it is required by the MLton package.
+ * On NetBSD, we want gmp to be installed into the pkg tree (which
+ * represents the FreeBSD ports tree). For now we use the same method
+ * as in the FreeBSD case, but we note that this should be changed so
+ * the makefile provides the correct -I flags to the compiler.
+ * On MacOS X, many users will use macports or fink to install gmp, in
+ * which case gmp.h will be installed in /opt/local/include or
+ * /sw/include, respectively.
*/
#include "gmp.h"
|
|
From: Vesa K. <ve...@ml...> - 2006-11-19 11:45:38
|
Added map, min, and max.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/basic/unstable/basic.mlb
U mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml
U mltonlib/trunk/com/ssh/basic/unstable/public/cmp.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/basic/unstable/basic.mlb
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/basic.mlb 2006-11-19 18:21:27 UTC (rev 4838)
+++ mltonlib/trunk/com/ssh/basic/unstable/basic.mlb 2006-11-19 19:45:33 UTC (rev 4839)
@@ -58,7 +58,7 @@
bas public/bin-pr.sig detail/bin-pr.sml end
end
basis Cmp = let
- open BinPr Order Sq
+ open BinOp BinPr Fn Order Sq
in
bas public/cmp.sig detail/cmp.sml end
end
Modified: mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml 2006-11-19 18:21:27 UTC (rev 4838)
+++ mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml 2006-11-19 19:45:33 UTC (rev 4839)
@@ -7,11 +7,17 @@
structure Cmp :> CMP = struct
type 'a t = 'a Sq.t -> Order.t
- fun mkRelOps cmp = let
+ fun map b2a = Fn.map (Sq.map b2a, Fn.id)
+
+ local
open Order
in
- {< = isLess o cmp, <= = not o isGreater o cmp,
- == = isEqual o cmp, != = not o isEqual o cmp,
- > = isGreater o cmp, >= = not o isLess o cmp}
+ fun mkRelOps cmp =
+ {< = isLess o cmp, <= = not o isGreater o cmp,
+ == = isEqual o cmp, != = not o isEqual o cmp,
+ > = isGreater o cmp, >= = not o isLess o cmp}
+
+ fun max cmp (x, y) = if isLess (cmp (x, y)) then y else x
+ fun min cmp (x, y) = if isGreater (cmp (x, y)) then y else x
end
end
Modified: mltonlib/trunk/com/ssh/basic/unstable/public/cmp.sig
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/public/cmp.sig 2006-11-19 18:21:27 UTC (rev 4838)
+++ mltonlib/trunk/com/ssh/basic/unstable/public/cmp.sig 2006-11-19 19:45:33 UTC (rev 4839)
@@ -4,13 +4,31 @@
* See the file MLton-LICENSE for details.
*)
-(** Utilities for dealing with compare functions. *)
+(** Utilities for dealing with compare functions or orderings. *)
signature CMP = sig
type 'a t = 'a Sq.t -> Order.t
- (** Type of compare functions (e.g. {Int.compare, String.compare, ...}). *)
+ (**
+ * Type of compare functions or orderings (e.g. {Int.compare,
+ * String.compare, ...}).
+ *)
+ val map : ('b -> 'a) -> 'a t -> 'b t
+ (** Changes the domain of an ordering. *)
+
val mkRelOps : 'a t -> {< : 'a BinPr.t, <= : 'a BinPr.t,
> : 'a BinPr.t, >= : 'a BinPr.t,
== : 'a BinPr.t, != : 'a BinPr.t}
- (** Returns a record of relational operators given a compare function. *)
+ (** Given an ordering, returns a record of relational operators. *)
+
+ val max : 'a t -> 'a BinOp.t
+ (**
+ * Given an ordering, returns a function that returns the greater of
+ * its arguments.
+ *)
+
+ val min : 'a t -> 'a BinOp.t
+ (**
+ * Given an ordering, returns a function that returns the lesser of its
+ * arguments.
+ *)
end
|