My guess: Because it's non-obvious that, unlike Seq.zip, a Seq.unzip would have to cache the sequence.
However, if one has acknowledged this fact, a Seq.unzip could be useful for preserving laziness, e.g. when working with infinite sequences.

1
2
3
4
module Seq =
    let unzip seq =
        let seq = Seq.cache seq
        Seq.map fst seq, Seq.map snd seq
By on 7/17/2009 4:28 AM ()

Would unzip need to cache? You could compute twice, right?

By on 7/17/2009 12:35 PM ()

You absolutely could. In my opinion, however, no library code ever should.
Justin Etheredge's comment here explains this: Since library code must be context independent, there's no way to know whether enumerating twice is feasible/safe.

By on 7/18/2009 4:36 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper