parseRuleFile :: FilePath -> IO ([(String, [String])], Rules Char)
parseRuleFile fp = do
     x <- parseFromFile entry fp
     case x of
       Left e -> error (show e)
       Right rs -> let ck = validate (snd rs)
                   in case ck of
                       ([], []) -> return rs
                       ([], xs) -> error $ "Not all positional place holders in RHS are in LHS, eg: 1<>a -> 1<>a<>2. \nAffected rules: " <> (show xs)
                       (xs, []) -> error $ "Positional place holders cannot be placed after each other, eg: 1<>2<>b -> b <> 1.\nAffected rules: " <> (show x)
                       (ds,ps) -> error $ "Positional place holders cannot be placed after each other, eg: 2<>1<>a -> 1<>a<>2\n Affected rules: " <> (show ds)
                                           <> "\n and not all place holders in RHS are in LHS, eg: 1<>2<>a -> 1<>b<>3\nAffected rules: " <> (show ps)
parseRuleFile :: FilePath -> IO ([(String, [String])], Rules Char)
parseRuleFile fp = do
     x <- parseFromFile entry fp
     case x of
       Left e -> error (show e)
       Right rs -> let ck = validate (snd rs)
                   in case ck of
                       ([], []) -> return rs
                       ([], xs) -> error $ "Not all positional place holders in RHS are in LHS, eg: 1<>a -> 1<>a<>2. \nAffected rules: " <> (show xs)
                       (xs, []) -> error $ "Positional place holders cannot be placed after each other, eg: 1<>2<>b -> b <> 1.\nAffected rules: " <> (show x)
                       (ds,ps) -> error $ "Positional place holders cannot be placed after each other, eg: 2<>1<>a -> 1<>a<>2\n Affected rules: " <> (show ds)
                                           <> "\n and not all place holders in RHS are in LHS, eg: 1<>2<>a -> 1<>b<>3\nAffected rules: " <> (show ps)
parseRuleFile fp = do
     x <- parseFromFile entry fp
     case x of
       Left e -> error (show e)
       Right rs -> let ck = validate (snd rs)
                   in case ck of
                       ([], []) -> return rs
                       ([], xs) -> error $ "Not all positional place holders in RHS are in LHS, eg: 1<>a -> 1<>a<>2. \nAffected rules: " <> (show xs)
                       (xs, []) -> error $ "Positional place holders cannot be placed after each other, eg: 1<>2<>b -> b <> 1.\nAffected rules: " <> (show x)
                       (ds,ps) -> error $ "Positional place holders cannot be placed after each other, eg: 2<>1<>a -> 1<>a<>2\n Affected rules: " <> (show ds)
                                           <> "\n and not all place holders in RHS are in LHS, eg: 1<>2<>a -> 1<>b<>3\nAffected rules: " <> (show ps)