You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was hoping to replace my own generic heterogeneous list by sop-core's n-ary products NP, however, I realized I am not yet able to do this since the fields of NP are not linear.
Do you think we might have instead:
data NP :: (k -> Type) -> [k] -> Type where
Nil :: NP f '[]
- (:*) :: f x -> NP f xs -> NP f (x ': xs)+ (:*) :: f x %1 -> NP f xs %1 -> NP f (x ': xs)
In theory, this would only affect LinearType users of sop-core who use an NP linearly, which I reckon are not many, as otherwise all datatype constructors have linear components instead of unrestricted ones by default.
I would additionally argue that NP having linear fields is something that wasn't previously considered, as the first commit defining NP is from 2014, when LinearTypes were nowhere in sight, and was already using the GADTSyntax with unrestricted arrows.
Much appreciated!
The text was updated successfully, but these errors were encountered:
Hello!
I was hoping to replace my own generic heterogeneous list by
sop-core
's n-ary productsNP
, however, I realized I am not yet able to do this since the fields ofNP
are not linear.Do you think we might have instead:
In theory, this would only affect LinearType users of
sop-core
who use anNP
linearly, which I reckon are not many, as otherwise all datatype constructors have linear components instead of unrestricted ones by default.I would additionally argue that
NP
having linear fields is something that wasn't previously considered, as the first commit definingNP
is from 2014, when LinearTypes were nowhere in sight, and was already using theGADTSyntax
with unrestricted arrows.Much appreciated!
The text was updated successfully, but these errors were encountered: