I needed a list which could handle items of different types for the database code I am writing. I have written a module implementing such a list based on dependant types (from Conor McBride: Faking It; Simulating Depandant Types in Haskell). Although McBride does not mention lists/vectors with items of differing types, the solution to implementing them came from his 'nthFront' function for re-arranging the order of arguments to a function.

Any type can be inserted into the list, which supports head/tail/init/last, as well as indexed lookup, and a cartesian-product (concatenating two lists together). I have included fromTuple/toTuple as well.

This seems quite a useful construct, and if there is nothing similar in the standard libraries at the moment, do you think this is worth including?

   Regards,
   Keean Schupke.
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to