Comments (3)
Got it!
I should have written:
utop # let s4 = S.group_by ~hash:(fun (a, _) -> String.hash a)
~eq:(fun (a1, _) (b1, _) -> String.equal a1 b1) s;;
val s4 : (string * string) list S.t = <fun>
utop # print2 s4;;
[("a", "f"), ("a", "e"), ("a", "d")]
[("b", "f"), ("b", "e"), ("b", "d")]
[("c", "f"), ("c", "e"),
("c", "d")]
- : unit = ()
So it was not clear for me, from the documentation, what the hash function had to do... Perhaps the doc should be updated here, but I don't really know how to formulate this...
from iter.
Ok, I see. The invariant you were missing is quite classic: eq x y ==> hash x = hash y
. In this particular case it would not hold.
from iter.
I added the invariant to the docs,thanks. Release incoming.
from iter.
Related Issues (20)
- opam config needs qtest dependency? HOT 5
- opam install --build-doc sequence wants to write to /usr/local/share/doc/sequence HOT 3
- Sequence.(--^) inconsistent with CCList.(--^) HOT 1
- Missing test dependency HOT 2
- should this be included into batteries? HOT 1
- zipping two sequences? HOT 1
- 4.07 support HOT 4
- document pros/cons of seq/sequence/gen HOT 6
- investigate `mdx` for testing the readme HOT 1
- make doc fails HOT 2
- Can't run tests with OUnit2 and qcheck-0.13 HOT 1
- does iter need of_seq HOT 4
- Broken link in README
- The Synopsis line is empty (with $ opam list) HOT 5
- Compatibility with mdx 2.0.0 HOT 2
- split into several modules
- dune version HOT 1
- Iter.IO.write_lines with "empty" iter still writes a newline char to output file HOT 3
- use qtest for testing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iter.