I am trying to run a few basic Haskell snippets on a windows 10 machine with GHC Version 8.2.2 via Stack tool. I get the following access violation error:
e:\reset\as>stack runghc a.hs
stack runghc a.hs
Access violation in generated code when executing data at ffffffffac0039e0
the contents of "a.hs" are:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
import Yesod
data HelloWorld = HelloWorld
mkYesod "HelloWorld" [parseRoutes|
/ HomeR GET
|]
instance Yesod HelloWorld
getHomeR :: Handler Html
getHomeR = defaultLayout [whamlet|Hello World!|]
main :: IO()
main = warp 3000 HelloWorld
I was able to get a few results in return to my google-fu, but I don't think there is a proper solution for this version of ghci:
temporary solution: Haskell-Stack: Access violation error during build
violation on GHC 8.0.2: https://github.com/hedgehogqa/haskell-hedgehog/issues/111
works while compiling to dll: Access violation in GHCI
Is there an explanation for why this error occurs, and how I can avoid it?
Edit: @epsilonhable asked if compiling works; I tried it, it compiles and runs with no issues.
e:\dir\reset\as>stack ghc a.hs
stack ghc a.hs
[1 of 1] Compiling Main ( a.hs, a.o )
Linking a.exe ...
e:\HiHenry\reset\as>
e:\HiHenry\reset\as>a.exe
a.exe
01/Feb/2018:15:59:07 +0530 [Info#yesod-core] Application launched @(yesod-core-1.4.37.3-JVciWQSLH8J1mylGVdkmic:Yesod.Core.Dispatch .\Yesod\Core\Dispatch.hs:166:11)
127.0.0.1 - - [01/Feb/2018:15:59:50 +0530] "GET / HTTP/1.1" 200 82 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
127.0.0.1 - - [01/Feb/2018:15:59:50 +0530] "GET /favicon.ico HTTP/1.1" 404 118 "http://127.0.0.1:3001/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
Running it via interpreter(stack runghc a.hs) still results in an access violation.