JSod 배열이 두 배인 텍스트 필드 인 Customod 필드를 Yesod에 만들고 싶습니다. 그러나 나는 타입 에러를 계속 얻는다. 나의 현재의 시도는 다음과 같습니다Yesod 사용자 정의 필드 유형 [Double]
doubleListField :: RenderMessage master FormMessage => Field sub master [Double]
doubleListField = Field
{ fieldParse = parseHelper $ Right . decodeUtf8 . parse json
, fieldView = \theId name attrs val isReq -> toWidget [hamlet|
$newline never
<input id="#{theId}" name="#{name}" *{attrs} type="number" :isReq:required="" value="Hey">
|]
}
(올바른 공백이 발견 https://gist.github.com/4394850) : 나는 수정할 수 있습니다
Couldn't match expected type `Data.ByteString.Internal.ByteString'
with actual type `[Text]
-> m0 (Either (SomeMessage master0) (Maybe Text))'
In the second argument of `($)', namely `parseHelper $ Right'
In the `fieldParse' field of a record
In the expression:
Field
{fieldParse = parse json $ parseHelper $ Right,
fieldView = \ theId name attrs val isReq
-> toWidget (\ _render_a5Cg -> ...)}
FieldView를 나는 그것에 대해 이동하는 방법을 알고
나는 현재에 실패 해요 하지만 필드 파스 (FieldParse)가 어떻게 보일 것인가에 대해서는 난감합니다. 감사!
당신이 당신의 코드를 편집 할 수 여기에 올바른 들여 쓰기/공백을 넣으시겠습니까? – Windle
물론 나는 그것을 다른 곳으로 가져다 줄 것이며, 연결된 요지는 그것을 올바르게 가지고있다. – rortian