Re: [比較] 我為何鍾情於用 Scala 做為兵刃(三)

作者: godfat (godfat 真常)   2011-07-11 22:23:32
※ 引述《scwg ( )》之銘言:
: ※ 引述《huei1224 (渣)》之銘言:
: : 最近在學 haskell ,發現 haskell 也可以寫成像上面的型式,分享一下
: : let x -: f = f x
: : let xs = [-3..3]
: : let square = (^2)
: : let isGreaterThan5 = (>5)
: : let result = xs -: map square -: filter isGreaterThan5 -: length
: :
作者: scwg ( )   2011-07-12 02:21:00
Good thinking :) It's just that I think it's more naturalto learn monad before arrow/category.
作者: godfat (godfat 真常)   2011-07-12 04:41:00
true, thanks! actually i don't really get arrow yet..
作者: ccshan (善終結)   2011-07-12 05:34:00
flip ($) xs = ($ xs)
作者: godfat (godfat 真常)   2011-07-12 15:18:00
good point, thanks!

Links booklink

Contact Us: admin [ a t ] ucptt.com