You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pull request was not created — a fallback review issue was created instead due to protected file changes: #366
🤖 This is an automated response from Repo Assist.
I investigated this issue. The FSIPrinters.matrix function is defined in FSIPrinters.fs and looks correct — it takes a Matrix<_> and returns a formatted string. However, fsi.AddPrinter can fail silently when the type being matched comes from a transitive dependency (FsMath.Matrix<float> in this case) rather than being directly defined in the loaded assembly.
Root cause hypothesis: Matrix<float> in FSharp.Stats is provided by the FsMath package. fsi.AddPrinter uses .NET runtime type matching, and there can be edge cases where type identity checks fail when aliases or re-exported types are involved, especially across assembly boundaries.
Workarounds:
Call the formatter directly: printfn "%s" (FSIPrinters.matrix myMatrix)
For .NET Interactive / Jupyter notebooks, the modern solution is the separate FSharp.Stats.Interactive NuGet package, which registers HTML formatters via IMatrixFormattable.
Potential fix: Register the printer using the concrete float type explicitly, or ensure FSharp.Stats exposes a proper [<AutoOpen>] module that calls fsi.AddPrinter on load when running in FSI context (similar to how some libraries use #if INTERACTIVE blocks).
Is this issue still reproducible with the current version? If so, a focused fix in FSIPrinters.fs or a one-liner #load script for users would be straightforward.
Activity
github-actions commentedon Apr 3, 2026
Note
The pull request was not created — a fallback review issue was created instead due to protected file changes: #366
🤖 This is an automated response from Repo Assist.
I investigated this issue. The
FSIPrinters.matrixfunction is defined inFSIPrinters.fsand looks correct — it takes aMatrix<_>and returns a formattedstring. However,fsi.AddPrintercan fail silently when the type being matched comes from a transitive dependency (FsMath.Matrix<float>in this case) rather than being directly defined in the loaded assembly.Root cause hypothesis:
Matrix<float>in FSharp.Stats is provided by theFsMathpackage.fsi.AddPrinteruses.NETruntime type matching, and there can be edge cases where type identity checks fail when aliases or re-exported types are involved, especially across assembly boundaries.Workarounds:
printfn "%s" (FSIPrinters.matrix myMatrix).NET Interactive/ Jupyter notebooks, the modern solution is the separateFSharp.Stats.InteractiveNuGet package, which registers HTML formatters viaIMatrixFormattable.Potential fix: Register the printer using the concrete
floattype explicitly, or ensureFSharp.Statsexposes a proper[<AutoOpen>]module that callsfsi.AddPrinteron load when running in FSI context (similar to how some libraries use#if INTERACTIVEblocks).Is this issue still reproducible with the current version? If so, a focused fix in
FSIPrinters.fsor a one-liner#loadscript for users would be straightforward.