要素数を保持するVector型
Idrisの場合
import Data.Vect
code:idr
data Vect : Nat -> Type -> Type where
Nil : Vect Z a
(::) : a -> Vect k a -> Vect (S k) a
hsの場合
index :: forall n a. Vector n a -> Finite n -> a
generate :: forall n a. KnownNat n => (Finite n -> a) -> Vector n a
code:hs
v = V.fromTuple ("hey", "what's", "going", "on") -- :: V.Vector 4 String
a = V.index v 1 -- "what's"
generateの普通の使い方がわからんmrsekut.icon