A lazy map type which is backed by a lazy seq containing interleaved keys and values.

Order of items may change between two uses if the collection is not realized.

Most operations fully realize returned lazy map. Following ones do not realize, or only partially realize the returned lazy map:

lazy-seq→map

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (lazy-seq->map kvs)

Type signature:
  • ([]) → {}

Returns a lazy map backed by a given lazy seq kvs, which contains interleaved keys and values.

1
2
3
4
5
6
7
8
9
10
11
12
(ns foo.bar
  (:api dunaj)
  (:require [dunaj.coll.lazy-seq-map :refer [lazy-seq->map]]))

(lazy-seq->map [:a 1 :b 2 :c 3])
;;=> {:a 1, :b 2, :c 3}

(def m (lazy-seq->map (interleave (range) (map char (range)))))
;;=> #'foo.bar/m

(get m 61)
;;=> \=