@@ -79,6 +79,7 @@ data Test
79 | IsInt Int
79 | IsInt Int
80 | IsChr Text
80 | IsChr Text
81 | IsStr Text
81 | IsStr Text
82 deriving (Eq, Ord)
83 deriving (Eq, Ord)
@@ -159,6 +160,9 @@ isComplete tests =
159 IsInt _ ->
160 IsInt _ ->
164-- FLATTEN PATTERNS
168-- FLATTEN PATTERNS
@@ -227,6 +231,9 @@ flatten pathPattern@(path, A.At region pattern) otherPathPatterns =
227 Can.PInt _ ->
231 Can.PInt _ ->
228 pathPattern : otherPathPatterns
232 pathPattern : otherPathPatterns
235+ pathPattern : otherPathPatterns
231subPositions :: Path -> [Can.Pattern] -> [(Path, Can.Pattern)]
238subPositions :: Path -> [Can.Pattern] -> [(Path, Can.Pattern)]
232subPositions path patterns =
239subPositions path patterns =
@@ -338,6 +345,9 @@ testAtPath selectedPath (Branch _ pathPatterns) =
338 Can.PChr chr ->
345 Can.PChr chr ->
339 Just (IsChr chr)
346 Just (IsChr chr)
341 Can.PRecord _ ->
351 Can.PRecord _ ->
@@ -423,6 +433,14 @@ toRelevantBranch test path branch@(Branch goal pathPatterns) =
438+ IsBool testBool | bool == testBool ->
439+ Just (Branch goal (start ++ end))
426 Can.PUnit ->
444 Can.PUnit ->
427 Just (Branch goal (start ++ end))
445 Just (Branch goal (start ++ end))
@@ -497,6 +515,7 @@ needsTests (A.At _ pattern) =
497 Can.PChr _ -> True
515 Can.PChr _ -> True
498 Can.PStr _ -> True
516 Can.PStr _ -> True
499 Can.PInt _ -> True
517 Can.PInt _ -> True
518+ Can.PBool _ _ -> True
500 Can.PAlias _ _ ->
519 Can.PAlias _ _ ->
501 error "aliases should never reach 'isIrrelevantTo' function"
520 error "aliases should never reach 'isIrrelevantTo' function"
@@ -586,6 +605,7 @@ instance Binary Test where
586 IsChr a -> putWord8 4 >> put a
605 IsChr a -> putWord8 4 >> put a
587 IsStr a -> putWord8 5 >> put a
606 IsStr a -> putWord8 5 >> put a
588 IsInt a -> putWord8 6 >> put a
607 IsInt a -> putWord8 6 >> put a
608+ IsBool a -> putWord8 7 >> put a
591 do word <- getWord8
611 do word <- getWord8
@@ -597,6 +617,7 @@ instance Binary Test where
597 4 -> liftM IsChr get
617 4 -> liftM IsChr get
598 5 -> liftM IsStr get
618 5 -> liftM IsStr get
599 6 -> liftM IsInt get
619 6 -> liftM IsInt get
620+ 7 -> liftM IsBool get
600 _ -> error "problem getting DecisionTree.Test binary"
621 _ -> error "problem getting DecisionTree.Test binary"