- 14 Oct, 2005 1 commit
-
-
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.
-
- 13 Oct, 2005 1 commit
-
-
sof authored
add protos for HeapStackCheck.cmm:stg_block_blackhole_* entry points
-
- 12 Oct, 2005 8 commits
-
-
simonmar authored
- we should be acquiring the sm_lock around allocGroup() - sanity check threads as they are pulled off the blackhole_queue
-
simonpj authored
MERGE TO STABLE Fix a bug in TcUnify.unifyTyConApp that made a GADT program fail. The trouble happens if the type that we are expecting to be a TyConApp is of form (m a b), where 'm' is refined to a type constructor. Then we want to get nice rigid results, and we weren't.
-
simonpj authored
Small refactoring
-
simonmar authored
DEBUG_FILL_SLOP: don't do anything on SMP, zeroing slop words isn't safe
-
simonmar authored
checkHeap: just return on SMP, we can't do heap sanity checking because we can't zero slop words safely.
-
simonmar authored
Fix assertion failure in memInventory() with SMP
-
simonmar authored
When blocking on a BLACKHOLE, we must wait until we have finished manipulating the current thread's stack before we release sched_mutex, otherwise another thread can pick up the thread from the blackhole_queue and start running it.
-
wolfgang authored
Mac OS X/Darwin PowerPC: Fix a problem introduced by the recent Darwin/x86 commit. Make the code that allocates jump islands for PowerPC aware of how we shift .o files in memory to compensate for Mach-O's lax alignment rules.
-
- 11 Oct, 2005 1 commit
-
-
simonpj authored
Small fixes to the Win32 build log
-
- 10 Oct, 2005 3 commits
- 07 Oct, 2005 1 commit
-
-
simonmar authored
Fix a bug I just found: hiding a package if later versions are exposed wasn't actually checking the exposed flag.
-
- 06 Oct, 2005 6 commits
-
-
simonmar authored
comment typo From: Autrijus Tang <autrijus@autrijus.org>
-
simonmar authored
remove old comment From: Autrijus Tang <autrijus@autrijus.org>
-
simonmar authored
add dataConFieldType From: Autrijus Tang <autrijus@autrijus.org>
-
simonmar authored
refactoring (use record fields instead of selector functions) From: Autrijus Tang <autrijus@autrijus.org>
-
simonmar authored
add splitHsFunType From: Autrijus Tang <autrijus@autrijus.org>
-
simonmar authored
small refactoring From: Autrijus Tang <autrijus@autrijus.org>
-
- 05 Oct, 2005 3 commits
- 24 Sep, 2005 4 commits
-
-
panne authored
Synched all FPTOOLS_CHECK_HTYPE definitions with the latest changes in libraries/OpenAL/aclocal.m4. Although it is not strictly necessary, keeping things identical is good for consistency. At some point in time we should really find a way to eliminate all this redundancy... *sigh*
-
wolfgang authored
x86 & PIC: make floating point constants on x86 PIC-aware
-
wolfgang authored
Darwin/x86: Try again to get stack alignment right.
-
wolfgang authored
PowerPC: track changes in the rest of the register allocator
-
- 23 Sep, 2005 1 commit
-
-
simonmar authored
in --make mode, don't re-link when the executable is up to date.
-
- 21 Sep, 2005 2 commits
- 20 Sep, 2005 2 commits
- 18 Sep, 2005 5 commits
-
-
wolfgang authored
Make outOfLineFloatOp PIC/dynamic-linking-aware on i386
-
wolfgang authored
Fix last commit: it's opt_Static in the HEAD branch, not a local variable "static".
-
panne authored
Fixed a few underquoted definitions.
-
wolfgang authored
PIC version for genSwitch on i386
-
wolfgang authored
A hack to make -dynamic work again: when a library listed in extraLibraries ends with "_cbits", append "_dyn" when -dynamic is passed, i.e. extraLibraries = ["foo", "HSbase_cbits"] loads -lfoo and -lHSbase_cbits in the static case, but -lfoo and -lHSbase_cbits_dyn in the -dynamic case. It's an ugly hack, but it affects only the case when -dynamic is passed, which would not work otherwise right now, so let's MERGE TO STABLE
-
- 16 Sep, 2005 2 commits