... | ... | @@ -190,6 +190,36 @@ The above doesn't work on GHC 6.6.1. I get |
|
|
|
|
|
The only other sane way to get this working is to unroll the map by hand.
|
|
|
|
|
|
### Fifth report
|
|
|
|
|
|
|
|
|
Matthew Naylor (mfn@…) writes: [ SparseCheck](http://www.cs.york.ac.uk/~mfn/sparsecheck) uses polymorhpic pattern bindings. For example, a `SparseCheck` datatype for lists is written as
|
|
|
|
|
|
```wiki
|
|
|
(nil :- (|>)) = datatype (ctr0 [] \/ ctr2 (:))
|
|
|
```
|
|
|
|
|
|
|
|
|
This introduces two functions with types
|
|
|
|
|
|
```wiki
|
|
|
nil :: Term [a]
|
|
|
(|>) :: Term a -> Term [a] -> Term [a]
|
|
|
```
|
|
|
|
|
|
|
|
|
Without polymorphic pattern bindings, we would have to write something
|
|
|
like:
|
|
|
|
|
|
```wiki
|
|
|
nil = ctr0 0 []
|
|
|
(|>) = ctr2 1 (:)
|
|
|
```
|
|
|
|
|
|
|
|
|
Notice that I must give each constructor a unique identifier
|
|
|
*manually*.
|
|
|
|
|
|
## Summary
|
|
|
|
|
|
|
... | ... | |