Mikan
Safe HaskellNone
LanguageHaskell2010

Mikan.TypeChecking.Rules.LHS

Synopsis

Documentation

checkLeftHandSide Source #

Arguments

:: Call

Trace, e.g. CheckLHS or CheckPattern.

-> Range

Range of the entire left hand side, for error reporting.

-> LetOrClause

Are we checking a let-pattern or a function clause?

-> [NamedArg Pattern]

The patterns.

-> Type

The expected type a = Γ → b.

-> Maybe Substitution

Module parameter substitution from with-abstraction.

-> [ProblemEq]

Patterns that have been stripped away by with-desugaring. ^ These should not contain any proper matches.

-> (LHSResult -> TCM a)

Continuation.

-> TCM a 

Check a LHS. Main function.

checkLeftHandSide a ps a ret checks that user patterns ps eliminate the type a of the defined function, and calls continuation ret if successful.

data LHSResult Source #

Result of checking the LHS of a clause.

Constructors

LHSResult 

Fields

Instances

Instances details
InstantiateFull LHSResult Source # 
Instance details

Defined in Mikan.TypeChecking.Rules.LHS

bindAsPatterns :: [AsBinding] -> TCM a -> TCM a Source #

Bind as patterns

class IsFlexiblePattern a where Source #

A pattern is flexible if it is dotted or implicit, or a record pattern with only flexible subpatterns.

Minimal complete definition

maybeFlexiblePattern

Instances

Instances details
IsFlexiblePattern Pattern Source # 
Instance details

Defined in Mikan.TypeChecking.Rules.LHS

IsFlexiblePattern a => IsFlexiblePattern (Arg a) Source # 
Instance details

Defined in Mikan.TypeChecking.Rules.LHS

IsFlexiblePattern (Pattern' a) Source # 
Instance details

Defined in Mikan.TypeChecking.Rules.LHS

IsFlexiblePattern a => IsFlexiblePattern [a] Source #

Lists of flexible patterns are RecordFlex.

Instance details

Defined in Mikan.TypeChecking.Rules.LHS

IsFlexiblePattern a => IsFlexiblePattern (Named name a) Source # 
Instance details

Defined in Mikan.TypeChecking.Rules.LHS

data LetOrClause Source #

Are we checking the LHS of a let-pattern binding or a function clause?

Constructors

LetLHS

Checking a pattern bound by a let.

ClauseLHS QName

Checking the LHS of a clause of the function with the given QName.

buildLHSSubstitutions :: Context -> NAPs -> LHSSubstitutionCase -> (Substitution, Substitution) Source #

Compute substitution from the out patterns ps

data LHSSubstitutionCase Source #

Building substitutions from out patterns needs to handle with-functions specially.