Haskell packages


Info on some haskell packages.


Hedgehog

See:

Megaparsec

Monad transformer: Think of it as a function taking a monad and returning another monad.

Parsec e inp res = ParsecT e inp Identity res

-- Parser res = Parsec Void Text res
type Parser = Parsec Void Text

Parser a means a parser whose result after successful parsing is of type a.


import Data.Void

--                         +-- Input type
--                         |
--                         v
type Parser = Parsec Void Text
--                    ^
--                    |
--                Error component

Info

Functions

Operator table

From https://markkarpov.com/tutorial/megaparsec.html:

data Operator m a
  = InfixN  (m (a -> a -> a)) -- ^ Non-associative infix
  | InfixL  (m (a -> a -> a)) -- ^ Left-associative infix
  | InfixR  (m (a -> a -> a)) -- ^ Right-associative infix
  | Prefix  (m (a -> a))      -- ^ Prefix
  | Postfix (m (a -> a))      -- ^ Postfix

See: