posso effettuare le seguenti operazioni:In quali scenari Haskell "legge" restituisce più di una voce di elenco?
Prelude> reads "1 2 3" :: [(Int, String)]
[(1," 2 3")]
Prelude> reads "(1,2) (3,4)" :: [((Int, Int), String)]
[((1,2)," (3,4)")]
Prelude> reads "(1,2)(3,4)" :: [((Int, Int), String)]
[((1,2),"(3,4)")]
Prelude> reads "(1,2)\n(3,4)" :: [((Int, Int), String)]
[((1,2),"\n(3,4)")]
Prelude> reads "(1,2) (3,4)" :: [((Int, Int), String)]
[((1,2)," (3,4)")]
posso ricavare Read
e ottenere letture di leggere anche quelle. Ma non ho mai letto per restituire più di una tupla nella lista. Perché reads
restituisce un elenco?
Grazie per il chiarimento. Dovevo sapere se mi mancava qualcosa. – Ana