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
The current PureScript generator will generate some cumbresome code:
make = ... -- Meant to both type check and generate, at runtime, the classm1::Tailwind
m1 = "m-1"m2::Tailwind
m2 = "m-2"-- And so on...
This comes with 2 downsides:
It's extremely verbose, taking 4 lines per css class, when tailwind generates 25,000 classes, do the math 😄
As mentioned in the code snippet above, there is a compile validatation, but also some runtime computation, since we need to turn a list of classes into a string
No runtime cost, validate will just take the compile time string, and reflect it into the runtime realm
Can potentially handles some exotic class names
It also comes with 2 drawbacks:
Less flexible (bye bye Monoid and Foldable goodies)
It's more verbose on the call side (because of the SProxy value, unfortunately PureScript used to have the following syntax: @"m-1 m-2" like in Haskell but it got dropped).
I think the change should be opt-in, and we should expose 2 generators: purescript and purescript-typelevel
The text was updated successfully, but these errors were encountered:
The current PureScript generator will generate some cumbresome code:
This comes with 2 downsides:
The idea is to use type level checking (close to what https://github.com/kcsongor/purescript-safe-printf achieves):
And it could be used as follow:
This approach comes with 3 benefits:
validate
will just take the compile time string, and reflect it into the runtime realmIt also comes with 2 drawbacks:
@"m-1 m-2"
like in Haskell but it got dropped).I think the change should be opt-in, and we should expose 2 generators:
purescript
andpurescript-typelevel
The text was updated successfully, but these errors were encountered: