Andy Melnikov (nponeccop) wrote,
Andy Melnikov
nponeccop

Загадки Парсека

Почему строка "numbers = ..." перестает компилироваться, когда xmain комментируешь?
module Main where

import Text.Parsec.Prim
import Text.Parsec.ByteString
import Text.Parsec.Char
import qualified Data.ByteString
import Data.Char

main = print "aaa"

numbers = many hexDigit

parseFromString p input
    = runP p () "test.hn0" (packL input)
    
packL = Data.ByteString.pack . map (fromIntegral . ord)
   
xmain = print $ parseFromString numbers "155ab"
Subscribe

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 24 comments