Created
May 11, 2016 21:09
-
-
Save cobalamin/6fc45dd81844f7788b2d77f56564cc7f to your computer and use it in GitHub Desktop.
The Glorious Good Job Haskell Compiler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### THE GLORIOUS GOOD JOB HASKELL COMPILER | |
| compliments=( | |
| "Wow, what a monad!" | |
| "Outstanding work with the types." | |
| "You look beautiful today, and so does your code." | |
| "Hey, that's pretty good." | |
| "Nice meme." | |
| "\"If it compiles, it works\"? -- Well, I'm just the compiler, what would I know. But it did compile, so, well done." | |
| "Live long and prosper." | |
| "YEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | |
| "Stylish indentation!" | |
| "No need for code highlighting, your code's the highlight." | |
| ) | |
| ## | |
| # Check if stack exists, and use "stack ghc" or "ghc" depending on the result | |
| ## | |
| command -v stack | |
| if [ $? -eq 0 ]; then | |
| stack ghc "$@" | |
| else | |
| ghc "$@" | |
| fi | |
| ## | |
| # After running GHC, get its exit code. If it was a success, compliment! | |
| ## | |
| if [ $? -eq 0 ]; then | |
| c=${compliments[$RANDOM % ${#compliments[@]} ]} | |
| echo | |
| echo "$c" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment