-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
For example, zipList_NP
requires SListI
:
zipWith_NP :: SListI xs => (forall a. f a -> g a -> h a) -> NP f xs -> NP g xs -> NP h xs
However, compare_NS
and compare_SOP
, don't require nor provide one:
compare_NS ::
forall r f g xs .
r -- ^ what to do if first is smaller
-> (forall x . f x -> g x -> r) -- ^ what to do if both are equal
-> r -- ^ what to do if first is larger
-> NS f xs -> NS g xs
-> r
compare_SOP ::
forall r f g xss .
r -- ^ what to do if first is smaller
-> (forall xs . NP f xs -> NP g xs -> r) -- ^ what to do if both are equal
-> r -- ^ what to do if first is larger
-> SOP f xss -> SOP g xss
-> r
compare_SOP lt eq gt (SOP xs) (SOP ys) =
compare_NS lt eq gt xs ys
which requires to use ccompare_NS
variants with Top
: compare_SOP ... (\xs ys -> ... $ zipList_NP xs ys)
doesn't work.
I'd prefer a fix where functions which don't require SList
(like map_NP
and zipWith_NP
) won't actually require it (i.e. fix them, not compare_NS
). The reasoning being two fold
- Less "linear sized" data passed around (and constructed)
- If
zipWith_NP
is used on something else than a[Type]
kind. Maybe it's[[Type]]
or[[[Type]]]
, maybe there's something not insop-core
(e.g. type-levelMaybe
with its ownAll
-like class). SozipWith_NP
cannot be ever general enough, and then it's better to useczipWIth_NP
. ButzipWith_NP
is stilluseful, when you are not threading any constraints. (Except it isn't know, asSListI
needs to be threaded, or recovered from argumentNP
).
Metadata
Metadata
Assignees
Labels
No labels