Code Monkey home page Code Monkey logo

parsero's People

Contributors

appositum avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sqdorte

parsero's Issues

New Char functions

  • tab :: Parser Char
  • newline :: Parser Char
  • anyChar :: Parser Char
  • notChar :: Char -> Parser Char

New tokenizer parser functions

  • symbolic :: Char -> Parser Char
  • braces :: Parser a -> Parser a (between {})
  • brackets :: Parser a -> Parser a (between [])
  • parens :: Parser a -> Parser a (between ())
  • angles :: Parser a -> Parser a (between <>)
  • comma :: Parser Char
  • colon :: Parser Char
  • dot :: Parser Char
  • semicolon :: Parser Char
  • integerOrDouble :: Parser (Either Integer Double)
  • naturalOrDouble :: Parser (Either Integer Double)
  • charLiteral :: Parser Char
  • stringLiteral :: Parser String
  • stringLiteral' :: Parser String (single quotes)

nix-shell loads ghci twice

cuceta  master $ nix-shell
        Preprocessing library for cuceta-0.1.0.0..
GHCi, version 8.4.4: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/eddie/.ghci
[1 of 6] Compiling Paths_cuceta     ( dist/build/autogen/Paths_cuceta.hs, interpreted )
[2 of 6] Compiling Text.Cuceta.Parser ( src/Text/Cuceta/Parser.hs, interpreted )
[3 of 6] Compiling Text.Cuceta.Combinators ( src/Text/Cuceta/Combinators.hs, interpreted )
[4 of 6] Compiling Text.Cuceta.Char ( src/Text/Cuceta/Char.hs, interpreted )
[5 of 6] Compiling Text.Cuceta.Tokenizer ( src/Text/Cuceta/Tokenizer.hs, interpreted )
[6 of 6] Compiling Text.Cuceta      ( src/Text/Cuceta.hs, interpreted )
Ok, six modules loaded.
λ> :q
Leaving GHCi.
Preprocessing library for cuceta-0.1.0.0..
GHCi, version 8.4.4: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/eddie/.ghci
[1 of 6] Compiling Paths_cuceta     ( dist/build/autogen/Paths_cuceta.hs, interpreted )
[2 of 6] Compiling Text.Cuceta.Parser ( src/Text/Cuceta/Parser.hs, interpreted )
[3 of 6] Compiling Text.Cuceta.Combinators ( src/Text/Cuceta/Combinators.hs, interpreted )
[4 of 6] Compiling Text.Cuceta.Char ( src/Text/Cuceta/Char.hs, interpreted )
[5 of 6] Compiling Text.Cuceta.Tokenizer ( src/Text/Cuceta/Tokenizer.hs, interpreted )
[6 of 6] Compiling Text.Cuceta      ( src/Text/Cuceta.hs, interpreted )
Ok, six modules loaded.
λ> :q
Leaving GHCi.

[nix-shell:~/Desktop/cuceta]$

Change `Parser` type name to `Parsero`

The Parser type takes two arguments: the stream type and the result type. That leads to all parser functions being written like this: p :: Stream s => Parser s a. Changing the constructor to Parsero/MkParsero would let us define a type synonym specifying which stream type we want to use, avoiding repetition: type Parser = Parsero Text

New parser combinators

  • choice :: [Parser a] -> Parser a
  • option :: a -> Parser a -> Parser a
  • surroundedBy :: Parser a -> Parser s -> Parser a
  • try :: Parser a -> Parser a
  • sepBy :: [Parser a] -> Parser a
  • sepBy1 :: [Parser a] -> Parser a
  • eol :: Parser Char

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.