func (m *M) String() string {
	return m.toString(true)
}
String returns a string representation of the map's entries.
Values are printed using fmt.Sprintf("%v", v).
Order is unspecified.
package typemap
import (
	"bytes"
	"fmt"
	"unsafe"
	"code.google.com/p/go.tools/go/types"
)
type M struct {
	hasher Hasher              
	table  map[uint32][]entry  
	length int                 
}
type entry struct {
	key   types.Type
	value interface{}
}
func (m *M) SetHasher(hasher Hasher) {
	m.hasher = hasher
}
func (m *M) Delete(key types.Type) bool {
	if m != nil && m.table != nil {
		hash := m.hasher.Hash(key)
		bucket := m.table[hash]
		for i, e := range bucket {
			if e.key != nil && types.IsIdentical(key, e.key) {
				bucket[i] = entry{}
				m.length--
				return true
			}
		}
	}
	return false
}
func (m *M) At(key types.Type) interface{} {
	if m != nil && m.table != nil {
		for _, e := range m.table[m.hasher.Hash(key)] {
			if e.key != nil && types.IsIdentical(key, e.key) {
				return e.value
			}
		}
	}
	return nil
}
func (m *M) Set(key types.Type, value interface{}) (prev interface{}) {
	if m.table != nil {
		hash := m.hasher.Hash(key)
		bucket := m.table[hash]
		var hole *entry
		for i, e := range bucket {
			if e.key == nil {
				hole = &bucket[i]
			} else if types.IsIdentical(key, e.key) {
				prev = e.value
				bucket[i].value = value
				return
			}
		}
		if hole != nil {
			*hole = entry{key, value}  
		} else {
			m.table[hash] = append(bucket, entry{key, value})
		}
	} else {
		if m.hasher.memo == nil {
			m.hasher = MakeHasher()
		}
		hash := m.hasher.Hash(key)
		m.table = map[uint32][]entry{hash: {entry{key, value}}}
	}
	m.length++
	return
}
func (m *M) Len() int {
	if m != nil {
		return m.length
	}
	return 0
}
func (m *M) Iterate(f func(key types.Type, value interface{})) {
	if m != nil {
		for _, bucket := range m.table {
			for _, e := range bucket {
				if e.key != nil {
					f(e.key, e.value)
				}
			}
		}
	}
}
func (m *M) Keys() []types.Type {
	keys := make([]types.Type, 0, m.Len())
	m.Iterate(func(key types.Type, _ interface{}) {
		keys = append(keys, key)
	})
	return keys
}
func (m *M) toString(values bool) string {
	if m == nil {
		return "{}"
	}
	var buf bytes.Buffer
	fmt.Fprint(&buf, "{")
	sep := ""
	m.Iterate(func(key types.Type, value interface{}) {
		fmt.Fprint(&buf, sep)
		sep = ", "
		fmt.Fprint(&buf, key)
		if values {
			fmt.Fprintf(&buf, ": %q", value)
		}
	})
	fmt.Fprint(&buf, "}")
	return buf.String()
}