# Pastebin v3bo6QbJ data Scenario = Scenario { applicants :: Applicant } deriving (Eq, Show, Generic, Aeson.ToJSON, Aeson.FromJSON) data Applicant = Applicant { field1 :: Int, field2 :: Text } deriving (Eq, Show, Generic, Aeson.ToJSON, Aeson.FromJSON) instance FromForm Scenario where fromForm f = do field1 <- parseUnique "applicants" f field2 <- parseUnique "applicants.x" f -- Needs {-# LANGUAGE NamedFieldPuns #-} at the top of the file -- Alternative: -- pure Scenario -- { applicants = Applicant { field1 = field1, field2 = field2 } -- } pure Scenario {applicants = Applicant {field1, field2}}