Learn Type:Driven Development
Type-drivendevelopmentisanapproachthatusesastatictypesystemtoachieveresultsincludingsafetyandefficiency.Typesareusedtoexpressrelationshipsandotherassumptionsdirectlyinthecode,andtheseassumptionsareenforcedbythecompilerbeforethecodeisrun.LearnType-DrivenDevelopmentcovershowtousethesetypesystemstocheckthelogicalconsistencyofyourcode.Thisbookbeginswiththebasicideabehindtype-drivendevelopment.You’lllearnaboutvalues(orterms)andhowtheycontrastwithtypes.Asyouprogressthroughthechapters,you’llcoverhowtocombinetypesandvaluesinsidemodulesandbuildstructuredtypesoutofsimplerones.You’llthenunderstandhowtoexpresschoicesoralternativesdirectlyinthetypesystemusingvariants,polymorphicvariants,andgeneralizedalgebraicdatatypes.You’llalsogettogripswithsumtypes,buildsophisticateddatatypesfromgenerics,andexplorefunctionsthatexpresschangeinthetypesofvalues.Intheconcludingchapters,you’llcoveradvancedtechniquesforcodereuse,suchasparametricpolymorphismandsubtyping.Byendofthisbook,youwillhavelearnedhowtoiteratethroughatype-drivenprocessofsolvingcodingproblemsusingstatictypes,togetherwithdynamicbehavior,toobtainmoresafetyandspeed.
·4.1萬字