0

Let's say, I have a list of lists: [ [a,b],[c,d],[e,f] ]. How can I convert to [a,b,c,d,e,f]? Thank you in advance!

Vitalii
  • 25
  • 1
  • 5
  • Most Prolog's come with a flatten/2 predicate in their list libraries. If yours doesn't, you can always check the source of SWI in their docs: https://www.swi-prolog.org/pldoc/doc/_SWI_/library/lists.pl?show=src#flatten/2 – Paul Brown Apr 24 '20 at 13:14
  • @PaulBrown: `flatten/2` succeeds for `flatten([[[a]]],[a])` – false Apr 24 '20 at 14:55
  • Thank you! It works – Vitalii Apr 25 '20 at 18:09

0 Answers0