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
Here is how the Alex parser for monad-bytestring looks:
newtypeAlexa=Alex{unAlex::AlexState->EitherString (AlexState, a) }-- monad-bytestring wrapperdataAlexState=AlexState{alex_pos::!AlexPosn, -- position at current input locationalex_bpos::!Int64, -- bytes consumed so faralex_inp::ByteString.ByteString, -- the current inputalex_chr::!Char, -- the character before the inputalex_scd::!Int-- the current startcode
, alex_ust::AlexUserState-- AlexUserState will be defined in the user program}
It seems this sort of unboxing experiment is not so far out of reach for a wrapper that could produce potentially very fast code. On top of that, as it is user-generated code it seems reasonable that it might be quite horrid to actually read. How feasible would it be to add a wrapper inspired by parsnip?
The text was updated successfully, but these errors were encountered:
There is a nice library by Ed Kmett called parsnip: https://hackage.haskell.org/package/parsnip-0/
This represents a parser as follows:
Here is how the Alex parser for monad-bytestring looks:
It seems this sort of unboxing experiment is not so far out of reach for a wrapper that could produce potentially very fast code. On top of that, as it is user-generated code it seems reasonable that it might be quite horrid to actually read. How feasible would it be to add a wrapper inspired by parsnip?
The text was updated successfully, but these errors were encountered: