diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-03-12 02:17:25 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-03-12 02:17:25 +1100 |
commit | b5ff89d417c73d74a42a1756cb3ecd99b7a3e7f4 (patch) | |
tree | 97bf2d3ad4e5eac7aec320b932ccf09fdf127871 /Library/TermNet.hs | |
parent | ef81889c1eccb08acc27d47c9df652541134e3db (diff) |
Removed some superfluous lambdas in intermediate functions
Diffstat (limited to 'Library/TermNet.hs')
-rw-r--r-- | Library/TermNet.hs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Library/TermNet.hs b/Library/TermNet.hs index 6d87aa9..16b5446 100644 --- a/Library/TermNet.hs +++ b/Library/TermNet.hs @@ -33,7 +33,8 @@ import qualified Library.Stack as Stack -data TermNet = Leaf [(Theorem, Node)] | Branch [(String, TermNet)] deriving (Eq, Show) +data TermNet = Leaf [(Theorem, Node)] | Branch [(String, TermNet)] + deriving (Eq, Show) @@ -72,12 +73,15 @@ getBranchList net = genThm :: PGraph -> Node -> Theorem genThm graph node = - let gen = (\g n num -> let edge = filter (\x -> (fst . thd3 $ x) == num) (Graph.out g n) - node = (snd3 . head $ edge) - listing = write g node - in fromJust (((\(a,_,_,_) -> a) . fromJust $ (eval listing)) `at` 0)) + let gen g n num = + let edge = filter (\x -> (fst . thd3 $ x) == num) (Graph.out g n) + node = (snd3 . head $ edge) + listing = write g node + in fromJust (((\(a,_,_,_) -> a) . fromJust $ (eval listing)) `at` 0) + hypList = map (fromJust . objTerm) (fromJust . objList $ (gen graph node 2)) con = fromJust . objTerm $ (gen graph node 1) + in Theorem (Set.fromList hypList) con @@ -102,7 +106,7 @@ termToTermString term = thmToTermString :: Theorem -> [String] thmToTermString theorem = let hypList = Set.toList (thmHyp theorem) - f = (\soFar hyp -> soFar ++ ["hyp"] ++ (termToTermString hyp)) + f soFar hyp = soFar ++ ["hyp"] ++ (termToTermString hyp) in (foldl' f [] hypList) ++ ["con"] ++ (termToTermString . thmCon $ theorem) |