安装(Glasgow Haskell Compiler)

sudo apt-get install ghc

进入shell

ghci      

hello.hs

module Main where
import System.Environment
 
main :: IO ()
main = do
    args <- getArgs
    putStrLn ("Hello, " ++ args !! 0)

compiler & exec

$ ghc -o hello --make hello.hs 
[1 of 1] Compiling Main             ( hello.hs, hello.o )
Linking hello ...
$ ./hello  haskell
hello, haskell

 

 

相关文章:

  • 2021-09-14
  • 2021-10-04
  • 2021-06-07
  • 2021-10-04
  • 2021-08-06
  • 2021-07-26
  • 2021-08-10
猜你喜欢
  • 2021-08-20
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-08-25
相关资源
相似解决方案