dfinity / motoko-base

The Motoko base library
Apache License 2.0
481 stars 100 forks source link

Hash.mo need fixing and every prim module M needs an M.hash function, update guide to relect this. #134

Open crusso opened 4 years ago

matthewhammer commented 4 years ago

@crusso What does "need[s] fixing" mean in the issue title? How would we know if it were fixed, for instance?

matthewhammer commented 4 years ago

every prim module M needs an M.hash function

+1

matthewhammer commented 4 years ago

Actually writing this function properly is important, but I've been hesitating, since:

  1. It's a lot of work to write this in Motoko for every type, even with the proper combinators
  2. Perhaps the language itself will absorb hashing for shared data? If so, then 1 becomes trivial in most cases.

OTOH, if it's important to do very soon, we can bite the bullet and write these for each module, by hand. But, I hesitate still, as I thought I saw somewhere else that we are discussing hashing for shared data though (item 2 above) in the nearer term?