Ticket #65 (closed bug report: fixed)

Opened 5 years ago

Last modified 5 years ago

exactPrint makes strange things with class and instance declarations

Reported by: nibro Owned by: nibro
Priority: major Milestone: Blue Sky
Component: exactprinter Version: 1.1.4
Keywords: Cc:

Description (last modified by nibro) (diff)

class Dir d where
  localDir :: d -> IO FilePath

instance Dir Directory where
  localDir (Local f) = return f

  localDir (Darcs {url=url,darcsVersion=Patch patch,subDirectory=subDir}) = do 
    tmp <- createTempDir 0 "haskelld"
    darcsOut <- runDarcsCommand tmp "get" ["--lazy","--to-match","hash "++ patch,url,"fs"]
    print darcsOut
    let (ExitSuccess,"",out) = darcsOut 
    print out
    return $ tmp </> "fs" </> subDir

type URL = String

becomes

class Dir dwhere{
  localDir :: d -> IO FilePath

instance Dir Directory where
  localDir (Local f) = return f

  localDir (Darcs {url=url,darcsVersion=Patch patch,subDirectory=subDir}) = do
    tmp <- createTempDir 0 "haskelld"
    darcsOut <- runDarcsCommand tmp "get" ["--lazy","--to-match","hash "++ patch,url,"fs"]
    print darcsOut
    let (ExitSuccess,"",out) = darcsOut
    print out
    return $ tmp </> "fs" </> subDir

  typeURL= String

Change History

Changed 5 years ago by nibro

[[[ class Dir d where

localDir
d -> IO FilePath?

instance Dir Directory where

localDir (Local f) = return f

localDir (Darcs {url=url,darcsVersion=Patch patch,subDirectory=subDir}) = do

tmp <- createTempDir 0 "haskelld" darcsOut <- runDarcsCommand tmp "get" ["--lazy","--to-match","hash "++ patch,url,"fs"] print darcsOut let (ExitSuccess?,"",out) = darcsOut print out return $ tmp </> "fs" </> subDir

type URL = String ]]]

becomes

[[[ class Dir dwhere{

localDir
d -> IO FilePath?

instance Dir Directory where

localDir (Local f) = return f

localDir (Darcs {url=url,darcsVersion=Patch patch,subDirectory=subDir}) = do

tmp <- createTempDir 0 "haskelld" darcsOut <- runDarcsCommand tmp "get" ["--lazy","--to-match","hash "++ patch,url,"fs"] print darcsOut let (ExitSuccess?,"",out) = darcsOut print out return $ tmp </> "fs" </> subDir

typeURL= String

Changed 5 years ago by nibro

  • description modified (diff)

Changed 5 years ago by nibro

  • status changed from new to closed
  • resolution set to fixed

Turns out this was a problem with the way function bindings are handled. I already had the fix for function bindings in Decls, but I hadn't thought to apply the same trick to ClassDecls? and InstDecls?. Fixed now, case closed.

Note: See TracTickets for help on using tickets.