Copyright | Copyright (C) 2023 Yoo Chung |
---|---|

License | GPL-3.0-or-later |

Maintainer | dev@chungyc.org |

Safe Haskell | Safe-Inferred |

Language | GHC2021 |

Some solutions to Problems.P07 of Ninety-Nine Haskell Problems.

## Synopsis

- flatten :: NestedList a -> [a]
- flatten' :: NestedList a -> [a]

# Documentation

flatten :: NestedList a -> [a] Source #

Transform a list, possibly holding lists as elements, into a "flat" list by replacing each list with its elements recursively.

Recursively flatten lists and concatenate them together.

flatten' :: NestedList a -> [a] Source #

Transform a list, possibly holding lists as elements, into a "flat" list by replacing each list with its elements recursively.

Build the list starting from the last one, prepending each element one at a time.