Skip to content

Instantly share code, notes, and snippets.

@metaperl
Created August 23, 2010 20:37
Show Gist options
  • Select an option

  • Save metaperl/546280 to your computer and use it in GitHub Desktop.

Select an option

Save metaperl/546280 to your computer and use it in GitHub Desktop.
myflat([],[]).
myflat([H|T], AllFlat) :- is_list(H), myflat(H, HFlat), myflat(T, TFlat), append(HFlat, TFlat, AllFlat).
myflat([H|T], [H|TFlat]) :- myflat(T,TFlat).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment