Created
September 13, 2018 09:59
-
-
Save dariooddenino/f14241948c96175f93b75d6ae2745b72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data PrefixProps sym = PrefixProps (SProxy sym) | |
instance prefixProps :: | |
( IsSymbol newsym | |
, Append presym sym newsym | |
, Row.Lacks newsym rb | |
, Row.Cons newsym a rb rc | |
) => | |
FoldingWithIndex | |
(PrefixProps presym) | |
(SProxy sym) | |
(Builder { | ra } { | rb }) | |
a | |
(Builder { | ra } { | rc }) | |
where | |
foldingWithIndex (PrefixProps _) _ rin a = | |
(_ >>> Builder.insert (SProxy :: SProxy newsym) a) rin | |
prefixRecord :: | |
forall rin rout pre. | |
HFoldlWithIndex (PrefixProps pre) (Builder {} {}) { | rin } (Builder {} { | rout }) => | |
SProxy pre -> | |
{ | rin } -> | |
{ | rout } | |
prefixRecord pre = flip Builder.build {} <<< hfoldlWithIndex (PrefixProps pre) identity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment