This page is no longer maintained — Please continue to the home page at www.scala-lang.org

matching my types

No replies
Matthew Pocock 3
Joined: 2010-07-30,
User offline. Last seen 42 years 45 weeks ago.
Hi,
I'm doing some magik with squeryl to bulk insert things that depend on primary keys from inserting other things. While doing this I build a structure of type: Map[Table[_], List[(Long => _)]]. This stores a table together with a load of functions for making instances that should be inserted into this table. Of course, this type signature is overly lax. What I want, with abuse of notation, is something like: Map[T? Table[T], List[Long=>T]] where each table/list pair match on type, but each pair are independently typed. The number of tables that each map deals with will be very small, so I don't need to use Map for efficiency reasons - a linear scan through some other structure would surfice.
Is there some way to express this that is more type-safe?
Thanks,
Matthew
--
Dr Matthew PocockIntegrative Bioinformatics Group, School of Computing Science, Newcastle University mailto: turingatemyhamster [at] gmail [dot] comgchat: turingatemyhamster [at] gmail [dot] com msn: matthew_pocock [at] yahoo [dot] co [dot] ukirc.freenode.net: drdozertel: (0191) 2566550 mob: +447535664143

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland