A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sigma-andex/scala-fast-vect below:

sigma-andex/scala-fast-vect: Fast 🐆, type-safe vectors for Scala

Fast, type-safe vector libary for Scala. This library is a port of my Purescript library purescript-fast-vect and both libs are heavily inspired by Idris. A vector is list with its size encoded in the type.

import fastvect.*
import fastvect.list.{given, *}

val zero: Vect[0, String] = Vect.empty[String]
val one: Vect[1, String] = Vect.singleton("a")
val h: String = one.head
val as: Vect[100, String] = Vect.replicate[100, String]("a")
val bs: Vect[200, String] = Vect.replicate[200, String]("b")
val cs: Vect[300, String] = as ++ bs
val ds = cs.drop[99]
val es: String = as.index[99]
val l1: String = Vect.singleton("a").last
val fives: Option[Vect[5, String]] =
  Vect.from[5, String](List("a", "b", "c", "d"))
val xs: Vect[3, String] = (Vect.replicate("a"): Vect[2, String]) :+ "b"
val ys: Vect[4, String] = "c" +: xs
val zs = Vect.from[5, Int](List(1,2,3,4))

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4