[Haskell-beginners] Attoparsec parser and maybe type

Francesco Ariis fa-ml at ariis.it
Wed Aug 29 13:06:43 UTC 2018


Hello Frederic,

On Wed, Aug 29, 2018 at 01:01:42PM +0000, PICCA Frederic-Emmanuel wrote:
> Hello, I have a type  compose of 5 doubles
> 
> data MyData = MyData Double Double Double Double Double
> 
> now I have a file to parse whcih contain this
> 
> | 1.0 2.0 3.0 4.0 5.0 | or | ---------no result ------------- |

<|> (or `choice`) is the way to do it [1]. Let us know if that worked!

[1] http://hackage.haskell.org/package/attoparsec-0.13.2.2/docs/Data-Attoparsec-Combinator.html#v:choice


More information about the Beginners mailing list