X-Git-Url: https://git.distorted.org.uk/~mdw/fringe/blobdiff_plain/e4e035bf5fd8c6d99eecff9db55cdd4a4b069fbe..8a4f4f075a6e2e90039b172242097a4eca48d60b:/haskell-fringe.hs diff --git a/haskell-fringe.hs b/haskell-fringe.hs index 4ca9a3e..f7aa711 100644 --- a/haskell-fringe.hs +++ b/haskell-fringe.hs @@ -1,13 +1,13 @@ --- -*-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]) } @@ -56,7 +56,7 @@ eof = do _ -> fail "trailing junk" ----------------------------------------------------------------------------- --- Tree data type. +--- Tree data type. data Tree a = Leaf | Node (Tree a) a (Tree a) deriving (Show) @@ -85,7 +85,7 @@ parseTree cs = parse cs $ do t <- tree; eof; return t _ -> return Leaf ----------------------------------------------------------------------------- --- Main program. +--- Main program. -- Report MSG as an error and quit. bail msg = do