Personal tools

Cum se impaca ordinea secventiala cu atribuirea ?

From HaskellWiki

Revision as of 20:55, 16 July 2011 by Ha$kell (Talk | contribs)

Jump to: navigation, search


Teoria spune ca se impaca, si , ca dovada, in do-notatia care seamana cu programarea imperativa avem ceva oarecum similar cu atribuirile desi se numesc Generatori.

import Data.Char 
 
main = do { c <- getChar ;
            b <- val (ord c) ;
            a <- val 1 ;
            print (a+b);
            return 0 }
       where val = return