1. 20 Apr, 2009 1 commit
    • Simon Marlow's avatar
      FIX #2845: Allow breakpoints on expressions with unlifted type · 709c9ce0
      Simon Marlow authored
      It turns out we can easily support breakpoints on expressions with
      unlifted types, by translating 
      
        case tick# of _ -> e
      
      into
      
        let f = \s . case tick# of _ -> e 
        in  f realWorld#
      
      instead of just a plain let-binding.  This is the same trick that GHC
      uses for abstracting join points of unlifted type.
      
      In #2845, GHC has eta-expanded the tick expression, changing the
      result type from IO a to (# State#, a #), which was the reason the
      tick was suddenly being ignored.  By supporting ticks on unlifted
      expressions we can make it work again, although some confusion might
      arise because _result will no longer be available (it now has
      unboxed-tuple type, so we can't bind it in the environment).  The
      underlying problem here is that GHC does transformations like
      eta-expanding the tick expressions, and there's nothing we can do to
      prevent that.
      709c9ce0
  2. 22 Feb, 2009 1 commit
  3. 27 Jan, 2009 1 commit
  4. 03 Jan, 2009 1 commit
  5. 02 Jan, 2009 1 commit
    • simonpj@microsoft.com's avatar
      Make record selectors into ordinary functions · 9ffadf21
      simonpj@microsoft.com authored
      This biggish patch addresses Trac #2670.  The main effect is to make
      record selectors into ordinary functions, whose unfoldings appear in
      interface files, in contrast to their previous existence as magic
      "implicit Ids".  This means that the usual machinery of optimisation,
      analysis, and inlining applies to them, which was failing before when
      the selector was somewhat complicated.  (Which it can be when
      strictness annotations, unboxing annotations, and GADTs are involved.)
      
      The change involves the following points
      
      * Changes in Var.lhs to the representation of Var.  Now a LocalId can
        have an IdDetails as well as a GlobalId.  In particular, the
        information that an Id is a record selector is kept in the
        IdDetails.  While compiling the current module, the record selector
        *must* be a LocalId, so that it participates properly in compilation
        (free variables etc).
      
        This led me to change the (hidden) representation of Var, so that there
        is now only one constructor for Id, not two.
      
      * The IdDetails is persisted into interface files, so that an
        importing module can see which Ids are records selectors.
      
      * In TcTyClDecls, we generate the record-selector bindings in renamed,
        but not typechecked form.  In this way, we can get the typechecker
        to add all the types and so on, which is jolly helpful especially
        when GADTs or type families are involved.  Just like derived
        instance declarations.
      
        This is the big new chunk of 180 lines of code (much of which is
        commentary).  A call to the same function, mkAuxBinds, is needed in
        TcInstDcls for associated types.
      
      * The typechecker therefore has to pin the correct IdDetails on to 
        the record selector, when it typechecks it.  There was a neat way
        to do this, by adding a new sort of signature to HsBinds.Sig, namely
        IdSig.  This contains an Id (with the correct Name, Type, and IdDetails);
        the type checker uses it as the binder for the final binding.  This
        worked out rather easily.
      
      * Record selectors are no longer "implicit ids", which entails changes to
           IfaceSyn.ifaceDeclSubBndrs
           HscTypes.implicitTyThings
           TidyPgm.getImplicitBinds
        (These three functions must agree.)
      
      * MkId.mkRecordSelectorId is deleted entirely, some 300+ lines (incl
        comments) of very error prone code.  Happy days.
      
      * A TyCon no longer contains the list of record selectors: 
        algTcSelIds is gone
      
      The renamer is unaffected, including the way that import and export of
      record selectors is handled.
      
      Other small things
      
      * IfaceSyn.ifaceDeclSubBndrs had a fragile test for whether a data
        constructor had a wrapper.  I've replaced that with an explicit flag
        in the interface file. More robust I hope.
      
      * I renamed isIdVar to isId, which touched a few otherwise-unrelated files.
      
      9ffadf21
  6. 03 Oct, 2008 1 commit
    • Ian Lynagh's avatar
      Use an extensible-exceptions package when bootstrapping · 1f3a7730
      Ian Lynagh authored
      Ifdefs for whether we had extensible exceptions or not were spreading
      through GHC's source, and things would only have got worse for the next
      2-3 years, so instead we now use an implementation of extensible
      exceptions built on top of the old exception type.
      1f3a7730
  7. 18 Sep, 2008 1 commit
    • pepe's avatar
      Fix a couple of issues with :print · decbb181
      pepe authored
            
            - Ticket #1995: Unsoundness with newtypes
            - Ticket #2475: "Can't unify" error when stopped at an exception
            
            In addition this patch adds the following:
            
            - Unfailingness: RTTI cannot panic anymore. 
              In case of failure, it recovers gracefully by returning the "I know nothing" type
            - A -ddump-rtti flag
      decbb181
  8. 14 Sep, 2008 1 commit
  9. 31 Jul, 2008 3 commits
  10. 30 Jul, 2008 1 commit
  11. 20 Jul, 2008 1 commit
  12. 22 Apr, 2008 1 commit
  13. 12 Apr, 2008 1 commit
  14. 21 Apr, 2008 1 commit
  15. 25 Mar, 2008 1 commit
  16. 16 Mar, 2008 1 commit
  17. 07 Feb, 2008 1 commit
    • Ian Lynagh's avatar
      Convert more UniqFM's back to LazyUniqFM's · d51f42f6
      Ian Lynagh authored
      These fix these failures:
         break008(ghci)
         break009(ghci)
         break026(ghci)
         ghci.prog009(ghci)
         ghci025(ghci)
         print007(ghci)
         prog001(ghci)
         prog002(ghci)
         prog003(ghci)
      at least some of which have this symptom:
          Exception: expectJust prune
      d51f42f6
  18. 02 Dec, 2007 1 commit
  19. 04 Dec, 2007 1 commit
  20. 13 Nov, 2007 1 commit
  21. 10 Oct, 2007 2 commits
    • Dan Licata's avatar
      View patterns, record wildcards, and record puns · 6a05ec5e
      Dan Licata authored
      This patch implements three new features:
      * view patterns (syntax: expression -> pat in a pattern)
      * working versions of record wildcards and record puns
      See the manual for detailed descriptions.
      
      Other minor observable changes:
      * There is a check prohibiting local fixity declarations
        when the variable being fixed is not defined in the same let
      * The warn-unused-binds option now reports warnings for do and mdo stmts
      
      Implementation notes: 
      
      * The pattern renamer is now in its own module, RnPat, and the
      implementation is now in a CPS style so that the correct context is
      delivered to pattern expressions.
      
      * These features required a fairly major upheaval to the renamer.
      Whereas the old version used to collect up all the bindings from a let
      (or top-level, or recursive do statement, ...) and put them into scope
      before renaming anything, the new version does the collection as it
      renames.  This allows us to do the right thing with record wildcard
      patterns (which need to be expanded to see what names should be
      collected), and it allows us to implement the desired semantics for view
      patterns in lets.  This change had a bunch of domino effects brought on
      by fiddling with the top-level renaming.
      
      * Prior to this patch, there was a tricky bug in mkRecordSelId in HEAD,
      which did not maintain the invariant necessary for loadDecl.  See note
      [Tricky iface loop] for details.
      6a05ec5e
    • Simon Marlow's avatar
  22. 09 Oct, 2007 1 commit
  23. 11 Sep, 2007 2 commits
  24. 06 Sep, 2007 1 commit
  25. 05 Sep, 2007 1 commit
    • Simon Marlow's avatar
      FIX #1650: ".boot modules interact badly with the ghci debugger" · e2782137
      Simon Marlow authored
      In fact hs-boot files had nothing to do with it: the problem was that
      GHCi would forget the breakpoint information for a module that had
      been reloaded but not recompiled.  It's amazing that we never noticed
      this before.
      
      The ModBreaks were in the ModDetails, which was the wrong place.  When
      we avoid recompiling a module, ModDetails is regenerated from ModIface
      by typecheckIface, and at that point it has no idea what the ModBreaks
      should be, so typecheckIface made it empty.  The right place for the
      ModBreaks to go is with the Linkable, which is retained when
      compilation is avoided.  So now I've placed the ModBreaks in with the
      CompiledByteCode, which also makes it clear that only byte-code
      modules have breakpoints.
      
      This fixes break022/break023
      e2782137
  26. 04 Sep, 2007 1 commit
  27. 03 Sep, 2007 1 commit
  28. 31 Aug, 2007 1 commit
    • Simon Marlow's avatar
      comments only · c9a8811e
      Simon Marlow authored
      I had planned to do findEnclosingDecl a different way, so add a ToDo
      as a reminder.
      c9a8811e
  29. 01 Sep, 2007 1 commit
  30. 29 Aug, 2007 1 commit
  31. 27 Aug, 2007 2 commits
  32. 26 Aug, 2007 1 commit
  33. 24 Aug, 2007 1 commit
    • mnislaih's avatar
      A partial attempt to improve :stepover · 99794f66
      mnislaih authored
        
        With this patch, :stepover can effectively appear to step over recursive calls and 
        calls to locally bound functions (in a where clause).
        
        However, when we run out of ticks in the current expression, 
        the illusion vanishes and laziness brings us to the body of the last function 
        we "stepped over". 
        This is not desired at all, it is potentially very confusing.
        As a countermeasure, when this happens :stepover emits a warning
      
           "Warning: no more breakpoints in this function body, switching to :step"  
      99794f66
  34. 22 Aug, 2007 2 commits
    • Michael D. Adams's avatar
      0ed635be
    • mnislaih's avatar
      A partial attempt to improve :stepover · 24ee7541
      mnislaih authored
        
        With this patch, :stepover can effectively appear to step over recursive calls and 
        calls to locally bound functions (in a where clause).
        
        However, when we run out of ticks in the current expression, 
        the illusion vanishes and laziness brings us to the body of the last function 
        we "stepped over". 
        This is not desired at all, it is potentially very confusing.
        As a countermeasure, when this happens :stepover emits a warning
      
           "Warning: no more breakpoints in this function body, switching to :step"  
      24ee7541