This is an experimental.
Just get the windows binary.
http://ftp.gnu.org/gnu/emacs/windows/emacs-26/
@see : https://melpa.org/#/getting-started
Install lsp-mode and dap-mode from melpa.
[ESC-x] package-refresh-contents
[ESC-x] package-install lsp-mode
[ESC-x] package-install dap-mode
> stack new sample rio
>
> cd sample
> stack test
>
Install haskell-dap, ghci-dap, haskell-debug-adapter at once.
> stack install haskell-dap ghci-dap haskell-debug-adapter
>
sample/hdx4emacs.el
(require 'dap-mode)
(require 'dap-utils)
(dap-mode 1)
(dap-ui-mode 1)
(dap-tooltip-mode 1)
(tooltip-mode 1)
(setq debug-on-error t)
(dap-register-debug-provider
"hda"
(lambda (conf)
(plist-put conf :dap-server-path (list "haskell-debug-adapter" "--hackage-version=0.0.31.0"))
conf))
(dap-register-debug-template "haskell-debug-adapter"
(list :type "hda"
:request "launch"
:name "haskell-debug-adapter"
:internalConsoleOptions "openOnSessionStart"
;; :workspace (lsp-find-session-folder (lsp-session) (buffer-file-name))
:workspace "C:/work/haskell/sample"
:startup "C:/work/haskell/sample/app/Main.hs"
:startupFunc ""
:startupArgs ""
:stopOnEntry t
:mainArgs ""
:ghciPrompt "H>>= "
:ghciInitialPrompt "Prelude>"
:ghciCmd "stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show"
:ghciEnv (list :dummy "")
:logFile "C:/work/haskell/sample/hdx4emacs.log"
:logLevel "WARNING"
:forceInspect nil))
> cd sample
> emacs.exe --load .\hdx4emacs.el app\Main.hs
[ESC-x] dap-debug
haskell-debug-adapter
[ESC-x] dap-ui-locals
[ESC-x] dap-next
[ESC-x] dap-continue