Last active
October 6, 2016 22:15
-
-
Save parambirs/c1a29352e28e0856bace3ab0be4575c4 to your computer and use it in GitHub Desktop.
GHC
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
| putStrLn | |
| putStr | |
| putChar | |
| getChar | |
| sequence | |
| mapM | |
| mapM_ | |
| Control.Monad: | |
| when | |
| forever | |
| forM | |
| -- FILES and STREAMS | |
| getContents | |
| interact | |
| readFile | |
| writeFile | |
| appendFile | |
| openFile | |
| hGetContents | |
| hClose | |
| withFile | |
| hGetLine | |
| hGetChar | |
| hPutStr | |
| hPutStrLn | |
| hSetBuffering | |
| hFlush | |
| openTempFile | |
| removeFile | |
| renameFile | |
| getCurrentDirectory | |
| doesFileExist | |
| -- COMMAND LINE ARGUMENTS | |
| import System.Environment | |
| getArgs | |
| getProgName | |
| -- RANDOM | |
| import System.Random | |
| random | |
| mkStdGen | |
| randoms | |
| randomR | |
| randomRs | |
| getStdGen | |
| newStdGen | |
| -- BYTESTRINGS | |
| import qualified Data.ByteString.Lazy as B | |
| import qualified Data.ByteString as S | |
| pack | |
| unpack | |
| fromChunks | |
| toChunks | |
| cons | |
| cons' | |
| empty | |
| readFile | |
| -- EXCEPTIONS | |
| import System.IO.Error | |
| catchIOError | |
| ioError | |
| userError | |
| isAlreadyExistsError | |
| isDoesNotExistError | |
| isAlreadyInUseError | |
| isFullError | |
| isEOFError | |
| isIllegalOperation | |
| isPermissionError | |
| isUserError | |
| ioeGetFileName |
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
| read | |
| reads |
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
| # Run a haskell file directly | |
| $ runhaskell helloworld.hs | |
| # Open GHCi (REPL) | |
| $ ghci | |
| # Compile file to binary | |
| $ ghc --make helloworld | |
| # GHCI: Get type of a function | |
| :t toUpper | |
| toUpper :: Char -> Char |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment