Better error for unsupported vector operations
GHCi does not support vector operations.
This error message is fine:
ghci> :set -XMagicHash -XUnboxedTuples
ghci> :m GHC.Exts
ghci> x = unpackDoubleX2#
sorry! (unimplemented feature or known bug)
GHC version 9.5.20221206:
SIMD vector operations are not available in GHCi
But those two could be improved:
ghci> x = packDoubleX2#
ghc: ^^ Could not load 'ghczmprim_GHCziPrimopWrappers_packDoubleX2zh_closure', dependency unresolved. See top entry above.
GHC.ByteCode.Linker.lookupCE(primop)
During interactive linking, GHCi couldn't find the following symbol:
ghczmprim_GHCziPrimopWrappers_packDoubleX2zh_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please report this as a GHC bug:
https://www.haskell.org/ghc/reportabug
ghci> f :: DoubleX2# -> DoubleX2#; f x = x
*** Exception: return_unlifted: vector
CallStack (from HasCallStack):
error, called at compiler/GHC/ByteCode/Asm.hs:532:23 in ghc:GHC.ByteCode.Asm