unison-core1-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.DeclNameLookup

Synopsis

Documentation

data DeclNameLookup Source #

A lookup from decl-to-constructor name and vice-versa.

For example, a type decl like

unique type Foo
  = Bar Int
  | Baz.Qux Nat Nat

is represented as

DeclNameLookup
  { constructorToDecl = Map.fromList [(Foo.Bar, Foo), (Foo.Baz.Qux, Foo)]
  , declToConstructors = Map.fromList [(Foo, [Foo.Bar, Foo.Baz.Qux])]
  }

Note that:

  • Constructor names are given "in full", though they will all necessarily begin with the decl's name.
  • In declToConstructors, the constructor names are given in their canonical ordering.

Instances

Instances details
Semigroup DeclNameLookup Source # 
Instance details

Defined in Unison.DeclNameLookup

Generic DeclNameLookup Source # 
Instance details

Defined in Unison.DeclNameLookup

Associated Types

type Rep DeclNameLookup :: Type -> Type #

type Rep DeclNameLookup Source # 
Instance details

Defined in Unison.DeclNameLookup

type Rep DeclNameLookup = D1 ('MetaData "DeclNameLookup" "Unison.DeclNameLookup" "unison-core1-0.0.0-Kp7ZcNnt5XdB8ImvFwyntI" 'False) (C1 ('MetaCons "DeclNameLookup" 'PrefixI 'True) (S1 ('MetaSel ('Just "constructorToDecl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Name Name)) :*: S1 ('MetaSel ('Just "declToConstructors") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Name [Name]))))