File: Main.hs

package info (click to toggle)
haskell-jira-wiki-markup 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 224 kB
  • sloc: haskell: 2,010; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 413 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-|
Parse Jira wiki markup from stdin.
-}
module Main (main) where

import Prelude hiding (interact)

import Control.Exception (throw)
import Data.Text (pack)
import Data.Text.IO (interact)
import System.Exit (ExitCode (ExitFailure))
import Text.Jira.Parser (parse)


main :: IO ()
main = interact parse'
  where
    parse' t = case parse t of
      Left _ -> throw (ExitFailure 1)
      Right r -> pack (show r)