Package

purescript-fast-vect

Repository
sigma-andex/purescript-fast-vect
License
MIT-0
Uploaded by
sigma-andex
Published on
2021-08-25T13:52:43Z

Fast, type-safe vector libary for Purescript inspired by Idris.

tl;dr

fast-vect-intro-optimised.mp4

Installation

spago install fast-vect

Example usage

import Data.FastVect.FastVect
import Prelude

import Data.FastVect.Add (term)
import Data.FastVect.FastVect as FV
import Type.Proxy (Proxy(..))

as :: Vect "300" String
as = FV.replicate (term :: _ "300") "a"

bs :: Vect "200" String
bs = FV.replicate (term :: _ "200") "b"

cs :: Vect "500" String
cs = FV.append as bs

ds :: Vect "2" String
ds = cs # FV.drop (term :: _ "299") # FV.take (term :: _ "2")

x :: String
x = FV.index (term :: _ "499") cs

y :: String
y = FV.head (FV.singleton "a")

big1 :: Vect "23923498230498230420" String
big1 = FV.replicate (term :: _ "23923498230498230420") "a"

big2 :: Vect "203948023984590684596840586" String
big2 = FV.replicate (term :: _ "203948023984590684596840586") "b"

big :: Vect "203948047908088915095071006" String
big = FV.append big1 big2
Modules
Data.FastVect.FastVect
Dependencies