Re: varying number of arguments restriction

2001-10-31 Thread Fergus Henderson
On 30-Oct-2001, Hal Daume [EMAIL PROTECTED] wrote: I'm curious why the following code is invalid (from a language design point of view): foo :: [(Int, String)] - String foo [] = foo = snd . head ghc complains: Varying number of arguments for function `foo' I don't understand

varying number of arguments restriction

2001-10-30 Thread Hal Daume
I'm curious why the following code is invalid (from a language design point of view): foo :: [(Int, String)] - String foo [] = foo = snd . head ghc complains: Varying number of arguments for function `foo' I don't understand why this should be invalid? Basically, as I read it, I say,

Re: varying number of arguments restriction

2001-10-30 Thread Ashley Yakeley
At 2001-10-30 11:01, Hal Daume wrote: obviously i can rewrite: foo [] = foo s = (snd . head) s but this is uglier. I'm not sure. I actually prefer it written out so that the number of arguments in the cases matches (as GHC enforces). -- Ashley Yakeley, Seattle WA

Re: varying number of arguments restriction

2001-10-30 Thread Brian Boutel
Ashley Yakeley wrote: At 2001-10-30 11:01, Hal Daume wrote: obviously i can rewrite: foo [] = foo s = (snd . head) s but this is uglier. I'm not sure. I actually prefer it written out so that the number of arguments in the cases matches (as GHC enforces). It's defined in the