Jim
| My reason for wanting pattern matching on values of polymorphic types
| is a kind of first-level refinement types. I'm going to demonstrate
| using the risers function, as presented in Dana N. Xu's ESC/Haskell, which
| references Neil Mitchell's Catch.
I didn't follow all the details, but
On Jan 7, 2008 1:37 AM, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
Sadly, it's not true in Haskell, is it?
(error urk) : []
also has type (forall a. [a]).
It is a bit sad, but I think that's The Curse of The _|_, which
infects any attempt to add static assurance.
It's nicer if
On Jan 4, 2008 5:15 AM, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
| The following won't compile for me
|
| isnull :: (forall a . [a]) - Bool
| isnull ([] :: forall b . [b]) = True
|
| Couldn't match expected type `forall b. [b]'
| against inferred type `[a]'
|
| The following won't compile for me
|
| isnull :: (forall a . [a]) - Bool
| isnull ([] :: forall b . [b]) = True
|
| Couldn't match expected type `forall b. [b]'
| against inferred type `[a]'
| In the pattern: []
This is a pretty strange thing to do, to match a
The following won't compile for me
isnull :: (forall a . [a]) - Bool
isnull ([] :: forall b . [b]) = True
Couldn't match expected type `forall b. [b]'
against inferred type `[a]'
In the pattern: []
Wrapping it in a constructor doesn't help, though I can define a null:
data