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
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,
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
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