Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning to mkSProxies #77

Merged
merged 1 commit into from
Oct 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Formless/Transform/Row.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Formless.Internal.Transform (class Row1Cons, FromScratch, fromScratch)
import Formless.Types.Form (InputField(..))
import Prim.Row as Row
import Prim.RowList as RL
import Prim.TypeError (class Warn, Text)
import Record.Builder as Builder
import Type.Proxy (Proxy(..))

Expand Down Expand Up @@ -68,9 +69,13 @@ type SProxies form =

-- | A helper function to produce a record of SProxies given a form spec, to save
-- | you the boilerplate of writing them all out.
-- |
-- | WARNING: This can create significant code bloat, and it is not recommended
-- | for production use.
mkSProxies
:: forall form xs inputs row
. RL.RowToList inputs xs
. Warn (Text "This function is not recommended for use in production settings due to large amounts of generated code.")
=> RL.RowToList inputs xs
=> Newtype (form Record InputField) (Record inputs)
=> MakeSProxies xs row
=> Proxy form
Expand Down