Commit 5b0887af authored by Michael Hanus 's avatar Michael Hanus
Browse files

Code refactoring

parent b6b167da
......@@ -74,17 +74,13 @@ list2Func (Func abs) x = maybe (if null abs then failed else snd (head abs))
genFunction :: Eq a => SearchTree.SearchTree a -> SearchTree.SearchTree b
-> SearchTree.SearchTree (a -> b)
genFunction gena genb =
mapST l2f (genNEList (SearchTreeGenerators.genPair gena genb))
SearchTreeGenerators.genCons1 l2f
(genNEList (SearchTreeGenerators.genPair gena genb))
l2f abs x = maybe (if null abs then failed else snd (head abs))
(lookup x abs)
mapST :: (a -> b) -> SearchTree.SearchTree a -> SearchTree.SearchTree b
mapST f (SearchTree.Value a) = SearchTree.Value (f a)
mapST _ (SearchTree.Fail n) = SearchTree.Fail n
mapST f (SearchTree.Or t1 t2) = SearchTree.Or (mapST f t1) (mapST f t2)
instance (Show a, Show b) => Show (a -> b) where
show f = "<<function>>"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment