4 ms·
This could equally well be a function which takes a string and a seed and returns the hash. The more concrete the type signatures become the less they become d
by mpcjanssen 7y ago
This could equally well be a function which takes a string and a seed and returns the hash.
The more concrete the type signatures become the less they become documenting.
A signature of a -> a defines the id function because the type is so generic. A function of String->String can do pretty much anything.
- dodobirdlord 7y agoBut that's exactly my point. Why would something that is a randomization seed have type "String"? Why would a hash have type "String"? Why not type Seed and type Hash? A type signature of Seed -> String -> Hash is pretty enlightening!