無限のデータ構造
まだよくわかってないのだが無限のデータ構造を表すことができる。
Main> take 10 f where f = 1:f [1,1,1,1,1,1,1,1,1,1] Main> take 10 f where f = 1:[x+1|x<-f] [1,2,3,4,5,6,7,8,9,10] Main> take 10 f where f = 2:[x*2|x<-f] [2,4,8,16,32,64,128,256,512,1024] Main> take 10 f where f = 1:[x*2|x<-f] [1,2,4,8,16,32,64,128,256,512] Main> take 10 f where f = 1:[x+2|x<-f] [1,3,5,7,9,11,13,15,17,19]