|
|
|
|
|
by Tarean
3246 days ago
|
|
That's reasonably similar to handwritten haskell json parsing: instance FromJson HintTemplate where
parseJson = withObject $ \o ->
HintTemplate
<$> o .: "ID"
<*> o .: "Text"
<*> o .: "Image"
I wrote <$> and <> out but there is a definition like map3: liftA3 f a b = f <$> a <*> b
This works for all applicatives, though. Is it normal for elm libraries to copy paste code like the map3 definition? |
|