ku-fpg / haskino

Our Arduino experiments
BSD 3-Clause "New" or "Revised" License
72 stars 4 forks source link

ghc panic #5

Open wchresta opened 6 years ago

wchresta commented 6 years ago

Using the ShallowDeepPlugin leads to a ghc panic:

https://ghc.haskell.org/trac/ghc/ticket/15280#comment:1

wchresta commented 6 years ago

The problem seems to be, that there is a local bind to lcd when the function is also called lcd. Renaming the function to lcdProgram gets rid of the ghc panic.

lcdProgram :: Arduino ()                                                                                         
lcdProgram = do                                                                                                  
    lcd <- lcdRegister lcdController                                                                             
    let display :: B.ByteString -> Arduino ()                                                                    
        display s = lcdWrite lcd (B.unpack s :: [Word8])                                                         
    loop $ do                                                                                                    
        lcdClear lcd                                                                                             
        lcdHome lcd                                                                                                    
wchresta commented 6 years ago

Also, using the fixed code, I get the following (with either active or deactivated ShallowDeepPlugin):

stack exec lcdProgram
lcdProgram: compileCommand - Unknown command, it may actually be a procedure
CallStack (from HasCallStack):
  error, called at ./System/Hardware/Haskino/Compiler.hs:401:20 in haskino-0.6-48Ib5C2ddqUKvTQPcysKID:System.Hardware.Haskino.Compiler