[Haskell-cafe] Is there already a lib to parse a line of string with a pattern and generate key-value map or a record?

Vanessa McHale vanessa.mchale at iohk.io
Wed Apr 17 12:11:02 UTC 2019


I would use Dhall: https://dhall-lang.org/

(I can answer questions but the documentation is reasonably good)

Cheers,
Vanessa

On 4/17/19 4:29 AM, Magicloud Magiclouds wrote:
> Hi,
>
> I saw this function in some web tools, pretty useful when parsing log
> or so. So I wonder if Haskell has similar libs already.
>
> Sample:
>
> Input line: "2019/04/17 17:27 User magicloud runs command ls."
>
> Pattern: "${year}/${month}/${day} ${hour}:${minute} User ${username}
> runs command ${command}."
>
> Output: toList [ ("year", "2019"), ("month", "04") , etc ]
>
> --
> 竹密岂妨流水过
> 山高哪阻野云飞
>
> And for G+, please use magiclouds#gmail.com.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190417/c3985d45/attachment.sig>


More information about the Haskell-Cafe mailing list