@@ -73,6 +73,7 @@ data Err = Msg String
73 | ProofSearchFail Err
73 | ProofSearchFail Err
74 | NoRewriting Term
74 | NoRewriting Term
75 | At FC Err
75 | At FC Err
76+ | ProviderError String
76 deriving Eq
77 deriving Eq
78instance Sized Err where
79instance Sized Err where
@@ -91,6 +92,7 @@ instance Sized Err where
91 size UniverseError = 1
92 size UniverseError = 1
92 size ProgramLineComment = 1
93 size ProgramLineComment = 1
93 size (At fc err) = size fc + size err
94 size (At fc err) = size fc + size err
95+ size (ProviderError msg) = length msg
94 size _ = 1
96 size _ = 1
96score :: Err -> Int
98score :: Err -> Int
@@ -106,6 +108,7 @@ instance Show Err where
106 show (CantUnify _ l r e sc i) = "CantUnify " ++ show l ++ " " ++ show r ++ " "
108 show (CantUnify _ l r e sc i) = "CantUnify " ++ show l ++ " " ++ show r ++ " "
107 ++ show e ++ " in " ++ show sc ++ " " ++ show i
109 ++ show e ++ " in " ++ show sc ++ " " ++ show i
108 show (Inaccessible n) = show n ++ " is not an accessible pattern variable"
110 show (Inaccessible n) = show n ++ " is not an accessible pattern variable"
111+ show (ProviderError msg) = "Type provider error: " ++ msg
109 show _ = "Error"
112 show _ = "Error"
111instance Pretty Err where
114instance Pretty Err where
@@ -118,6 +121,7 @@ instance Pretty Err where
119 text "Cannot unify" <+> colon <+> pretty l <+> text "and" <+> pretty r $$
122 text "Cannot unify" <+> colon <+> pretty l <+> text "and" <+> pretty r $$
120 nest nestingSize (text "where" <+> pretty e <+> text "with" <+> (text . show $ i))
123 nest nestingSize (text "where" <+> pretty e <+> text "with" <+> (text . show $ i))
124+ pretty (ProviderError msg) = text msg
121 pretty _ = text "Error"
125 pretty _ = text "Error"
123data TC a = OK a
127data TC a = OK a