-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsertsort.hs
32 lines (28 loc) · 889 Bytes
/
insertsort.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Test.Speculate
import Data.List (sort,insert)
ordered :: Ord a => [a] -> Bool
ordered (x:y:xs) = x <= y && ordered (y:xs)
ordered _ = True
main :: IO ()
main = speculate args
{ constants =
[ background
, constant "False" False
, constant "True" True
, showConstant ([] :: [Int])
, constant ":" $ (:) -:> int
, constant "++" $ (++) -:> [int]
, constant "elem" $ elem ->:> [int]
, constant "ordered" $ ordered -:> [int]
, constant "all" $ all ->:> [int]
, foreground
, constant "insert" $ insert -:> int
, constant "sort" $ sort -:> [int]
, background
, constant "==" $ (==) -:> int
, constant "<=" $ (<=) -:> int
, constant "<" $ (<) -:> int
]
, maxVars = 2
, showConditions = True
}