Skip to content

Commit a23616e

Browse files
CapJitAddTypeSignature( "LazyArray", [ IsInt, IsFunction ], ... )
1 parent 5b88c3a commit a23616e

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-02",
13+
Version := "2022.09-03",
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
@@ -918,10 +918,17 @@ CapJitAddTypeSignature( "ListWithIdenticalEntries", [ IsInt, IsObject ], functio
918918
end );
919919

920920
CapJitAddTypeSignature( "Concatenation", [ IsList ], function ( input_types )
921+
local filter;
921922

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

924-
return rec( filter := IsList, element_type := input_types[1].element_type.element_type );
931+
return rec( filter := filter, element_type := input_types[1].element_type.element_type );
925932

926933
end );
927934

@@ -1100,6 +1107,42 @@ CapJitAddTypeSignature( "MatElm", [ IsList, IsInt, IsInt ], function ( input_typ
11001107

11011108
end );
11021109

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

11051148
args := ShallowCopy( args );

0 commit comments

Comments
 (0)