Statically typed languages are such hell when you're using dynamically defined structures. I immediately miss Javascript's JSON.parse and how easy it is to dynamically search data.

@mauve so while I generally agree, have you had any experience with the Haskell json libraries? Aeson in particular has some applicative interfaces that make some of this a little bit less painful:

instance FromJSON Person where
parseJSON = withObject "Person" $ \v -> Person
<$> v .: "name"
<*> v .: "age"

Follow

@quinn Interesting, I actuslly haven't done any haslell stuff. In this case I'm using golang and it's giving me flashbacks to using Java back in the day :P

@quinn this still requires knowing the fields at compile time right?

Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.