HCard, is a library which supports a card-like data structures, it uses
associated types [1] to provide shuffling, dealing, and other
facilities. It's
general enough to support many different types of playing cards, it
currently comes with the common "French Deck" (4-suit, 13 card deck that
is very common in the US) implemented and an example (though untested)
cribbage scoring application.
You can find HCard here [2,3], and a post about it's use of associated
types here [1].
On another note, I can't think of a good reason I should be using
associated types, as I explain in [1]. Well, no good reason other than
the "cool factor" -- can anyone enlighten me on a possible practical
benefit of using Assoc types as opposed to a simple indexed record?
Anyway, enjoy HCard!
/Joe Fredette
[1]
http://lowlymath.net/2009/card-games-scorekeeping-and-associated-datatypes/
[2] darcs get http://patch-tag.com/publicrepos/HCard
[3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HCard
begin:vcard
fn:Joseph Fredette
n:Fredette;Joseph
adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America
email;internet:[email protected]
tel;home:1-508-966-9889
tel;cell:1-508-254-9901
x-mozilla-html:FALSE
url:lowlymath.net, humbuggery.net
version:2.1
end:vcard
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe