Skip to content

Instantly share code, notes, and snippets.

@ChrisMLee
Created September 30, 2017 15:51
Show Gist options
  • Save ChrisMLee/63bf0b69575ec8daed26faa70d6e1cba to your computer and use it in GitHub Desktop.
Save ChrisMLee/63bf0b69575ec8daed26faa70d6e1cba to your computer and use it in GitHub Desktop.
grabbing a nested "result" property
newtype Result =
Result { goalsHomeTeam :: Number
, goalsAwayTeam :: Number
}
newtype Fixture =
Fixture { _links:: LinkGroup
, date:: String
, status:: String
, matchday:: Number
, homeTeamName:: String
, awayTeamName:: String
, result :: Result
}
fixtureComponent :: forall s p i. Fixture -> H.HTML p i
fixtureComponent (Fixture f) = HH.div_ [
HH.text f.homeTeamName
, HH.text f.result.goalsHomeTeam
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment