I have this trivial class which instances only iterate over a RowList
class IterProps (rl ∷ RowList)
instance iterPropsCons ∷ (IterProps t) ⇒ IterProps (Cons n a t)
instance iterPropsNil ∷ IterProps Nil
iter ∷ ∀ r rl. RowToList r rl ⇒ IterProps rl ⇒ RProxy r → Unit
iter _ = unit
When I run iter
on a row with a 200 fields compilation takes 800 ms (where the baseline compilation without iter
usage takes around 25 ms) on my machine using purs-0.13.8. The full live example can be found here:
https://try.purescript.org/?gist=849034ed00d238f63c4099f8c93b7280
This seems to have possible practical implications. For example:
- In react-basic we can find rows longer than 120 fields. Any typelevel transformation like handling untagged unions with tools like one-of seems to be an overkill for the project.
- We can easily imagine large rows in the case of a database tables which will for sure affect the coding experience in the case of libs like selda which uses heavily
RowList
machinery.