I did a small part of haskell programming using GHCI, however our next task requires us to use only GHC to compile and test our code.
Due to how ghci works compared to ghc, you probably need to use the main function, and ghc looks for this function in your code.
My question is: if Haskell promotes type safety and no side effects, if only as part of the IO action, why should the bulk of any haskell program be an IO action?
Forgive me if I do not understand something fundamental, I just could not find any resources that ultimately explain this.
main IO, , , . Haskell , () , , , , . , - , , , - -, , . ,
main
IO
main :: Int main = 1 + 1
, , ? , main, , Haskell , , 1 + 1 - , . , -, , , IO.
1 + 1
, . /.
Haskell - - .
, - , , IO - , - , - ? , -, -, -, - . , .
Source: https://habr.com/ru/post/1584281/More articles:ReactiveCocoa Issue - iosSpring data - embed data depending on previous insertion - javaSPRING JPA with Hibernate updating all instances of an entity, even if the save is called with a single object - springDocker auto-build shows empty Dockerfile - dockerGeneral variable with raspberry GPIO callback function - pythonCommand Commands in the Laravel Artisan Scheduler? - phpHow to specify ServiceHostFactory for a standalone WCF service without an SVC file - c #Расширение рекурсивных функций в Coq - computer-scienceWhere can I find the default Realm database file - androidCreating a binary tree from a list of lists in Python - pythonAll Articles