I use ghc version 9.4.2 and cabal version 3.8.1.0. I tried to open serial and get error.
ghci> ser <- openSerial "COM3" defaultSerialSettings
*** Exception: allocaBytesAligned: invalid argument (alignment (=20) must be a power of two!)
ghci>
As undestend from the cabal package folder, I use serialport version 0.5.1 and latest is 0.5.4, but this version have conflict with base package:
cabal install --lib serialport-0.5.4
Error: cabal: Could not resolve dependencies:
[__0] trying: serialport-0.5.4 (user goal)
[__1] next goal: base (dependency of serialport)
[__1] rejecting: base-4.17.0.0/installed-4.17.0.0 (conflict: serialport =>
base>=4.12 && <4.17)
[__1] skipping: base-4.17.0.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '>=4.12 && <4.17' from
'serialport')
[__1] rejecting: base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0,
base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0,
base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0,
base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0,
base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0,
base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1,
base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1
(constraint from non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: base, serialport)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, serialport
I don't know how installed 0.5.1 version of package by this cabal with this ghc version. I tried to delete installed package, but ghc-pkd dosen't see it:
C:\Users\phoenix\Downloads\serialport-0.5.4.tar\serialport-0.5.4>ghc-pkg list
C:\ghc\lib\package.conf.d
Cabal-3.8.1.0
Cabal-syntax-3.8.1.0
Win32-2.12.0.0
array-0.5.4.0
base-4.17.0.0
binary-0.8.9.1
bytestring-0.11.3.1
containers-0.6.6
deepseq-1.4.8.0
directory-1.3.7.1
exceptions-0.10.5
filepath-1.4.2.2
(ghc-9.4.2)
ghc-bignum-1.3
ghc-boot-9.4.2
ghc-boot-th-9.4.2
ghc-compact-0.1.0.0
ghc-heap-9.4.2
ghc-prim-0.9.0
ghci-9.4.2
haskeline-0.8.2
hpc-0.6.1.0
integer-gmp-1.1
libiserv-9.4.2
mtl-2.2.2
parsec-3.1.15.0
pretty-1.1.3.6
process-1.6.15.0
rts-1.0.2
stm-2.5.1.0
system-cxx-std-lib-1.0
template-haskell-2.19.0.0
text-2.0.1
time-1.12.2
transformers-0.5.6.2
xhtml-3000.2.2.1
I don't understand what's going on at all!
I installed ghc version 9.4.2 and cabal get lib serialport-0.5.4. The program did not work, but question was answered