Skip to content

Commit ff06318

Browse files
CapJitAddTypeSignature( "LazyArray", [ IsInt, IsFunction ], ... )
1 parent 9290d59 commit ff06318

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

CompilerForCAP/PackageInfo.g

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "CompilerForCAP",
1212
Subtitle := "Speed up computations in CAP categories",
13-
Version := "2022.09-03",
13+
Version := "2022.09-04",
1414
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1515
License := "GPL-2.0-or-later",
1616

CompilerForCAP/gap/InferDataTypes.gi

+45-2
Original file line numberDiff line numberDiff line change
@@ -919,10 +919,17 @@ CapJitAddTypeSignature( "ListWithIdenticalEntries", [ IsInt, IsObject ], functio
919919
end );
920920

921921
CapJitAddTypeSignature( "Concatenation", [ IsList ], function ( input_types )
922+
local filter;
922923

923-
Assert( 0, input_types[1].element_type.filter = IsList );
924+
if input_types[1].element_type.filter = IsList then
925+
filter := IsList;
926+
elif input_types[1].element_type.filter = IsLazyArray then
927+
filter := IsLazyArray;
928+
else
929+
Error( input_types[1].element_type.filter, " is not in [ IsList, IsLazyArray ]\n" );
930+
fi;
924931

925-
return rec( filter := IsList, element_type := input_types[1].element_type.element_type );
932+
return rec( filter := filter, element_type := input_types[1].element_type.element_type );
926933

927934
end );
928935

@@ -1101,6 +1108,42 @@ CapJitAddTypeSignature( "MatElm", [ IsList, IsInt, IsInt ], function ( input_typ
11011108

11021109
end );
11031110

1111+
CapJitAddTypeSignature( "LazyArray", [ IsInt, IsFunction ], function ( input_types )
1112+
1113+
return rec( filter := IsLazyArray, element_type := rec( filter := IsInt ) );
1114+
1115+
end );
1116+
1117+
CapJitAddTypeSignature( "LazyStandardInterval", [ IsInt ], function ( input_types )
1118+
1119+
return rec( filter := IsLazyArray, element_type := rec( filter := IsInt ) );
1120+
1121+
end );
1122+
1123+
CapJitAddTypeSignature( "LazyInterval", [ IsInt, IsInt ], function ( input_types )
1124+
1125+
return rec( filter := IsLazyInterval, element_type := rec( filter := IsInt ) );
1126+
1127+
end );
1128+
1129+
CapJitAddTypeSignature( "LazyConstantArray", [ IsInt, IsInt ], function ( input_types )
1130+
1131+
return rec( filter := IsLazyConstantArray, element_type := rec( filter := IsInt ) );
1132+
1133+
end );
1134+
1135+
CapJitAddTypeSignature( "LazyArrayFromList", [ IsList ], function ( input_types )
1136+
1137+
return rec( filter := IsLazyArrayFromList, element_type := rec( filter := IsInt ) );
1138+
1139+
end );
1140+
1141+
CapJitAddTypeSignature( "ListOfValues", [ IsLazyArray ], function ( input_types )
1142+
1143+
return rec( filter := IsList, element_type := rec( filter := IsInt ) );
1144+
1145+
end );
1146+
11041147
CapJitAddTypeSignature( "LazyHList", [ IsList, IsFunction ], function ( args, func_stack )
11051148

11061149
args := ShallowCopy( args );

0 commit comments

Comments
 (0)