@@ -1,8 +1,8 @@
11-----------------------------------------------------------------------------
22--
33-- Module : Language.PureScript.Error
4−-- Copyright : (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors
5−-- License : MIT
4+-- Copyright : (c) 2013-15 Phil Freeman, (c) 2014-15 Gary Burgess
5+-- License : MIT (http://opensource.org/licenses/MIT)
66--
77-- Maintainer : Phil Freeman <paf31@cantab.net>
88-- Stability : experimental
@@ -115,6 +115,7 @@ data SimpleErrorMessage
115115 | PropertyIsMissing String Type
116116 | CannotApplyFunction Type Expr
117117 | TypeSynonymInstance
118+ | OrphanInstance Ident (Qualified ProperName) [Type]
118119 | InvalidNewtype
119120 | InvalidInstanceHead Type
120121 | TransitiveExportError DeclarationRef [DeclarationRef]
@@ -226,6 +227,7 @@ errorCode em = case unwrapErrorMessage em of
226227 (PropertyIsMissing _ _) -> "PropertyIsMissing"
227228 (CannotApplyFunction _ _) -> "CannotApplyFunction"
228229 TypeSynonymInstance -> "TypeSynonymInstance"
230+ (OrphanInstance _ _ _) -> "OrphanInstance"
229231 InvalidNewtype -> "InvalidNewtype"
230232 (InvalidInstanceHead _) -> "InvalidInstanceHead"
231233 (TransitiveExportError _ _) -> "TransitiveExportError"
@@ -545,6 +547,8 @@ prettyPrintSingleError full level e = prettyPrintErrorMessage <$> onTypesInError
545547 ]
546548 goSimple TypeSynonymInstance =
547549 line "Type synonym instances are disallowed"
550+ goSimple (OrphanInstance nm cnm ts) =
551+ line $ "Instance " ++ show nm ++ " for " ++ show cnm ++ " " ++ unwords (map prettyPrintTypeAtom ts) ++ " is an orphan instance"
548552 goSimple InvalidNewtype =
549553 line "Newtypes must define a single constructor with a single argument"
550554 goSimple (InvalidInstanceHead ty) =