English 中文(简体)
是否有轮 co式:地图、地图或<$?
原标题:Haskell coding-style: map, fmap or <$>?

是否有理由比其他人更喜欢以下的一条通知,或者这只是一个偏好的问题?

map toLower "FOO"

fmap toLower "FOO"

toLower <$> "FOO"

除此以外:我认识到,<代码><$>与`fmap'/code>相同。 假设<代码>>>> ∗ ∗ /代码”只是一种不太一般的<代码>fmap?

最佳回答

如你所说,<条码><>>/代码>是一种较一般的<条码>。 如果你知道你有一份名单,那么我会使用<条码>><>>>>>><>条码>,因为它使该代码更加清晰,如果你犯错的话,错误信息可能会减少混淆。 然而,在很大程度上,它是一个优惠问题。

<代码>(<$>>与fmap/code>相同。 在GHC 7.10 之前,由Prelude公司出口的t吨 t,即便是使用较老的GHC版本,也很容易从<代码>Data.FunctorControl.Applicative进口,这些日子正是这样做的标准方法。

问题回答

我同意Ganesh的看法,即:名单的“代码”<>>/代码”更为明确。 页: 1 因此,我使用<代码>逆向<>代码>,宣布一项功能,推翻了某些校长的所有内容,但如果我有所有论点(例如,如果我写上了<条码>的一条线/多,我倾向于使用操作表格:<条码>逆向和斜线;$> f。





相关问题
Allow user to change the default web part styles

I have a web part which uses many SharePoint controls like menu, SPGrid, tool bar etc. I want the user to be able to change the style by specifying an external CSS file. Can somebody tell me how I ...

using jqgrid style for usual Table in asp.net mvc

I d prefer using Table and td instead of JqGrid but i like JqGrid styles. has anyone used jqgrid style for usual Grid of asp.net MVC(i mean Table and td) before?

热门标签