File: Parse.hs

package info (click to toggle)
haskell-tagstream-conduit 0.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 96 kB
  • sloc: haskell: 436; makefile: 3
file content (16 lines) | stat: -rw-r--r-- 434 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Data.Maybe
import System.Environment
import Text.HTML.TagStream
import qualified Data.Conduit as C
import qualified Data.Conduit.Binary as C
import qualified Data.Conduit.List as CL

main :: IO ()
main = do
    args <- getArgs
    filename <- maybe (fail "pass file path") return (listToMaybe args)
    _ <- C.runResourceT $
           C.sourceFile filename
           C.$= tokenStream
           C.$$ CL.consume
    return ()