HaskellZhangSong / Introduction_to_Haskell

This is source code of my book.
67 stars 12 forks source link

P183 Applicative and MonoidApplicative ,Manod是自函子上半幺群,形式上就无法理解 #12

Open boboyada opened 7 years ago

boboyada commented 7 years ago

读该节时,有困惑。 (S,M,1) M是二元运算符。 (Int,+ ,0)
(Int,× ,1) 都好理解。

但Applicative ,Manod是自函子上半幺群,形式上就无法理解

比如:MayBe Int 二元运算符:是什么? 单位元:又是什么? 二元运算运算对象:是什么?

<*> Just (+1) Just (5) 运算对象就不同,一个是包装了函数,另一个包装了数值

= Maybe(5) /x => x+1 ,运算对象也不同

boboyada commented 7 years ago

对于单子上的(S,M,1)来讲