You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a useful elm package for parsing strings, replacing in an original way regexp manipulations.
This is a standard elm package, depending only on elm/core.
Practicing elm/parser for every kata which are parsing related, is the best way to get familiar to this core package of the elm language.
For example, in the Hidden "Cubic" numbers kata, char by char manipulation, or regexp manipulation, to parse 3-digit numbers verifying isDigit predicate could be done by a recursive Parser implemented by :
numbers:Parser.Parser ( ListString )
numbers =Parser.oneOf
[Parser.succeed (\i l ->if isCubic i then i::l else l )|=Parser.getChompedString
<|(Parser.succeed ()|.Parser.chompIf Char.isDigit
|.Parser.chompIf Char.isDigit
|.Parser.chompIf Char.isDigit
)|=Parser.lazy (\_ -> numbers),Parser.succeed []|.Parser.end
,Parser.succeed identity
|.Parser.chompWhile (Char.isDigit >> not)|=Parser.lazy (\_ -> numbers)]
👍 reaction might help to get this request prioritized.
The text was updated successfully, but these errors were encountered:
This is a useful elm package for parsing strings, replacing in an original way regexp manipulations.
This is a standard elm package, depending only on elm/core.
Practicing elm/parser for every kata which are parsing related, is the best way to get familiar to this core package of the elm language.
For example, in the
Hidden "Cubic" numbers
kata, char by char manipulation, or regexp manipulation, to parse 3-digit numbers verifyingisDigit
predicate could be done by a recursive Parser implemented by :👍 reaction might help to get this request prioritized.
The text was updated successfully, but these errors were encountered: