Commit 40806a95 authored by Mart Lubbers's avatar Mart Lubbers
Browse files

add binumap patch to StdGeneric for iTasks builds

parent ae993581
Pipeline #21391 failed with stage
in 1 minute and 46 seconds
......@@ -127,6 +127,9 @@ build_stdenv() { # $1:target
cp src/clean-libraries-trunk/Libraries/StdEnv/StdString.dcl $1/lib/StdEnv/
cp src/clean-libraries-trunk/Libraries/StdEnv/StdEnv\ 64\ Changed\ Files/StdString.icl $1/lib/StdEnv/
patch $1/lib/StdEnv/StdGeneric.icl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.icl.patch
patch $1/lib/StdEnv/StdGeneric.dcl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.dcl.patch
echo first compile of system modules
for a in StdChar; # compile twice for inlining
do $CLEAN_HOME/lib/exe/cocl -ou -pm -pt -P $1/lib/StdEnv $a ;
......
--- StdGeneric.dcl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.dcl 2018-12-17 11:06:09.196234236 +0100
@@ -64,6 +64,16 @@
derive bimap FIELD
derive bimap (->)
+generic binumap a b | binumap b a :: a -> b
+derive binumap c
+derive binumap PAIR
+derive binumap EITHER
+derive binumap OBJECT
+derive binumap CONS
+derive binumap RECORD
+derive binumap FIELD
+derive binumap (->)
+
// HACK: dictionaries for all generics.
// It works since all generic classes have only one method and do not inherit
// from other classes
--- StdGeneric.icl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.icl 2018-12-17 11:06:09.196234236 +0100
@@ -21,6 +21,23 @@
bimap{|(->)|} _ ba fr _ f = comp3 fr f ba
+binumap{|c|} x = x
+
+binumap{|PAIR|} fx _ fy _ (PAIR x y) = PAIR (fx x) (fy y)
+
+binumap{|EITHER|} fl _ fr _ (LEFT x) = LEFT (fl x)
+binumap{|EITHER|} fl _ fr _ (RIGHT x) = RIGHT (fr x)
+
+binumap{|CONS|} fx _ (CONS x) = CONS (fx x)
+
+binumap{|RECORD|} fx _ (RECORD x) = RECORD (fx x)
+
+binumap{|FIELD|} fx _ (FIELD x) = FIELD (fx x)
+
+binumap{|OBJECT|} fx _ (OBJECT x) = OBJECT (fx x)
+
+binumap{|(->)|} _ ba fr _ f = comp3 fr f ba
+
comp3 :: !(.a -> .b) u:(.c -> .a) !(.d -> .c) -> u:(.d -> .b)
comp3 f g h
| is_id f
......@@ -121,6 +121,9 @@ build_stdenv() { # $1:target
cp src/clean-libraries-trunk/Libraries/StdEnv/StdString.dcl $1/lib/StdEnv/
cp src/clean-libraries-trunk/Libraries/StdEnv/StdEnv\ 64\ Changed\ Files/StdString.icl $1/lib/StdEnv/
patch $1/lib/StdEnv/StdGeneric.icl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.icl.patch
patch $1/lib/StdEnv/StdGeneric.dcl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.dcl.patch
echo first compile of system modules
for a in StdChar; # compile twice for inlining
do $CLEAN_HOME/lib/exe/cocl -ou -pm -pt -P $1/lib/StdEnv $a ;
......@@ -130,6 +133,7 @@ build_stdenv() { # $1:target
for a in StdMisc StdBool StdInt StdChar StdFile StdReal StdString;
do $CLEAN_HOME/lib/exe/cocl -ou -pm -pt -P $1/lib/StdEnv $a ;
done
}
build_argenv() { # $1:target
......
--- StdGeneric.dcl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.dcl 2018-12-17 11:06:09.196234236 +0100
@@ -64,6 +64,16 @@
derive bimap FIELD
derive bimap (->)
+generic binumap a b | binumap b a :: a -> b
+derive binumap c
+derive binumap PAIR
+derive binumap EITHER
+derive binumap OBJECT
+derive binumap CONS
+derive binumap RECORD
+derive binumap FIELD
+derive binumap (->)
+
// HACK: dictionaries for all generics.
// It works since all generic classes have only one method and do not inherit
// from other classes
--- StdGeneric.icl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.icl 2018-12-17 11:06:09.196234236 +0100
@@ -21,6 +21,23 @@
bimap{|(->)|} _ ba fr _ f = comp3 fr f ba
+binumap{|c|} x = x
+
+binumap{|PAIR|} fx _ fy _ (PAIR x y) = PAIR (fx x) (fy y)
+
+binumap{|EITHER|} fl _ fr _ (LEFT x) = LEFT (fl x)
+binumap{|EITHER|} fl _ fr _ (RIGHT x) = RIGHT (fr x)
+
+binumap{|CONS|} fx _ (CONS x) = CONS (fx x)
+
+binumap{|RECORD|} fx _ (RECORD x) = RECORD (fx x)
+
+binumap{|FIELD|} fx _ (FIELD x) = FIELD (fx x)
+
+binumap{|OBJECT|} fx _ (OBJECT x) = OBJECT (fx x)
+
+binumap{|(->)|} _ ba fr _ f = comp3 fr f ba
+
comp3 :: !(.a -> .b) u:(.c -> .a) !(.d -> .c) -> u:(.d -> .b)
comp3 f g h
| is_id f
......@@ -251,6 +251,9 @@ build_stdenv() { # $1:target $2: clean system
cp src/clean-libraries-trunk/Libraries/StdEnv/StdEnv\ 64\ Changed\ Files/StdString.icl $1/Libraries/StdEnv/StdString.icl
cp src/clean-libraries-trunk/Libraries/StdEnv/StdEnv\ 64\ Changed\ Files/StdFile.icl $1/Libraries/StdEnv/StdFile.icl
patch $1/lib/StdEnv/StdGeneric.icl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.icl.patch
patch $1/lib/StdEnv/StdGeneric.dcl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.dcl.patch
STDENV_SYSTEM_MODULES="StdBool StdChar StdFile StdInt StdMisc StdReal StdString"
for stdenv_build_m in $STDENV_SYSTEM_MODULES; do
"$2/Tools/Clean System 64/CleanCompiler64.exe" -ou -pm -pt -P "$1/Libraries/StdEnv/$stdenv_build_m" -dynamic;
......@@ -258,6 +261,7 @@ build_stdenv() { # $1:target $2: clean system
for stdenv_build_m in $STDENV_SYSTEM_MODULES; do
"$2/Tools/Clean System 64/CleanCompiler64.exe" -ou -pm -pt -P "$1/Libraries/StdEnv/$stdenv_build_m";
done
}
build_argenv() { # $1:target
......
--- StdGeneric.dcl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.dcl 2018-12-17 11:06:09.196234236 +0100
@@ -64,6 +64,16 @@
derive bimap FIELD
derive bimap (->)
+generic binumap a b | binumap b a :: a -> b
+derive binumap c
+derive binumap PAIR
+derive binumap EITHER
+derive binumap OBJECT
+derive binumap CONS
+derive binumap RECORD
+derive binumap FIELD
+derive binumap (->)
+
// HACK: dictionaries for all generics.
// It works since all generic classes have only one method and do not inherit
// from other classes
--- StdGeneric.icl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.icl 2018-12-17 11:06:09.196234236 +0100
@@ -21,6 +21,23 @@
bimap{|(->)|} _ ba fr _ f = comp3 fr f ba
+binumap{|c|} x = x
+
+binumap{|PAIR|} fx _ fy _ (PAIR x y) = PAIR (fx x) (fy y)
+
+binumap{|EITHER|} fl _ fr _ (LEFT x) = LEFT (fl x)
+binumap{|EITHER|} fl _ fr _ (RIGHT x) = RIGHT (fr x)
+
+binumap{|CONS|} fx _ (CONS x) = CONS (fx x)
+
+binumap{|RECORD|} fx _ (RECORD x) = RECORD (fx x)
+
+binumap{|FIELD|} fx _ (FIELD x) = FIELD (fx x)
+
+binumap{|OBJECT|} fx _ (OBJECT x) = OBJECT (fx x)
+
+binumap{|(->)|} _ ba fr _ f = comp3 fr f ba
+
comp3 :: !(.a -> .b) u:(.c -> .a) !(.d -> .c) -> u:(.d -> .b)
comp3 f g h
| is_id f
......@@ -223,6 +223,9 @@ build_stdenv() { # $1:target $2: clean system
do cp src/clean-libraries-trunk/Libraries/StdEnv/$a.[di]cl $1/Libraries/StdEnv/ ;
done
patch $1/lib/StdEnv/StdGeneric.icl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.icl.patch
patch $1/lib/StdEnv/StdGeneric.dcl < $PACKAGE/$OS-$ARCH/txt/StdGeneric.dcl.patch
STDENV_SYSTEM_MODULES="StdBool StdChar StdFile StdInt StdMisc StdReal StdString"
for stdenv_build_m in $STDENV_SYSTEM_MODULES; do
"$2/Tools/Clean System/CleanCompiler.exe" -ou -pm -pt -P "$1/Libraries/StdEnv/$stdenv_build_m" -dynamic;
......
--- StdGeneric.dcl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.dcl 2018-12-17 11:06:09.196234236 +0100
@@ -64,6 +64,16 @@
derive bimap FIELD
derive bimap (->)
+generic binumap a b | binumap b a :: a -> b
+derive binumap c
+derive binumap PAIR
+derive binumap EITHER
+derive binumap OBJECT
+derive binumap CONS
+derive binumap RECORD
+derive binumap FIELD
+derive binumap (->)
+
// HACK: dictionaries for all generics.
// It works since all generic classes have only one method and do not inherit
// from other classes
--- StdGeneric.icl 2018-12-17 02:43:55.000000000 +0100
+++ StdGeneric.icl 2018-12-17 11:06:09.196234236 +0100
@@ -21,6 +21,23 @@
bimap{|(->)|} _ ba fr _ f = comp3 fr f ba
+binumap{|c|} x = x
+
+binumap{|PAIR|} fx _ fy _ (PAIR x y) = PAIR (fx x) (fy y)
+
+binumap{|EITHER|} fl _ fr _ (LEFT x) = LEFT (fl x)
+binumap{|EITHER|} fl _ fr _ (RIGHT x) = RIGHT (fr x)
+
+binumap{|CONS|} fx _ (CONS x) = CONS (fx x)
+
+binumap{|RECORD|} fx _ (RECORD x) = RECORD (fx x)
+
+binumap{|FIELD|} fx _ (FIELD x) = FIELD (fx x)
+
+binumap{|OBJECT|} fx _ (OBJECT x) = OBJECT (fx x)
+
+binumap{|(->)|} _ ba fr _ f = comp3 fr f ba
+
comp3 :: !(.a -> .b) u:(.c -> .a) !(.d -> .c) -> u:(.d -> .b)
comp3 f g h
| is_id f
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