
Yeah, it would. But I always write code like that, it feels ungainly...
writing super-long, case-by-case instance declarations (So that I can add in
one little caveat at the end, or something), and stuff. Makes me feel like I
must be dumb!
On Tue, May 19, 2009 at 2:54 PM, Derek Gladding
Nathan Holden wrote:
[snip] My question, however, boils primarily down to this: Is there a way to make
Foo :: Note -> Note -> Int Foo a b = a-b
work?
Would a function
Bar :: Note -> Int
make writing Foo easier?
- Derek

Excerpts from nathanmholden's message of Tue May 19 15:07:26 -0400 2009:
Yeah, it would. But I always write code like that, it feels ungainly... writing super-long, case-by-case instance declarations (So that I can add in one little caveat at the end, or something), and stuff. Makes me feel like I must be dumb!
It seems to me, in this particular case, that you don't actually want an algebraic datatype (which seems to be what you're implementation is using). Cheers, Edward
participants (2)
-
Edward Z. Yang
-
Nathan Holden