资源描述:
《Real World Haskell.pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、RealWorldHaskellRealWorldHaskellBryanO’Sullivan,JohnGoerzen,andDonStewartBeijing•Cambridge•Farnham•Köln•Sebastopol•Taipei•TokyoRealWorldHaskellbyBryanO’Sullivan,JohnGoerzen,andDonStewartCopyright©2009BryanO’Sullivan,JohnGoerzen,andDonaldStewart.Allrightsreserved.PrintedintheUnitedStatesofAmerica
2、.PublishedbyO’ReillyMedia,Inc.,1005GravensteinHighwayNorth,Sebastopol,CA95472.O’Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://safari.oreilly.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:(800)9
3、98-9938orcorporate@oreilly.com.Editor:MikeLoukidesIndexer:JoeWizdaProductionEditor:LoranahDimantCoverDesigner:KarenMontgomeryCopyeditor:MaryBradyInteriorDesigner:DavidFutatoProofreader:LoranahDimantIllustrator:RobertRomanoPrintingHistory:November2008:FirstEdition.NutshellHandbook,theNutshellHand
4、booklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,Inc.RealWorldHaskell,theimageofarhinocerosbeetle,andrelatedtradedressaretrademarksofO’ReillyMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappeari
5、nthisbook,andO’ReillyMedia,Inc.wasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcaps.Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcon-tainedherein.T
6、MThisbookusesRepKover™,adurableandflexiblelay-flatbinding.ISBN:978-0-596-51498-3[M]1226696198ToCian,Ruairi,andShannon,fortheloveandjoytheybring.—BryanFormywife,Terah,withthanksforallherlove,encouragement,andsupport.—JohnToSuzie,forherloveandsupport.—DonTableofContentsPreface.....................
7、..............................................xxiii1.GettingStarted.........................................................1YourHaskellEnvironment1GettingStartedwithghci,theInterpreter2BasicInteraction:UsingghciasaCalculato