[GHC] #13787: The compiler told me to report this. I have no idea what happened

GHC ghc-devs at haskell.org
Sun Jun 4 22:11:50 UTC 2017


#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.1
           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:
-------------------------------------+-------------------------------------
 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 :(

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13787>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list