1. 14 Feb, 2013 1 commit
    • Simon Peyton Jones's avatar
      Add OverloadedLists, allowing list syntax to be overloaded · 3234a4ad
      Simon Peyton Jones authored
      This work was all done by
         Achim Krause <achim.t.krause@gmail.com>
         George Giorgidze <giorgidze@gmail.com>
         Weijers Jeroen <jeroen.weijers@uni-tuebingen.de>
      
      It allows list syntax, such as [a,b], [a..b] and so on, to be
      overloaded so that it works for a variety of types.
      
      The design is described here:
          http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists
      
      Eg. you can use it for maps, so that
              [(1,"foo"), (4,"bar")] :: Map Int String
      
      The main changes
       * The ExplicitList constructor of HsExpr gets witness field
       * Ditto ArithSeq constructor
       * Ditto the ListPat constructor of HsPat
      
      Everything else flows from this.
      3234a4ad
  2. 13 Feb, 2013 1 commit
  3. 12 Feb, 2013 1 commit
    • jpm@cs.ox.ac.uk's avatar
      Implement poly-kinded Typeable · 72b0ba09
      jpm@cs.ox.ac.uk authored
      This patch makes the Data.Typeable.Typeable class work with arguments of any
      kind. In particular, this removes the Typeable1..7 class hierarchy, greatly
      simplyfing the whole Typeable story. Also added is the AutoDeriveTypeable
      language extension, which will automatically derive Typeable for all types and
      classes declared in that module. Since there is now no good reason to give
      handwritten instances of the Typeable class, those are ignored (for backwards
      compatibility), and a warning is emitted.
      
      The old, kind-* Typeable class is now called OldTypeable, and lives in the
      Data.OldTypeable module. It is deprecated, and should be removed in some future
      version of GHC.
      72b0ba09
  4. 01 Feb, 2013 4 commits
  5. 25 Jan, 2013 1 commit
  6. 04 Jan, 2013 1 commit
    • twanvl's avatar
      Changed deriving of Functor, Foldable, Traversable to fix #7436. Added foldMap... · 49ca2a37
      twanvl authored
      Changed deriving of Functor, Foldable, Traversable to fix #7436. Added foldMap to derived Foldable instance.
      
      The derived instances will no longer eta-expand the function. I.e. instead of
          fmap f (Foo a) = Foo (fmap (\x -> f x) a)
      we now derive
          fmap f (Foo a) = Foo (fmap f a)
      
      Some superflous lambdas are generated as a result. For example
          data X a = X (a,a)
          fmap f (X x) = (\y -> case y of (a,b) -> (f a, f b)) x
      The optimizer should be able to simplify this code, as it is just beta reduction.
      
      The derived Foldable instance now includes foldMap in addition to foldr.
      49ca2a37
  7. 01 Jan, 2013 1 commit
  8. 21 Dec, 2012 1 commit
    • Simon Peyton Jones's avatar
      Use expectP in deriving( Read ) · 52e43004
      Simon Peyton Jones authored
      Note [Use expectP]   in TcGenDeriv
      ~~~~~~~~~~~~~~~~~~
      Note that we use
         expectP (Ident "T1")
      rather than
         Ident "T1" <- lexP
      The latter desugares to inline code for matching the Ident and the
      string, and this can be very voluminous. The former is much more
      compact.  Cf Trac #7258, although that also concerned non-linearity in
      the occurrence analyser, a separate issue.
      52e43004
  9. 19 Dec, 2012 1 commit
  10. 21 Oct, 2012 1 commit
  11. 21 Jun, 2012 1 commit
    • jpm@cs.ox.ac.uk's avatar
      Allow deriving Generic1 · 156ec95a
      jpm@cs.ox.ac.uk authored
      This completes the support for generic programming introduced
      in GHC 7.2. Generic1 allows defining generic functions that
      operate on type containers, such as `fmap`, for instance.
      
      Along the way we have fixed #5936 and #5939, allowing
      deriving Generic/Generic1 for data families, and disallowing
      deriving Generic/Generic1 for instantiated types.
      
      Most of this patch is Nicolas Frisby's work.
      156ec95a
  12. 13 Jun, 2012 1 commit
    • Simon Peyton Jones's avatar
      Simplify the implementation of Implicit Parameters · 5a8ac0f8
      Simon Peyton Jones authored
      This patch re-implements implicit parameters via a class
      with a functional dependency:
      
          class IP (n::Symbol) a | n -> a where
            ip :: a
      
      This definition is in the library module GHC.IP. Notice
      how it use a type-literal, so we can have constraints like
         IP "x" Int
      Now all the functional dependency machinery works right to make
      implicit parameters behave as they should.
      
      Much special-case processing for implicit parameters can be removed
      entirely. One particularly nice thing is not having a dedicated
      "original-name cache" for implicit parameters (the nsNames field of
      NameCache).  But many other cases disappear:
      
        * BasicTypes.IPName
        * IPTyCon constructor in Tycon.TyCon
        * CIPCan constructor  in TcRnTypes.Ct
        * IPPred constructor  in Types.PredTree
      
      Implicit parameters remain special in a few ways:
      
       * Special syntax.  Eg the constraint (IP "x" Int) is parsed
         and printed as (?x::Int).  And we still have local bindings
         for implicit parameters, and occurrences thereof.
      
       * A implicit-parameter binding  (let ?x = True in e) amounts
         to a local instance declaration, which we have not had before.
         It just generates an implication contraint (easy), but when
         going under it we must purge any existing bindings for
         ?x in the inert set.  See Note [Shadowing of Implicit Parameters]
         in TcSimplify
      
       * TcMType.sizePred classifies implicit parameter constraints as size-0,
         as before the change
      
      There are accompanying patches to libraries 'base' and 'haddock'
      
      All the work was done by Iavor Diatchki
      5a8ac0f8
  13. 08 Jun, 2012 1 commit
  14. 06 Jun, 2012 1 commit
  15. 21 May, 2012 1 commit
  16. 15 May, 2012 1 commit
    • batterseapower's avatar
      Support code generation for unboxed-tuple function arguments · 09987de4
      batterseapower authored
      This is done by a 'unarisation' pre-pass at the STG level which
      translates away all (live) binders binding something of unboxed
      tuple type.
      
      This has the following knock-on effects:
        * The subkind hierarchy is vastly simplified (no UbxTupleKind or ArgKind)
        * Various relaxed type checks in typechecker, 'foreign import prim' etc
        * All case binders may be live at the Core level
      09987de4
  17. 24 Apr, 2012 1 commit
  18. 13 Apr, 2012 2 commits
    • Simon Peyton Jones's avatar
      Revert "Added ':runmonad' command to GHCi" · e0e99f99
      Simon Peyton Jones authored
      Two problems, for now at any rate
        a) Breaks the build with lots of errors like
              No instance for (Show (IO ())) arising from a use of `print'
        b) Discussion of the approache hasn't converged yet
           (Simon M had a number of suggestions)
      
      This reverts commit eecd7c98.
      e0e99f99
    • dterei's avatar
      Added ':runmonad' command to GHCi · eecd7c98
      dterei authored
      This command allows you to lift user stmts in GHCi into an IO monad
      that implements the GHC.GHCi.GHCiSandboxIO type class. This allows for
      easy sandboxing of GHCi using :runmonad and Safe Haskell.
      
      Longer term it would be nice to allow a more general model for the Monad
      than GHCiSandboxIO but delaying this for the moment.
      eecd7c98
  19. 09 Apr, 2012 1 commit
  20. 22 Feb, 2012 1 commit
    • batterseapower's avatar
      Simplified serialization of IfaceTyCon, again · 0a882747
      batterseapower authored
      Jose's patch implementing kind-polymorphic core (09015be8) reverted many of the simplifying changes to interface file TyCon serialization I had made in a previous patch (5d7173f9). Based on the diff I think this was an unintended consequence of how Jose did the merge rather than a real change he intended to make.
      
      In fact, as a result of kind-polymorphic core we don't need to treat the Any TyCon specially any longer so my old simplifying changes can be made even simpler: IfaceTyCon is now just a newtype on IfaceExtName.
      0a882747
  21. 16 Feb, 2012 1 commit
  22. 25 Jan, 2012 1 commit
    • Iavor S. Diatchki's avatar
      Add support for type-level "strings". · 5851f847
      Iavor S. Diatchki authored
      These are types that look like "this" and "that".
      They are of kind `Symbol`, defined in module `GHC.TypeLits`.
      
      For each type-level symbol `X`, we have a singleton type, `TSymbol X`.
      
      The value of the singleton type can be named with the overloaded
      constant `tSymbol`.  Here is an example:
      
      tSymbol :: TSymbol "Hello"
      5851f847
  23. 13 Jan, 2012 1 commit
  24. 11 Jan, 2012 1 commit
  25. 10 Jan, 2012 1 commit
  26. 07 Jan, 2012 1 commit
  27. 30 Dec, 2011 1 commit
  28. 07 Dec, 2011 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      Add new primtypes 'ArrayArray#' and 'MutableArrayArray#' · 021a0dd2
      chak@cse.unsw.edu.au. authored
      The primitive array types, such as 'ByteArray#', have kind #, but are represented by pointers. They are boxed, but unpointed types (i.e., they cannot be 'undefined').
      
      The two categories of array types —[Mutable]Array# and [Mutable]ByteArray#— are containers for unboxed (and unpointed) as well as for boxed and pointed types.  So far, we lacked support for containers for boxed, unpointed types (i.e., containers for the primitive arrays themselves).  This is what the new primtypes provide.
      
      Containers for boxed, unpointed types are crucial for the efficient implementation of scattered nested arrays, which are central to the new DPH backend library dph-lifted-vseg.  Without such containers, we cannot eliminate all unboxing from the inner loops of traversals processing scattered nested arrays.
      021a0dd2
  29. 17 Nov, 2011 1 commit
  30. 11 Nov, 2011 1 commit
    • dreixel's avatar
      New kind-polymorphic core · 09015be8
      dreixel authored
      This big patch implements a kind-polymorphic core for GHC. The current
      implementation focuses on making sure that all kind-monomorphic programs still
      work in the new core; it is not yet guaranteed that kind-polymorphic programs
      (using the new -XPolyKinds flag) will work.
      
      For more information, see http://haskell.org/haskellwiki/GHC/Kinds
      09015be8
  31. 10 Nov, 2011 1 commit
    • chak@cse.unsw.edu.au.'s avatar
      GHC is now independent of the DPH library structure · 0bfe5c05
      chak@cse.unsw.edu.au. authored
      * if -XParallelArrays is given, the symbols for the desugarer are
        taken from 'Data.Array.Parallel' (from whichever package is
        exposed and has the module — the home package is fine, too)
      * if -fvectorise is given, the symbols for the vectoriser are
        taken from 'Data.Array.Parallel.Prim' (as above)
      
      (There is one wired in symbol left, namely the data constructor
      'base:GHC.PArr.[::]. It'll die another day.)
      0bfe5c05
  32. 25 Oct, 2011 1 commit
  33. 24 Oct, 2011 1 commit
  34. 27 Sep, 2011 1 commit
  35. 24 Sep, 2011 1 commit
  36. 21 Sep, 2011 1 commit
    • Simon Marlow's avatar
      Add support for all top-level declarations to GHCi · 3db75724
      Simon Marlow authored
        This is work mostly done by Daniel Winograd-Cort during his
        internship at MSR Cambridge, with some further refactoring by me.
      
      This commit adds support to GHCi for most top-level declarations that
      can be used in Haskell source files.  Class, data, newtype, type,
      instance are all supported, as are Type Family-related declarations.
      
      The current set of declarations are shown by :show bindings.  As with
      variable bindings, entities bound by newer declarations shadow earlier
      ones.
      
      Tests are in testsuite/tests/ghci/scripts/ghci039--ghci054.
      Documentation to follow.
      3db75724