Commit fc437556 authored by Kai-Oliver Prott's avatar Kai-Oliver Prott

Merge branch 'version3'

parents b8953ff3 716a4da5
......@@ -45,7 +45,7 @@ export PAKCSINSTALLDIR =
export CURRYSYSTEM=pakcs
# The major version number:
export MAJORVERSION=2
export MAJORVERSION=3
# The minor version number:
export MINORVERSION=2
# The revision version number:
......@@ -240,11 +240,6 @@ compilefrontend:
tools:
@if [ -r bin/pakcs ] ; then cd currytools && $(MAKE) ; fi
# compile analysis tool only:
.PHONY: CASS
CASS:
@if [ -r bin/pakcs ] ; then cd currytools && $(MAKE) CASS ; fi
# compile documentation if sources are available and it is not a
# separate package distribution:
.PHONY: manual
......
PAKCS: Release Notes
====================
Release notes for PAKCS Version 3.0.0 (November 8, 2019)
--------------------------------------------------------
Changes to version 2.1.2: bug fixes and
* Libraries `FilePath`, `Directory`, `Distribution`, `Time`,
`IOExts`, `ReadShowTerm` removed
(available in packages `filepath`, `directory`, `distribution`,
`time`, `io-extra` and `read-legacy` )
* Library `System` split into `System.Process`, `System.CPUTime`,
`System.Environment`.
`System.Process` is available in package `process`.
The rest remains in the library
* Implemented the "MonadFail-Proposal" for curry
(see <https://wiki.haskell.org/MonadFail_Proposal>)
* Implemented RankNTypes
Due to development issues the following changes
from version 2.1.0 and 2.1.2 are not in this release,
but will be added later:
* CPM updated (improved handling of temporary working directory)
* CPM updated (e.g., faster `update` operation)
* Prelude: `chr` defined as total operation
Release notes for PAKCS Version 2.2.0 (October 30, 2019)
--------------------------------------------------------
Changes to version 2.1.2: bug fixes and
* CPM updated (improved handling of temporary working directory)
* CPM updated (improved handling of temporary working directory)
Release notes for PAKCS Version 2.1.2 (September 23, 2019)
......
Subproject commit e7dd2a10a39ccd6b63db6e74388ef95b6dbf795e
Subproject commit 6e508561aeb514b59086834f0925d39caa99b7ad
# intermediate files
*~
*.bak
stack.yaml.lock
# binaries
bin/
# stack and cabal build files
.stack-work/
dist/
dist-newstyle/
cabal.project.local
.ghc.environment.*
......@@ -9,94 +9,29 @@ export BINDIR=$(ROOT)/bin
# The frontend binary
export CYMAKE = $(BINDIR)/curry-frontend
# GHC and CABAL configuration (for installing the front end)
# ----------------------------------------------------------
# The path to the Glasgow Haskell Compiler and Cabal
export GHC := $(shell which ghc)
export GHC-PKG := $(shell dirname "$(GHC)")/ghc-pkg
export CABAL = cabal
# Because of an API change in GHC 7.6,
# we need to distinguish GHC < 7.6 and GHC >= 7.6.
# GHC 7.6 renamed the option "package-conf" to "package-db".
# extract GHC version
ifdef GHC
GHC_MAJOR := $(shell "$(GHC)" --numeric-version | cut -d. -f1)
GHC_MINOR := $(shell "$(GHC)" --numeric-version | cut -d. -f2)
# Is the GHC version >= 7.6 ?
GHC_GEQ_76 = $(shell test $(GHC_MAJOR) -gt 7 -o \( $(GHC_MAJOR) -eq 7 \
-a $(GHC_MINOR) -ge 6 \) ; echo $$?)
# package-db (>= 7.6) or package-conf (< 7.6)?
ifeq ($(GHC_GEQ_76),0)
GHC_PKG_OPT = package-db
else
GHC_PKG_OPT = package-conf
endif
endif
# Command to unregister a package
export GHC_UNREGISTER = "$(GHC-PKG)" unregister --$(GHC_PKG_OPT)="$(PKGDB)"
# Command to install missing packages using cabal
export CABAL_INSTALL = "$(CABAL)" install --with-compiler="$(GHC)" \
--with-hc-pkg="$(GHC-PKG)" --prefix="$(LOCALPKG)" \
--global --package-db="$(PKGDB)" -O2
# Directory where local package installations are stored
export LOCALPKG = $(ROOT)/pkg
# The path to the package database
export PKGDB = $(LOCALPKG)/pakcs.conf.d
##############################################################################
# Retrieve all Haskell modules as dependencies for the front end:
DEPS := $(shell find curry-base/src/ curry-frontend/src/ -type f)
# install front end (if sources are present):
.PHONY: frontend
frontend:
ifdef GHC
$(MAKE) $(PKGDB)
$(MAKE) $(CYMAKE)
else
@echo "GHC missing, cannot build front end!"
@exit 1
endif
# create package database
$(PKGDB):
"$(GHC-PKG)" init $@
$(CABAL) update
# install the sources of the front end from its repository
$(CYMAKE): $(DEPS)
$(MAKE) unregister
mkdir -p $(@D)
cd curry-base && $(CABAL_INSTALL)
$(MAKE) transformers # see below
# Option --force-reinstalls necessary due to problems with package
# HTTP-*
cd curry-frontend && $(CABAL_INSTALL) --force-reinstalls --bindir=$(@D)
# Temporary workaround for https://github.com/haskell/cabal/issues/1855
# see also http://www.haskell.org/pipermail/cabal-devel/2014-May/009795.html
.PHONY: transformers
transformers:
$(CABAL_INSTALL) transformers-compat -f transformers3
# unregister previous version to avoid cabal install failures
.PHONY: unregister
unregister:
-$(GHC_UNREGISTER) curry-frontend
-$(GHC_UNREGISTER) curry-base
stack install --local-bin-path $(BINDIR) curry-frontend:curry-frontend
.PHONY: clean
clean:
cd curry-base && $(CABAL) clean
cd curry-frontend && $(CABAL) clean
stack clean
.PHONY: cleanall
cleanall:
cd curry-base && rm -rf dist/
cd curry-frontend && rm -rf dist/
rm -rf $(LOCALPKG)
stack clean --full
rm -f $(CYMAKE) && rm -rf bin
.PHONY: runtestsbase
runtestsbase:
stack test curry-base
.PHONY: runtestsfrontend
runtestsfrontend:
stack test curry-frontend
.PHONY: runtests
runtests:
$(MAKE) runtestsbase
$(MAKE) runtestsfrontend
packages:
curry-base
curry-frontend
Subproject commit 28c04fa53ddca60793ae94ae244b1758ef2a6dcc
Subproject commit 9413845e34fe9054867ee58d6ecef843d65b82c2
Subproject commit ebd9026bd6314472058079bbc8c7511cde9ca172
Subproject commit d12cd3df0cd0959b821affbc2f58a4f0a69cdbc7
resolver: lts-14.7
packages:
- curry-base
- curry-frontend
extra-deps:
- set-extra-1.4.1
Subproject commit 967e8359f51456f8a15fca659e9aadf3e8d2ea94
Subproject commit b77e7c0febc5cc3e96849f3df98e78aa3aa91cbe
......@@ -1241,9 +1241,9 @@ checkGlobalTypeForCorrectTypes(PredName,'FuncType'(T1,T2)) :-
checkGlobalTypeForCorrectTypes(PredName,T2).
checkGlobalTypeForCorrectTypes(PredName,'TCons'(TC,_)) :-
atom_codes(TCA,TC),
member(TCA,['Prelude.IO','IOExts.IORef','Dynamic.Dynamic','Ports.Port',
%'IO.Handle',
'Socket.Socket']),
member(TCA,['Prelude.IO','Data.IORef.IORef','Dynamic.Dynamic','Ports.Port',
%'System.IO.Handle',
'Network.Socket.Socket']),
!,
nlErr,
writeErr('ERROR: Type of global declaration "'),
......@@ -1316,8 +1316,8 @@ checkDynamicTypeForCorrectTypes(PredName,'FuncType'(T1,T2)) :-
checkDynamicTypeForCorrectTypes(PredName,T2).
checkDynamicTypeForCorrectTypes(PredName,'TCons'(TC,_)) :-
atom_codes(TCA,TC),
member(TCA,['IOExts.IORef','Dynamic.Dynamic','Ports.Port',%'IO.Handle',
'Socket.Socket']),
member(TCA,['Data.IORef.IORef','Dynamic.Dynamic','Ports.Port',%'System.IO.Handle',
'Network.Socket.Socket']),
!,
nlErr,
writeErr('ERROR: Type of dynamic predicate "'),
......
......@@ -316,7 +316,7 @@ failureIntOption(FTLen,FailSrc,112) :- !, % printdepth
readLine(PDLine),
removeBlanks(PDLine,PDL),
(codes2number(PDL,D)
-> retract(printDepth(_)),
-> retract(printDepth(_)),
(D=0 -> D1=D ; D1 is D+1),
asserta(printDepth(D1))
; write('Illegal print depth'), nl),
......@@ -330,7 +330,7 @@ failureIntOption(FTLen,FailSrc,C) :-
write('ERROR: wrong option!'), nl,
(C=10 -> true ; skip(10)),
failureInteraction(FTLen,FailSrc).
writeAllFailureList(Stream,_,[FName,Args]) :- !,
writeFailedCall(Stream,FName,Args).
writeAllFailureList(Stream,FTLen,[FCall|FailSrc]) :- !,
......@@ -371,7 +371,7 @@ tryWriteSuspGoal(_:G) :-
write('let '), writeCurry(Result), write(' = '),
writeCurry(FunCall), nl,
!.
tryWriteSuspGoal(_:G) :- !,
tryWriteSuspGoal(_:G) :- !,
writeCurry(G), nl.
tryWriteSuspGoal(G) :- write(G), nl.
......@@ -490,7 +490,7 @@ writeCurryD(S,D,Nested,'Prelude.apply'(F,X)) :- !,
writeCurryD(S,D1,nested,F), write(S,' '),
writeCurryD(S,D1,nested,X),
(Nested=nested -> write(S,')') ; true).
writeCurryD(S,D,Nested,'Prelude.if_then_else'(C,T,E)) :- !,
writeCurryD(S,D,Nested,'Prelude.ifThenElse'(C,T,E)) :- !,
D1 is D-1,
(Nested=nested -> write(S,'(') ; true),
write(S,'if '), writeCurryD(S,D1,top,C),
......@@ -694,4 +694,3 @@ instantiateAllBindings(N,[_|Bs]) :- instantiateAllBindings(N,Bs).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -24,7 +24,7 @@ prim_doesDirectoryExist(DirName,Exists) :-
string2Atom(DirName,Dir),
(existsDirectory(Dir) -> Exists='Prelude.True' ; Exists='Prelude.False').
prim_getModificationTime(FileName,'Time.CTime'(Time)) :-
prim_getModificationTime(FileName,'Data.Time.CTime'(Time)) :-
string2Atom(FileName,FName),
fileModTime(FName,Time).
......
......@@ -36,9 +36,9 @@ prim_openFile(A,Mode,Stream) :-
fileOpenOptions(Options),
open(FName,PMode,Stream,Options).
curryFileMode2plmode('IO.ReadMode',read).
curryFileMode2plmode('IO.WriteMode',write).
curryFileMode2plmode('IO.AppendMode',append).
curryFileMode2plmode('System.IO.ReadMode',read).
curryFileMode2plmode('System.IO.WriteMode',write).
curryFileMode2plmode('System.IO.AppendMode',append).
prim_hClose('$stream'('$inoutstream'(In,Out)),'Prelude.()') :- !,
......@@ -66,9 +66,9 @@ prim_hSeek(Handle,SeekMode,Pos,'Prelude.()') :-
currySeekMode2plmode(SeekMode,PlSM),
seek(Handle,Pos,PlSM,_).
currySeekMode2plmode('IO.AbsoluteSeek',bof).
currySeekMode2plmode('IO.RelativeSeek',current).
currySeekMode2plmode('IO.SeekFromEnd',eof).
currySeekMode2plmode('System.IO.AbsoluteSeek',bof).
currySeekMode2plmode('System.IO.RelativeSeek',current).
currySeekMode2plmode('System.IO.SeekFromEnd',eof).
?- block prim_hWaitForInput(?,?,?,-,?).
......
......@@ -46,10 +46,10 @@ prim_connectToCmd(CmdString,'$stream'('$inoutstream'(StdOut,StdIn))) :-
?- block prim_newIORef(?,?,-,?).
prim_newIORef(V,partcall(1,exec_newIORef,[V]),E,E).
?- block exec_newIORef(?,?,?,-,?).
exec_newIORef(Val,_,'$io'('IOExts.IORef'(share(MutVal))),E0,E) :-
exec_newIORef(Val,_,'$io'('Data.IORef.IORef'(share(MutVal))),E0,E) :-
var(Val), !,
create_mutable('$eval'(Val),MutVal), E0=E.
exec_newIORef(Val,_,'$io'('IOExts.IORef'(share(MutVal))),E0,E) :-
exec_newIORef(Val,_,'$io'('Data.IORef.IORef'(share(MutVal))),E0,E) :-
create_mutable(Val,MutVal), E0=E.
% When an IORef is read and its value is not evaluated, the current value
......@@ -62,7 +62,7 @@ exec_newIORef(Val,_,'$io'('IOExts.IORef'(share(MutVal))),E0,E) :-
prim_readIORef(R,partcall(1,exec_readIORef,[R]),E,E).
?- block exec_readIORef(?,?,?,-,?).
exec_readIORef(RIORef,_,'$io'(V),E0,E) :-
user:derefRoot(RIORef,'IOExts.IORef'(share(MutVal))),
user:derefRoot(RIORef,'Data.IORef.IORef'(share(MutVal))),
get_mutable(Val,MutVal),
(Val='$eval'(V) -> true
; create_mutable(Val,MutV),
......@@ -79,9 +79,8 @@ exec_writeIORef(RIORef,Val,_,R,E0,E) :-
user:derefRoot(RIORef,IORef),
prim_writeIORef_exec(IORef,Val,R), E0=E.
prim_writeIORef_exec('IOExts.IORef'(share(MutVal)),Val,'$io'('Prelude.()')) :-
prim_writeIORef_exec('Data.IORef.IORef'(share(MutVal)),Val,'$io'('Prelude.()')) :-
var(Val), !,
update_mutable('$eval'(Val),MutVal).
prim_writeIORef_exec('IOExts.IORef'(share(MutVal)),Val,'$io'('Prelude.()')) :-
prim_writeIORef_exec('Data.IORef.IORef'(share(MutVal)),Val,'$io'('Prelude.()')) :-
update_mutable(Val,MutVal).
......@@ -4,7 +4,8 @@
%
:- module(prim_system,
[prim_getCPUTime/1,prim_getElapsedTime/1,prim_getArgs/1,
prim_getEnviron/2,
prim_getEnviron/2, prim_getEnvironment/1,
prim_setEnviron/3, prim_unsetEnviron/2,
prim_getHostname/1,prim_getPID/1,prim_getProgName/1,
prim_system/2,prim_exitWith/2,prim_sleep/2,isWindows/1]).
......@@ -24,6 +25,25 @@ prim_getEnviron(Var,Value) :-
(getEnv(AtomVar,AtomValue) -> atom2String(AtomValue,Value)
; Value = []). % empty string if undefined
prim_getEnvironment(Result) :-
catch(findall((Var,Value), system:environ(Var, Value), Reslist), _, Reslist = []),
allAtom2String(Reslist,Result).
allAtom2String([],[]).
allAtom2String([X|Xs],[Y|Ys]) :- bothAtom2String(X,Y), allAtom2String(Xs, Ys).
bothAtom2String((X1,Y1),'Prelude.(,)'(X2,Y2)) :- basics:atom2String(X1,X2),
basics:atom2String(Y1,Y2).
prim_setEnviron(Var,Value,'Prelude.()') :-
string2Atom(Var,AtomVar),
string2Atom(Value,AtomValue),
catch(setEnv(AtomVar,AtomValue), _, prolog:set_system_property(AtomVar,AtomValue)).
prim_unsetEnviron(Var,'Prelude.()') :-
string2Atom(Var,AtomVar),
catch(unsetEnv(AtomVar), _, prim_setEnviron(Var,[],'Prelude.()')).
prim_getHostname(String) :-
getHostname(Name),
atom2String(Name,String).
......
......@@ -9,16 +9,16 @@
:- (current_module(prologbasics) -> true ; use_module('../prologbasics')).
prim_getClockTime('Time.CTime'(CTime)) :- currentClockTime(CTime).
prim_getClockTime('Data.Time.CTime'(CTime)) :- currentClockTime(CTime).
prim_toCalendarTime('Time.CTime'(ClockTime),
'Time.CalendarTime'(Year,Month,Day,Hour,Min,Sec,TZ)) :-
prim_toCalendarTime('Data.Time.CTime'(ClockTime),
'Data.Time.CalendarTime'(Year,Month,Day,Hour,Min,Sec,TZ)) :-
clocktime2localtime(ClockTime,Year,Month,Day,Hour,Min,Sec,TZ).
prim_toUTCTime('Time.CTime'(ClockTime),
'Time.CalendarTime'(Year,Month,Day,Hour,Min,Sec,0)) :-
prim_toUTCTime('Data.Time.CTime'(ClockTime),
'Data.Time.CalendarTime'(Year,Month,Day,Hour,Min,Sec,0)) :-
clocktime2utctime(ClockTime,Year,Month,Day,Hour,Min,Sec).
prim_toClockTime('Time.CalendarTime'(Year,Month,Day,Hour,Min,Sec,TZ),
'Time.CTime'(CTime)) :-
prim_toClockTime('Data.Time.CalendarTime'(Year,Month,Day,Hour,Min,Sec,TZ),
'Data.Time.CTime'(CTime)) :-
date2clocktime(Year,Month,Day,Hour,Min,Sec,TZ,CTime).
This directory contains various unit and property tests
for the Curry systems PAKCS and KiCS2.
To execute all tests, run "./test.sh" (or "./test.sh -v" too see some output).
To execute all tests, run "./test.sh" (or "./test.sh -v" to see some output).
The return status of this script is zero if all tests were succesfully
executed, otherwise it is different from zero.
......@@ -23,7 +23,7 @@ test_libs()
}
if [ -x "$CURRYBIN/pakcs" ] ; then
BACKEND=`$CURRYBIN/curry :set v0 :set -time :load Distribution :eval "putStrLn (curryRuntime ++ show curryRuntimeMajorVersion)" :quit 2> /dev/null`
BACKEND=`$CURRYBIN/curry :set v0 :set -time :load Language.Curry.Distribution :eval "putStrLn (curryRuntime ++ show curryRuntimeMajorVersion)" :quit 2> /dev/null`
# additional library tests for PAKCS with various Prolog back ends:
TESTPAKCSBACKEND=
case "$BACKEND" in
......
......@@ -6,11 +6,6 @@ which are currently only available for the PAKCS system.
Currently it contains:
Peval:
Directory containing a partial evaluator
(integrated in PAKCS by the command ":peval").
See the README there for more details.
emacs:
Emacs mode for editing Curry programs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment