|
| <prev next> |
Re: Strange behaviour with classes (both Hugs and GHC): msg#00124lang.haskell.glasgow.bugs
Hi, if you desugar the definition that's causing the type error, perhaps it becomes a little bit clearer what's going on, i.e., from problematic :: MyAnnotatedType Int problematic = defaultVal{theInt=42,theAnnotation=10} you expand this to problematic' = case defaultVal of { MAT a b c -> MAT 42 b 10 } Clearly, the type of 'c' is ambiguous here. Interestingly, if Haskell 98 had defined record update expr "e{fields}" as having the same type as "e", this wouldn't have been an issue: no_probs = case defaultVal of { m@(MAT a b c) -> (MAT 42 b 10) `asTypeOf` m} hth --sigbjorn ----- Original Message ----- From: "Magnus Björk" <mab@xxxxxxxxxxxxxx> To: <glasgow-haskell-bugs@xxxxxxxxxxx>; <hugs-bugs@xxxxxxxxxxx> Sent: Monday, May 29, 2006 03:34 Subject: Strange behaviour with classes (both Hugs and GHC) I just ran into a strange behaviour of both Hugs and GHC. I discussed it -------------------------------------------------------------------------------- _______________________________________________
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Strange behaviour with classes (both Hugs and GHC), Magnus Björk |
|---|---|
| Next by Date: | Re: Bug with Char.isAlpha, Simon Marlow |
| Previous by Thread: | Strange behaviour with classes (both Hugs and GHC), Magnus Björk |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |