1. 17 Oct, 2005 4 commits
  2. 14 Oct, 2005 4 commits
    • simonmar's avatar
      [project @ 2005-10-14 13:11:21 by simonmar] · 676f9567
      simonmar authored
      StrHash doesn't appear to be used; remove it.  I think it was an
      earlier version of the string hashing code in Hash.c.
      676f9567
    • simonmar's avatar
      [project @ 2005-10-14 12:29:53 by simonmar] · 1c7854b5
      simonmar authored
      Some more informative diagnostics for ghc -v about what the package
      system is doing.  This should help when diagnosing strange-looking
      errors from GHC:
      
      Using package config file: /home/simonmar/fp/lib/i386-unknown-linux/ghc-6.4.1/package.conf
      package posix-1.0 will be ignored due to missing dependencies:
        lang-1.0
      package util-1.0 will be ignored due to missing dependencies:
        lang-1.0
      package data-1.0 will be ignored due to missing dependencies:
        lang-1.0
      package text-1.0 will be ignored due to missing dependencies:
        lang-1.0
      package Cabal-1.1.4 will be ignored due to missing dependencies:
        util-1.0
      *** Deleting temp files
      Deleting:
      ghc-6.4.1: unknown package: Cabal-1.1.4
      1c7854b5
    • simonmar's avatar
      [project @ 2005-10-14 11:48:56 by simonmar] · a004ae5a
      simonmar authored
      Fix a couple of problems with the "unknown package" error message
      a004ae5a
    • simonpj's avatar
      [project @ 2005-10-14 11:22:41 by simonpj] · 36436bc6
      simonpj authored
      Add record syntax for GADTs
      	~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Atrijus Tang wanted to add record syntax for GADTs and existential
      types, so he and I worked on it a bit at ICFP.  This commit is the
      result.  Now you can say
      
       data T a where
        T1 { x :: a }           	 :: T [a]
        T2 { x :: a, y :: Int } 	 :: T [a]
        forall b. Show b =>
       	T3 { naughty :: b, ok :: Int } :: T Int
        T4 :: Eq a => a -> b -> T (a,b)
      
      Here the constructors are declared using record syntax.
      
      Still to come after this commit:
        - User manual documentation
        - More regression tests
        - Some missing cases in the parser (e.g. T3 won't parse)
      Autrijus is going to do these.
      
      
      Here's a quick summary of the rules.  (Atrijus is going to write
      proper documentation shortly.)
      
      Defnition: a 'vanilla' constructor has a type of the form
      	forall a1..an. t1 -> ... -> tm -> T a1 ... an
      No existentials, no context, nothing.  A constructor declared with
      Haskell-98 syntax is vanilla by construction.  A constructor declared
      with GADT-style syntax is vanilla iff its type looks like the above.
      (In the latter case, the order of the type variables does not matter.)
      
      * You can mix record syntax and non-record syntax in a single decl
      
      * All constructors that share a common field 'x' must have the
        same result type (T [a] in the example).
      
      * You can use field names without restriction in record construction
        and record pattern matching.
      
      * Record *update* only works for data types that only have 'vanilla'
        constructors.
      
      * Consider the field 'naughty', which uses a type variable that does
        not appear in the result type ('b' in the example).  You can use the
        field 'naughty' in pattern matching and construction, but NO
        SELECTOR function is generated for 'naughty'.  [An attempt to use
        'naughty' as a selector function will elicit a helpful error
        message.]
      
      * Data types declared in GADT syntax cannot have a context. So this
      is illegal:
      	data (Monad m) => T a where
      		  ....
      
      * Constructors in GADT syntax can have a context (t.g. T3, T4 above)
        and that context is stored in the constructor and made available
        when the constructor is pattern-matched on.  WARNING: not competely
        implemented yet, but that's the plan.
      
      
      
      Implementation notes
      ~~~~~~~~~~~~~~~~~~~~
      - Data constructors (even vanilla ones) no longer share the type
        variables of their parent type constructor.
      
      - HsDecls.ConDecl has changed quite a bit
      
      - TyCons don't record the field labels and type any more (doesn't
        make sense for existential fields)
      
      - GlobalIdDetails records which selectors are 'naughty', and hence
        don't have real code.
      36436bc6
  3. 13 Oct, 2005 1 commit
  4. 12 Oct, 2005 8 commits
  5. 11 Oct, 2005 1 commit
  6. 10 Oct, 2005 3 commits
  7. 07 Oct, 2005 1 commit
  8. 06 Oct, 2005 6 commits
  9. 05 Oct, 2005 3 commits
  10. 24 Sep, 2005 4 commits
  11. 23 Sep, 2005 1 commit
  12. 21 Sep, 2005 2 commits
  13. 20 Sep, 2005 2 commits