unison-core1-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Var

Synopsis

Documentation

class (Show v, Var v) => Var v where Source #

A class for variables. Variables may have auxiliary information which may not form part of their identity according to Eq / Ord. Laws:

  • `typeOf (typed n) == n`
  • `typeOf (ABT.freshIn vs v) == typeOf v`: freshIn does not alter the name

Methods

typed :: Type -> v Source #

typeOf :: v -> Type Source #

freshId :: v -> Word64 Source #

freshenId :: Word64 -> v -> v Source #

Instances

Instances details
Var Symbol Source # 
Instance details

Defined in Unison.Symbol

data Type Source #

Constructors

User Text 
Inference InferenceType 
MissingResult 
Blank 
UnnamedReference Id

An unnamed reference, created during unhashing a term/decl component.

UnnamedWatch WatchKind Text 
Eta 
ANFBlank 
Float 
Pattern 
Irrelevant 
Delay 

Instances

Instances details
Show Type Source # 
Instance details

Defined in Unison.Var

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Eq Type Source # 
Instance details

Defined in Unison.Var

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Ord Type Source # 
Instance details

Defined in Unison.Var

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

bakeId :: Var v => v -> v Source #

blank :: Var v => v Source #

freshIn :: Var v => Set v -> v -> v Source #

isAction :: Var v => v -> Bool Source #

Currently, actions in blocks are encoded as bindings with names of the form _123 (an underscore, followed by 1 or more digits). This function returns True if the input variable has this form.

Various places check for this (the pretty-printer, to determine how to print the binding), and the typechecker (to decide if it should ensure the binding has type ()).

name :: Var v => v -> Text Source #

nameStr :: Var v => v -> String Source #

named :: Var v => Text -> v Source #

nameds :: Var v => String -> v Source #

reset :: Var v => v -> v Source #

uncapitalize :: Var v => v -> v Source #

universallyQuantifyIfFree :: forall v. Var v => v -> Bool Source #

unnamedRef :: Var v => Id -> v Source #

unnamedTest :: Var v => Text -> v Source #