Oh, and notice that we don't need flexible instances any more.
-HFLAGS = -O2 -XFlexibleInstances
CLEANFILES += *.hi *.hc
.SUFFIXES: .hs
.hs.o:; $(HC) -c $(HFLAGS) -o $@ $<
CLEANFILES += *.hi *.hc
.SUFFIXES: .hs
.hs.o:; $(HC) -c $(HFLAGS) -o $@ $<
--- -*-haskell-*-
---
--- Haskell implementation of a `same-fringe' solver.
+--- -*-haskell-*-
+---
+--- Haskell implementation of a `same-fringe' solver.
import IO
import System
import Monad
-----------------------------------------------------------------------------
import IO
import System
import Monad
-----------------------------------------------------------------------------
-- A very simple parser monad.
newtype Parser t a = Parser { runparse :: [t] -> Either String (a, [t]) }
-- A very simple parser monad.
newtype Parser t a = Parser { runparse :: [t] -> Either String (a, [t]) }
_ -> fail "trailing junk"
-----------------------------------------------------------------------------
_ -> fail "trailing junk"
-----------------------------------------------------------------------------
data Tree a = Leaf | Node (Tree a) a (Tree a) deriving (Show)
data Tree a = Leaf | Node (Tree a) a (Tree a) deriving (Show)
_ -> return Leaf
-----------------------------------------------------------------------------
_ -> return Leaf
-----------------------------------------------------------------------------
-- Report MSG as an error and quit.
bail msg = do
-- Report MSG as an error and quit.
bail msg = do