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