https://github.com/bapjiws/haskell-permutations
Finding a list's permutations using only simple stuff from Prelude like concat, map, head, and tail
https://github.com/bapjiws/haskell-permutations
Last synced: 2 months ago
JSON representation
Finding a list's permutations using only simple stuff from Prelude like concat, map, head, and tail
- Host: GitHub
- URL: https://github.com/bapjiws/haskell-permutations
- Owner: bapjiws
- Created: 2015-10-17T13:46:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-05T13:17:10.000Z (over 9 years ago)
- Last Synced: 2025-01-28T16:44:20.389Z (4 months ago)
- Language: Haskell
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The **permute** function works like so:
GHCi> permute [1,2,3,4]
[[1,2,3,4],[1,2,4,3],[1,3,4,2],[1,3,2,4],[1,4,2,3],[1,4,3,2],[2,3,4,1],[2,3,1,4],[2,4,1,3],[2,4,3,1],[2,1,3,4],[2,1,4,3],[3,4,1,2],[3,4,2,1],[3,1,2,4],[3,1,4,2],[3,2,4,1],[3,2,1,4],[4,1,2,3],[4,1,3,2],[4,2,3,1],[4,2,1,3],[4,3,1,2],[4,3,2,1]]