I'm a naive at Purescript, so I have a very basic issue while working with one of Purescript based frameworks.
(我对Purescript还是很幼稚,因此在使用基于Purescript的框架之一时遇到一个非常基本的问题。)
I'm using PrestoDOM
and I wonder how to use mapWithIndex
function from Data.Array
package.
(我正在使用PrestoDOM
,我想知道如何使用Data.Array
包中的mapWithIndex
函数。)
I tried like the following, (我尝试如下)
import Data.Array (mapWithIndex)
...
(mapWithIndex
((item index) -> // want to use both item and its index through loop
textView [
width MATCH_PARENT
, height WRAP_CONTENT
, text item
, visibility index > 0 ? VISIBLE : GONE
]
)
data
)
...
but I got this error:
(但是我得到了这个错误:)
Unable to parse module:
unexpected [
expecting indentation at column 1 or end of input
I know this error directly comes from my wrong use of mapWithIndex
.
(我知道此错误直接源于我对mapWithIndex
错误使用。)
ask by tom carrier translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…