いくつかの例で成功したCSVファイルを読み込もうとしています。これが私が持っているものです
*Main System.IO> let result=parseCSV contents
*Main System.IO> result
Right [["Name","Value","Amount"],["Rob","1","10"],["Bob","1.42","15.3"],["Tom","452.2","23.1"]]
しかし、この配列から値を読み取ろうとすると、エラーが発生します
*Main System.IO> head result
<interactive>:21:6:
Couldn't match expected type `[a0]'
with actual type `Either ParseError [[String]]'
In the first argument of `head', namely `result'
In the expression: head result
In an equation for `it': it = head result
では、Rid of the Right を取得して実際にリストを使用するにはどうすればよいでしょうか。
*Main System.IO> :t result
result :: Either ParseError [[String]]