[Haskell-beginners] Haskell REPL doesn't accept type declaration

Francesco Ariis fa-ml at ariis.it
Thu Dec 10 22:08:08 UTC 2020


Il 10 dicembre 2020 alle 15:41 Lawrence Bottorff ha scritto:
> Yes, but a simple
> 
> λ> prova :: Int
> 
> doesn't work. What am I missing?

No idea the reason why ghci does not accept it, maybe because if it did
there would be a bodyless signature in scope?

Also maybe this is slightly more palatable for you:

    λ> :set +m
    λ> let prova :: Int -> String
           prova = show
    [blank line]
    λ> prova 7
    "7"




More information about the Beginners mailing list