| Michael suggested | | f :: [a] -> c | f xs = if len > fromInteger 3 then len else 0 | where | len :: c | len = length xs | | This relies on the 'c' from the type signature scoping over | the definition, which is on alternative notation for scoped | type variables. Hmm, interesting. Perhaps we need to allow type annotations on left hand sides as well as embedded in patterns: f xs :: c = ... I know it looks a bit ugly ... add a few more parens and it starts to remind me of Pascal! :-) All the best, Mark
- Scoped typed variables. Alex Ferguson
- RE: Scoped typed variables. Mark P Jones
- Re: Scoped typed variables. Simon L Peyton Jones
- RE: Scoped typed variables. Mark P Jones
- RE: Scoped typed variables. michael
- RE: Scoped typed variables. Alex Ferguson
- RE: Scoped typed variables. Mark P Jones
- RE: Re: Scoped typed variables. Mark P Jones
- RE: Re: Scoped typed variables. michael
- Re: Scoped typed variables. Jeffrey R. Lewis
- Re: Scoped typed variables. Alex Ferguson
- Re: Scoped typed variables. Jeffrey R. Lewis
- Re: Scoped typed variables. Alex Ferguson
- Re: Scoped typed variables. Ralf Hinze