Skip to content

Instantly share code, notes, and snippets.

@manpages
Created August 22, 2015 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manpages/131ac1e24cc89f4d7978 to your computer and use it in GitHub Desktop.
Save manpages/131ac1e24cc89f4d7978 to your computer and use it in GitHub Desktop.
Doesn't compile with type mismatch
data AttrNS = AttrNS { localName :: String
, value :: String
, legacyName :: String
, namespaceURI :: Nullable String
, prefix :: Nullable String
, legacySpecified :: Boolean }
--
toAttrNS :: forall r. { localName :: String
, value :: String
, namespaceURI :: Nullable String
, prefix :: Nullable String
| r } ->
AttrNS
toAttrNS x = AttrNS { localName = x.localName
, value = x.value
, namespaceURI = x.namespaceURI
, prefix = x.prefix
, legacyName = x.localName
, legacySpecified = true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment