Skip to content

Commit 5b88c3a

Browse files
authored
Merge pull request #1011 from mohamed-barakat/LazyArrays
CapJitAddTypeSignature( "LazyHList", [ IsList, IsFunction ], ... )
2 parents df5b52c + 0071999 commit 5b88c3a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CompilerForCAP/PackageInfo.g

Lines changed: 2 additions & 1 deletion
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-01",
13+
Version := "2022.09-02",
1414
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1515
License := "GPL-2.0-or-later",
1616

@@ -69,6 +69,7 @@ PackageDoc := rec(
6969
Dependencies := rec(
7070
GAP := ">= 4.11.1",
7171
NeededOtherPackages := [
72+
[ "ToolsForHomalg", ">= 2022.09-04" ],
7273
[ "CAP", ">= 2022.08-01" ],
7374
],
7475
SuggestedOtherPackages := [ ],

CompilerForCAP/gap/InferDataTypes.gi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,23 @@ CapJitAddTypeSignature( "MatElm", [ IsList, IsInt, IsInt ], function ( input_typ
11001100

11011101
end );
11021102

1103+
CapJitAddTypeSignature( "LazyHList", [ IsList, IsFunction ], function ( args, func_stack )
1104+
1105+
args := ShallowCopy( args );
1106+
1107+
args.2 := CAP_JIT_INTERNAL_INFERRED_DATA_TYPES_OF_FUNCTION_BY_ARGUMENTS_TYPES( args.2, [ args.1.data_type.element_type ], func_stack );
1108+
1109+
if args.2 = fail then
1110+
1111+
#Error( "could not determine output type" );
1112+
return fail;
1113+
1114+
fi;
1115+
1116+
return rec( args := args, output_type := rec( filter := IsList, element_type := args.2.data_type.signature[2] ) );
1117+
1118+
end );
1119+
11031120
CapJitAddTypeSignature( "List", [ IsList, IsFunction ], function ( args, func_stack )
11041121

11051122
args := ShallowCopy( args );

0 commit comments

Comments
 (0)