A lot of small changes, added better error messages for bugs mainly
This commit is contained in:
parent
5e1c81beb7
commit
6260dc2c41
10 changed files with 37 additions and 39 deletions
|
|
@ -6,13 +6,6 @@ data Maybe a where
|
|||
Nothing : Maybe a
|
||||
Just : a -> Maybe a
|
||||
|
||||
data Pair a b where
|
||||
Pair : a -> b -> Pair a b
|
||||
|
||||
data List a where
|
||||
Nil : List a
|
||||
Cons : a -> List a -> List a
|
||||
|
||||
empty = Empty
|
||||
|
||||
singleton x = Node Empty x Empty
|
||||
|
|
@ -35,7 +28,3 @@ merge tree1 tree2 = case tree1 of
|
|||
Empty => tree2
|
||||
|
||||
insert x tree = merge (singleton x) tree
|
||||
|
||||
main = case peek (insert 1 (insert 2 (insert 3 (singleton 4)))) of
|
||||
Nothing => (0 - 1)
|
||||
Just x => x
|
||||
|
|
|
|||
|
|
@ -42,13 +42,3 @@ descList from to = case to < from of
|
|||
|
||||
main = let list = (5 :: (2 :: (8 :: (9 :: (6 :: (0 :: (1 :: Nil)))))))
|
||||
in printStr (toStr (quicksort list))
|
||||
|
||||
{-
|
||||
|
||||
-- Program output --
|
||||
0125689
|
||||
In dispose
|
||||
Out dispose
|
||||
ExitSuccess
|
||||
|
||||
-}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue