
#13787: The compiler told me to report this. I have no idea what happened -------------------------------------+------------------------------------- Reporter: gleb_dianov | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by gleb_dianov: @@ -37,0 +37,4 @@ + + UPD. + I updated to lts-8.16. Then I commented out the function and compiled the + project and when I uncommented it the compiler didn't crash New description: Hi, Here is the error: ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-unknown-linux): initTc: unsolved constraints WC {wc_insol = [W] err_aaeS :: t_aaeR[tau:1] (CHoleCan: err)} {{{#!hs teach :: l ~ S l' => ErrorFunction m -> ErrorFunction o -> LearningRate -> Vector (Example i o) m -> Network i l o -> Either StopCriteria (Either Error Iterations) -> NetowrkArgs i l o -> NetworkArgs i l o teach totalErr errF learnRate examples stopCriteria network args = teachNetwork network 0 where teachNetwork :: Network i l o -> Iterations -> Network i l o teachNetwork net i | not $ shouldStop stopCriteria (networkError net) i = teachNetwork (foldl updateNetworkHelper net examples) (i + 1) | otherwise = net networkError :: Network i l o -> Error networkError = undefined updateNetworkHelper :: Network i l o -> Example i o -> Network i l o updateNetworkHelper net@(layer :~~ netTail) example = if example ^. output == runNetwork net (examples ^. input) then net else snd $ updateNetwork layer netTail errF (example ^. inputs) (example ^. outputs) }}} This function broke the compiler. Here is a link to the git repo with this code (module Network) https://gitlab.com/gleb_dianov/neural-haskell With this project I wanted to show how cool Haskell is, but now I can only show how GHC crashes :( UPD. I updated to lts-8.16. Then I commented out the function and compiled the project and when I uncommented it the compiler didn't crash -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13787#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler