Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6678479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:14:53+00:00 2026-05-26T04:14:53+00:00

I have parsed a json list and it comes out with each element like:

  • 0

I have parsed a json list and it comes out with each element like:

{struct,
 [
  {<<"name">>, "<<a name>>"},
  {<<"id">>, "<<an id>>""}
 ]
}

I would like to specify this as a type, but I get an error with the following, presumably because I’m using two elements in the list definition:

-type user_data() :: {struct, [{Name_key::Binary, Name_value::Binary},{ID_key::Binary, ID_value::Binary}]}.

Is there any way to do what I’m trying to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:14:54+00:00Added an answer on May 26, 2026 at 4:14 am

    You can do

    -type user_data() :: {struct, [{Name_key::binary(), Name_value::binary()}|{ID_key::binary(), ID_value::binary()}]}.
    

    meaning a list every element of which is either a {Name_key::binary(), Name_value::binary()} or an {ID_key::binary(), ID_value::binary()}. This isn’t quite what you want but may be good enough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have parsed XML file into objects, in which each object has a 1:1
I use this bit of code to feed some data i have parsed from
I have a byte stream I need parsed into a struct, and I also
I have a returned JSON string which I have parsed and put through into
I have successfully parsed my json images and displayed the response as image ,however
I have the following controller code that returns a Json list object to my
I have no problems getting the Json to work and parse the json return.
I have parsed XML using both of the following two methods... Parsing the XmlDocument
I have two dates (parsed using str2time ). How can I tell if one
I have a thousands of data parsed from huge XML to be inserted into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.