on master help sign in
Update Nitpick/* for changes in Utf8, Region, etc.
commit74db10fa775f2cc553b76e2153f2352d4457344f authorEvan Czaplicki <evancz@users.noreply.github.com> dateThu 27 Dec 2018, 11:51 (8 years ago) parent9fc0613
1 file changed+11−12
compiler/src/Nitpick/PatternMatches.hs+11−12
compiler/src/Nitpick/PatternMatches.hs+11−12
@@ -21,13 +21,12 @@ import qualified Data.List as List
2121import qualified Data.Map as Map
2222import qualified Data.Maybe as Maybe
2323import qualified Data.Name as Name
24−import Data.Utf8 (Utf8)
24+import qualified Data.Utf8 as Utf8
2525
2626import qualified AST.Canonical as Can
2727import qualified Data.Index as Index
2828import qualified Elm.ModuleName as ModuleName
2929import qualified Reporting.Annotation as A
30−import qualified Reporting.Region as R
3130
3231
3332
@@ -41,8 +40,8 @@ data Pattern
4140
4241
4342data Literal
44− = Chr Utf8
45− | Str Utf8
43+ = Chr Utf8.String
44+ | Str Utf8.String
4645 | Int Int
4746 deriving (Eq)
4847
@@ -189,8 +188,8 @@ nilName = "[]"
189188
190189
191190data Error
192− = Incomplete R.Region Context [Pattern]
193− | Redundant R.Region R.Region Int
191+ = Incomplete A.Region Context [Pattern]
192+ | Redundant A.Region A.Region Int
194193
195194
196195data Context
@@ -204,7 +203,7 @@ data Context
204203
205204
206205check :: Can.Module -> Either [Error] ()
207−check (Can.Module _ _ _ decls _ _ _ _) =
206+check (Can.Module _ _ decls _ _ _ _) =
208207 case checkDecls decls [] of
209208 [] ->
210209 Right ()
@@ -351,7 +350,7 @@ checkExpr (A.At region expression) errors =
351350 Just c ->
352351 checkExpr c errors
353352
354− Can.Shader _ _ _ ->
353+ Can.Shader _ _ ->
355354 errors
356355
357356
@@ -377,7 +376,7 @@ checkIfBranch (condition, branch) errs =
377376-- CHECK CASE EXPRESSION
378377
379378
380−checkCases :: R.Region -> [Can.CaseBranch] -> [Error] -> [Error]
379+checkCases :: A.Region -> [Can.CaseBranch] -> [Error] -> [Error]
381380checkCases region branches errors =
382381 let
383382 (patterns, newErrors) =
@@ -397,7 +396,7 @@ checkCaseBranch (Can.CaseBranch pattern expr) (patterns, errors) =
397396-- CHECK PATTERNS
398397
399398
400−checkPatterns :: R.Region -> Context -> [Can.Pattern] -> [Error] -> [Error]
399+checkPatterns :: A.Region -> Context -> [Can.Pattern] -> [Error] -> [Error]
401400checkPatterns region context patterns errors =
402401 case toNonRedundantRows region patterns of
403402 Left err ->
@@ -480,13 +479,13 @@ recoverCtor union name arity patterns =
480479
481480
482481-- INVARIANT: Produces a list of rows where (forall row. length row == 1)
483−toNonRedundantRows :: R.Region -> [Can.Pattern] -> Either Error [[Pattern]]
482+toNonRedundantRows :: A.Region -> [Can.Pattern] -> Either Error [[Pattern]]
484483toNonRedundantRows region patterns =
485484 toSimplifiedUsefulRows region [] patterns
486485
487486
488487-- INVARIANT: Produces a list of rows where (forall row. length row == 1)
489−toSimplifiedUsefulRows :: R.Region -> [[Pattern]] -> [Can.Pattern] -> Either Error [[Pattern]]
488+toSimplifiedUsefulRows :: A.Region -> [[Pattern]] -> [Can.Pattern] -> Either Error [[Pattern]]
490489toSimplifiedUsefulRows overallRegion checkedRows uncheckedPatterns =
491490 case uncheckedPatterns of
492491 [] ->