On Sat, May 15, 2004 at 04:42:03PM +0000, Niklas Broberg wrote: > .... In non-linear context, the > type is a list of what it would otherwise be, regardless of what and how > many enclosing non-linear regular pattern operators.
So I guess that in foo [/ a? 2 b /] = (a,b) the type of a is '[Int]', not 'Maybe Int', right? > Hopefully I make sense (more than before?). Yes, I think that's clearer. > I'm starting to think maybe our context dependent approach to implicit > bindings isn't very good after all since it seems to confuse a lot of > people. Perhaps variables bound inside regular patterns should always be > non-linear... of course that would still be context dependent when compared > to normal Haskell patterns, but perhaps still less confusing? Alternatively, you could forbid the use of simple variables nonlinearly, since there's an alternative way to write it. Or, you could make variables (and other pattern binding) more context dependent, recording all the relevant parts of the context (and not just whether the context is linear or not), if that makes sense. Interesting issues, anyway! By the way, are nested regular expression matches allowed? Something like: foo :: [[Int]] -> Int foo [/ _* [/ 5* a 6* /] _* /] = a ? If so, what is the type of a in foo [/ _* [/ 5* a* /]* _* /] ? Peace, Dylan
signature.asc
Description: Digital signature
_______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell