--- -*-haskell-*-
---
--- Haskell implementation of a `same-fringe' solver.
+--- -*-haskell-*-
+---
+--- Haskell implementation of a `same-fringe' solver.
import IO
import System
import Monad
-----------------------------------------------------------------------------
--- Parser combinators.
+--- Parser combinators.
-- A very simple parser monad.
newtype Parser t a = Parser { runparse :: [t] -> Either String (a, [t]) }
_ -> fail "trailing junk"
-----------------------------------------------------------------------------
--- Tree data type.
+--- Tree data type.
data Tree a = Leaf | Node (Tree a) a (Tree a) deriving (Show)
_ -> return Leaf
-----------------------------------------------------------------------------
--- Main program.
+--- Main program.
-- Report MSG as an error and quit.
bail msg = do