Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- synthesizeClosed :: (BuiltinAnnotation loc, Var v, Ord loc, Show loc) => PrettyPrintEnv -> PatternMatchCoverageCheckAndKindInferenceSwitch -> [Type v loc] -> TypeLookup v loc -> Term v loc -> Result v loc (Type v loc)
- data ErrorNote v loc = ErrorNote {
- cause :: Cause v loc
- path :: Seq (PathElement v loc)
- data CompilerBug v loc
- = UnknownDecl Unknown Reference (Map Reference (DataDeclaration v loc))
- | UnknownConstructor Unknown ConstructorReference (DataDeclaration v loc)
- | UndeclaredTermVariable v (Context v loc)
- | RetractFailure (Element v loc) (Context v loc)
- | EmptyLetRec (Term v loc)
- | PatternMatchFailure
- | EffectConstructorHadMultipleEffects (Type v loc)
- | FreeVarsInTypeAnnotation (Set (TypeVar v loc))
- | UnannotatedReference Reference
- | MalformedPattern (Pattern loc)
- | UnknownTermReference Reference
- | UnknownExistentialVariable v (Context v loc)
- | IllegalContextExtension (Context v loc) (Element v loc) String
- | OtherBug String
- data InfoNote v loc
- = SolvedBlank (Recorded loc) v (Type v loc)
- | Decision v loc (Term v loc)
- | TopLevelComponent [(v, Type v loc, RedundantTypeAnnotation)]
- data Cause v loc
- = TypeMismatch (Context v loc)
- | IllFormedType (Context v loc)
- | UnknownSymbol loc v
- | UnknownTerm loc v [Suggestion v loc] (Type v loc)
- | AbilityCheckFailure [Type v loc] [Type v loc] (Context v loc)
- | AbilityEqFailure [Type v loc] [Type v loc] (Context v loc)
- | EffectConstructorWrongArgCount ExpectedArgCount ActualArgCount ConstructorReference
- | MalformedEffectBind (Type v loc) (Type v loc) [Type v loc]
- | PatternArityMismatch loc (Type v loc) Int
- | DuplicateDefinitions (NonEmpty (v, [loc]))
- | UnguardedLetRecCycle [v] [(v, Term v loc)]
- | ConcatPatternWithoutConstantLength loc (Type v loc)
- | HandlerOfUnexpectedType loc (Type v loc)
- | DataEffectMismatch Unknown Reference (DataDeclaration v loc)
- | UncoveredPatterns loc (NonEmpty (Pattern ()))
- | RedundantPattern loc
- | KindInferenceFailure (KindError v loc)
- | InaccessiblePattern loc
- newtype Context v loc = Context [(Element v loc, Info v loc)]
- type ActualArgCount = Int
- type ExpectedArgCount = Int
- type ConstructorId = Word64
- data Element v loc
- data PathElement v loc
- = InSynthesize (Term v loc)
- | InSubtype (Type v loc) (Type v loc)
- | InEquate (Type v loc) (Type v loc)
- | InCheck (Term v loc) (Type v loc)
- | InInstantiateL v (Type v loc)
- | InInstantiateR (Type v loc) v
- | InSynthesizeApp (Type v loc) (Term v loc) Int
- | InFunctionCall [v] (Term v loc) (Type v loc) [Term v loc]
- | InAndApp
- | InOrApp
- | InIfCond
- | InIfBody loc
- | InVectorApp loc
- | InMatch loc
- | InMatchGuard
- | InMatchBody
- type Term v loc = Term' (TypeVar v loc) v loc
- type Type v loc = Type (TypeVar v loc) loc
- type TypeVar v loc = TypeVar (Blank loc) v
- data Result v loc a
- data PatternMatchCoverageCheckAndKindInferenceSwitch
- errorTerms :: ErrorNote v loc -> [Term v loc]
- innermostErrorTerm :: ErrorNote v loc -> Maybe (Term v loc)
- lookupAnn :: Ord v => Context v loc -> v -> Maybe (Type v loc)
- lookupSolved :: Ord v => Context v loc -> v -> Maybe (Monotype v loc)
- apply :: (Var v, Ord loc) => Context v loc -> Type v loc -> Type v loc
- isEqual :: (Var v, Ord loc) => Type v loc -> Type v loc -> Either (CompilerBug v loc) Bool
- isSubtype :: (Var v, Ord loc) => Type v loc -> Type v loc -> Either (CompilerBug v loc) Bool
- fitsScheme :: (Var v, Ord loc) => Type v loc -> Type v loc -> Either (CompilerBug v loc) Bool
- isRedundant :: (Var v, Ord loc) => Type v loc -> Type v loc -> M v loc Bool
- data Suggestion v loc = Suggestion {}
- data Replacement v
- data SuggestionMatch
- isExact :: Suggestion v loc -> Bool
- typeErrors :: Result v loc a -> Seq (ErrorNote v loc)
- infoNotes :: Result v loc a -> Seq (InfoNote v loc)
- data Unknown
- relax :: Var v => Ord loc => Type v loc -> Type v loc
- generalizeAndUnTypeVar :: Var v => Type v a -> Type v a
Documentation
synthesizeClosed :: (BuiltinAnnotation loc, Var v, Ord loc, Show loc) => PrettyPrintEnv -> PatternMatchCoverageCheckAndKindInferenceSwitch -> [Type v loc] -> TypeLookup v loc -> Term v loc -> Result v loc (Type v loc) Source #
public interface to the typechecker
data CompilerBug v loc Source #
UnknownDecl Unknown Reference (Map Reference (DataDeclaration v loc)) | |
UnknownConstructor Unknown ConstructorReference (DataDeclaration v loc) | |
UndeclaredTermVariable v (Context v loc) | |
RetractFailure (Element v loc) (Context v loc) | |
EmptyLetRec (Term v loc) | |
PatternMatchFailure | |
EffectConstructorHadMultipleEffects (Type v loc) | |
FreeVarsInTypeAnnotation (Set (TypeVar v loc)) | |
UnannotatedReference Reference | |
MalformedPattern (Pattern loc) | |
UnknownTermReference Reference | |
UnknownExistentialVariable v (Context v loc) | |
IllegalContextExtension (Context v loc) (Element v loc) String | |
OtherBug String |
Instances
(Var v, Show loc, Ord loc) => Show (CompilerBug v loc) Source # | |
Defined in Unison.Typechecker.Context showsPrec :: Int -> CompilerBug v loc -> ShowS # show :: CompilerBug v loc -> String # showList :: [CompilerBug v loc] -> ShowS # |
SolvedBlank (Recorded loc) v (Type v loc) | |
Decision v loc (Term v loc) | |
TopLevelComponent [(v, Type v loc, RedundantTypeAnnotation)] |
TypeMismatch (Context v loc) | |
IllFormedType (Context v loc) | |
UnknownSymbol loc v | |
UnknownTerm loc v [Suggestion v loc] (Type v loc) | |
AbilityCheckFailure [Type v loc] [Type v loc] (Context v loc) | |
AbilityEqFailure [Type v loc] [Type v loc] (Context v loc) | |
EffectConstructorWrongArgCount ExpectedArgCount ActualArgCount ConstructorReference | |
MalformedEffectBind (Type v loc) (Type v loc) [Type v loc] | |
PatternArityMismatch loc (Type v loc) Int | |
DuplicateDefinitions (NonEmpty (v, [loc])) | |
UnguardedLetRecCycle [v] [(v, Term v loc)] | |
ConcatPatternWithoutConstantLength loc (Type v loc) | |
HandlerOfUnexpectedType loc (Type v loc) | |
DataEffectMismatch Unknown Reference (DataDeclaration v loc) | |
UncoveredPatterns loc (NonEmpty (Pattern ())) | |
RedundantPattern loc | |
KindInferenceFailure (KindError v loc) | |
InaccessiblePattern loc |
type ActualArgCount = Int Source #
type ExpectedArgCount = Int Source #
type ConstructorId = Word64 #
Elements of an ordered algorithmic context
Var (TypeVar v loc) | A variable declaration |
Solved (Blank loc) v (Monotype v loc) |
|
Ann v (Type v loc) |
|
Marker v | used for scoping |
data PathElement v loc Source #
InSynthesize (Term v loc) | |
InSubtype (Type v loc) (Type v loc) | |
InEquate (Type v loc) (Type v loc) | |
InCheck (Term v loc) (Type v loc) | |
InInstantiateL v (Type v loc) | |
InInstantiateR (Type v loc) v | |
InSynthesizeApp (Type v loc) (Term v loc) Int | |
InFunctionCall [v] (Term v loc) (Type v loc) [Term v loc] | |
InAndApp | |
InOrApp | |
InIfCond | |
InIfBody loc | |
InVectorApp loc | |
InMatch loc | |
InMatchGuard | |
InMatchBody |
Instances
(Show v, Show loc) => Show (PathElement v loc) Source # | |
Defined in Unison.Typechecker.Context showsPrec :: Int -> PathElement v loc -> ShowS # show :: PathElement v loc -> String # showList :: [PathElement v loc] -> ShowS # |
Success !(Seq (InfoNote v loc)) !a | |
TypeError !(NESeq (ErrorNote v loc)) !(Seq (InfoNote v loc)) | |
CompilerBug !(CompilerBug v loc) !(Seq (ErrorNote v loc)) !(Seq (InfoNote v loc)) |
errorTerms :: ErrorNote v loc -> [Term v loc] Source #
apply :: (Var v, Ord loc) => Context v loc -> Type v loc -> Type v loc Source #
Replace any existentials with their solution in the context
isSubtype :: (Var v, Ord loc) => Type v loc -> Type v loc -> Either (CompilerBug v loc) Bool Source #
fitsScheme :: (Var v, Ord loc) => Type v loc -> Type v loc -> Either (CompilerBug v loc) Bool Source #
data Suggestion v loc Source #
Suggestion | |
|
Instances
Show v => Show (Suggestion v loc) Source # | |
Defined in Unison.Typechecker.Context showsPrec :: Int -> Suggestion v loc -> ShowS # show :: Suggestion v loc -> String # showList :: [Suggestion v loc] -> ShowS # | |
Var v => Eq (Suggestion v loc) Source # | |
Defined in Unison.Typechecker.Context (==) :: Suggestion v loc -> Suggestion v loc -> Bool # (/=) :: Suggestion v loc -> Suggestion v loc -> Bool # |
data Replacement v Source #
Instances
Show v => Show (Replacement v) Source # | |
Defined in Unison.Typechecker.Context showsPrec :: Int -> Replacement v -> ShowS # show :: Replacement v -> String # showList :: [Replacement v] -> ShowS # | |
Eq v => Eq (Replacement v) Source # | |
Defined in Unison.Typechecker.Context (==) :: Replacement v -> Replacement v -> Bool # (/=) :: Replacement v -> Replacement v -> Bool # | |
Ord v => Ord (Replacement v) Source # | |
Defined in Unison.Typechecker.Context compare :: Replacement v -> Replacement v -> Ordering # (<) :: Replacement v -> Replacement v -> Bool # (<=) :: Replacement v -> Replacement v -> Bool # (>) :: Replacement v -> Replacement v -> Bool # (>=) :: Replacement v -> Replacement v -> Bool # max :: Replacement v -> Replacement v -> Replacement v # min :: Replacement v -> Replacement v -> Replacement v # |
data SuggestionMatch Source #
Instances
Show SuggestionMatch Source # | |
Defined in Unison.Typechecker.Context showsPrec :: Int -> SuggestionMatch -> ShowS # show :: SuggestionMatch -> String # showList :: [SuggestionMatch] -> ShowS # | |
Eq SuggestionMatch Source # | |
Defined in Unison.Typechecker.Context (==) :: SuggestionMatch -> SuggestionMatch -> Bool # (/=) :: SuggestionMatch -> SuggestionMatch -> Bool # | |
Ord SuggestionMatch Source # | |
Defined in Unison.Typechecker.Context compare :: SuggestionMatch -> SuggestionMatch -> Ordering # (<) :: SuggestionMatch -> SuggestionMatch -> Bool # (<=) :: SuggestionMatch -> SuggestionMatch -> Bool # (>) :: SuggestionMatch -> SuggestionMatch -> Bool # (>=) :: SuggestionMatch -> SuggestionMatch -> Bool # max :: SuggestionMatch -> SuggestionMatch -> SuggestionMatch # min :: SuggestionMatch -> SuggestionMatch -> SuggestionMatch # |
isExact :: Suggestion v loc -> Bool Source #