Pergunta

Código em helloworld.hs:

.

main= do
Putstrln "Olá, qual é o seu nome?" Nome <- Getline
Putstrln ("Hey" ++ Nome ++ ", Rock!")

Aplicativo testado no terminal:

.

otimight @ightight: ~ $ GHC --make helloworld [1 de 1] compilando principal (helloworld.hs, helloworld.o)
Vinculando Helloworld ...
@ightight @ightight: ~ $ ./Helloworld
Olá, qual é o seu nome?
John
. Ei John, você balança!

helloworld.hs carregado no Emacs - Haskell Maior modo:

.

ghci, versão 7.4.1: http://www.haskell.org/ghc/ :? para ajuda
Pacote de carregamento GHC-Prim ... Linking ... Feito.
Carregando o pacote INTEGER-GMP ... Linking ... Feito.
Carregando a base do pacote ... Linking ... feito.
Prelúdio>: Carregar "/home/optimight/helloworld.hs"
[1 de 1] compilando principal (/ home/optimight/helloworld.hs, interpretado)
OK, módulos carregados: Principal.
* Principal>

Agora, Como (o que é o procedimento?) Teste-o no Emacs - Ambiente do Modo Haskell? (Acredito, enquanto estou usando o Emacs - Modo Haskell, não deve haver necessidade de alternar para o terminal.)

Foi útil?

Solução


.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top