tom-sherman / seq-res

β›“πŸ˜΄ Lazy sequences for ReScript with interop superpowers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

seq-res

⚠️ Very experimental, proceed with caution

A lazy sequence library for ReScript with built in support for iterators and the iterable protocol for better JS interop.

Examples

Usage as an iterable

let seq = Seq.fromArray([1,2,3])
let iterator = Iterator.fromSeq(seq)
// Or
// let iterable = Iterable.fromSeq(seq)

// `raw` is used here for example's sake, it could be in a JS module importing the outputted JS
%%raw("
  for (const val of iterator) {
    console.log(val)
  }
")

Todo

  • Iterable -> Seq conversion
  • Iterator -> Seq conversion
  • Gentype support
  • Find a better name and publish to npm

About

β›“πŸ˜΄ Lazy sequences for ReScript with interop superpowers.


Languages

Language:ReScript 98.1%Language:JavaScript 1.9%