module ADP.Fusion.Term.Strng.Type where
import Data.Strict.Tuple
import qualified Data.Vector.Generic as VG
import Data.PrimitiveArray
import ADP.Fusion.Core.Classes
import ADP.Fusion.Core.Multi
data Strng v x where
Strng :: VG.Vector v x
=> (Int -> Int -> v x -> v x)
-> Int
-> Int
-> (v x)
-> Strng v x
manyS :: VG.Vector v x => v x -> Strng v x
manyS = \xs -> Strng VG.unsafeSlice 0 (VG.length xs) xs
someS :: VG.Vector v x => v x -> Strng v x
someS = \xs -> Strng VG.unsafeSlice 1 (VG.length xs) xs
strng :: VG.Vector v x => Int -> Int -> v x -> Strng v x
strng = \minL maxL xs -> Strng VG.unsafeSlice minL maxL xs
instance Build (Strng v x)
instance
( Element ls i
) => Element (ls :!: Strng v x) i where
data Elm (ls :!: Strng v x) i = ElmStrng !(v x) !(RunningIndex i) !(Elm ls i)
type Arg (ls :!: Strng v x) = Arg ls :. v x
getArg (ElmStrng x _ ls) = getArg ls :. x
getIdx (ElmStrng _ i _ ) = i
deriving instance (Show i, Show (RunningIndex i), Show (v x), Show (Elm ls i)) => Show (Elm (ls :!: Strng v x) i)
type instance TermArg (Strng v x) = v x