|
Re: Union Types for Haskell!?: msg#00078lang.haskell.general
At 2000-11-24 03:14, Fergus Henderson wrote: >> Is there any reason for this restriction >> in the Haskell type system? Does this lead to losing the principal type >> property? > >If you allow (2) above, there may be serious problems for >principal types. For example, consider > > f x = case x of > Nothing -> False > Just _ -> True > >What's the most general type for `f'? >The type `f :: Maybe a -> Bool' is less general than >e.g. `f :: Union { Maybe a, ... } -> Bool', >but you certainly don't want to infer the latter type. There are two different kinds of 'general' here. Informally, you want the type most general in the type-substitution sense, but probably most specific in the subtype sense. -- Ashley Yakeley, Seattle WA |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Union Types for Haskell!?: 00078, Ashley Yakeley |
|---|---|
| Next by Date: | Re: Union Types for Haskell!?: 00078, Pixel |
| Previous by Thread: | Re: Union Types for Haskell!?i: 00078, Johan Nordlander |
| Next by Thread: | Re: Union Types for Haskell!?: 00078, Christian Lescher |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |