Timeline for Generating alphanumeric combinations
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 29, 2015 at 7:51 | vote | accept | darque | ||
May 19, 2015 at 20:22 | comment | added | bisserlis |
Actually even easier, runghc -- .
|
|
May 19, 2015 at 20:16 | comment | added | bisserlis |
cat to a /tmp file, runghc that. ;-)
|
|
May 19, 2015 at 19:28 | answer | added | Petr | timeline score: 1 | |
May 19, 2015 at 15:46 | comment | added | darque |
@bisserlis that would require putting the code in another file.. and well, I can't get runghc to read from stdin: runghc - says "unrecognized flag: -", and runghc /dev/stdin says "hFileSize: inappropriate type (not a regular file)". That's why I'm using ghc -e .
|
|
May 19, 2015 at 15:44 | comment | added | darque | @maxtaldykin they output in a different order, but the strings are the same (all combinations of length 3 of alphanumeric characters). Or are supposed to be.. | |
May 19, 2015 at 7:13 | comment | added | bisserlis |
Are you maybe looking for the runghc executable called with your original non-embedded version? I.e. (I guess) for i in $(runghc combos.hs); do...
|
|
May 19, 2015 at 6:39 | comment | added | max taldykin | Is it ok that you shell code and haskell code produce different results? I.e. cross product vs. set of subsequences. | |
May 19, 2015 at 1:39 | history | edited | Jamal | CC BY-SA 3.0 |
deleted 181 characters in body; edited title
|
May 19, 2015 at 1:34 | history | edited | darque | CC BY-SA 3.0 |
edited title
|
May 19, 2015 at 1:33 | comment | added | darque | PS: this was moved to Code Review by someone else, but the question isn't "is this style fine" but "how could something like this be written in a more concise way" | |
May 19, 2015 at 1:31 | comment | added | darque |
Yes, the code actually works fine (it's part of a larger script). It's just that I feel that this should be a simpler one-liner; at the very least, I wanted to eliminate the if n == 0 .. else .. by turning the let binding into a where binding, but I couldn't figure out how to write it in one line.
|
|
May 19, 2015 at 1:09 | comment | added | Phrancis | Does your code work the way it should as presented? There are ellipsis at the end of two code blocks, which hints that this could be stub code. Please clarify! | |
May 19, 2015 at 0:57 | history | migrated | from codegolf.stackexchange.com (revisions) | ||
May 19, 2015 at 0:37 | history | asked | darque | CC BY-SA 3.0 |