txt: ## definitehow.md
  class Metamodel::DefiniteHOW
  
  Metaobject for type definiteness
  
  ```raku
      class Metamodel::DefiniteHOW
          does Metamodel::Documenting
              { }
  
  ```
  
  *Warning*: this class is part of the Rakudo implementation, and is not a part of the language specification.
  
  Type objects may be given a *type smiley*, which is a suffix that denotes their definiteness:
  
  ```raku
  say Any:D.^name; # OUTPUT: «Any:D␤»
  say Any:U.^name; # OUTPUT: «Any:U␤»
  say Any:_.^name; # OUTPUT: «Any␤»
  
  ```
  
  Despite sharing a type with [`Any`](/type/Any), `Any:U` and `Any:D` in particular have different type-checking behaviors from it:
  
  ```raku
  say Any ~~ Any:D;     # OUTPUT: «False␤»
  say Any ~~ Any:U;     # OUTPUT: «True␤»
  say Any ~~ Any:_;     # OUTPUT: «True␤»
  say Any.new ~~ Any:D; # OUTPUT: «True␤»
  say Any.new ~~ Any:U; # OUTPUT: «False␤»
  say Any.new ~~ Any:_; # OUTPUT: «True␤»
  
  ```
  
  This happens because `Any:D` and `Any:U` are not created with [`Metamodel::ClassHOW`](/type/Metamodel/ClassHOW) like you might expect [`Any`](/type/Any) type objects to be, but `Metamodel::DefiniteHOW` instead. This HOW defines the behavior for definite type objects such as these.
  
  The following type declaration:
  
  ```raku
  my Any constant Definite = Any:D;
  
  ```
  
  Is roughly equivalent to this code using the methods of `Metamodel::DefiniteHOW`:
  
  ```raku
  my Any constant Definite = Metamodel::DefiniteHOW.new_type: base_type => Any, definite => 1;
  
  ```
  
  # [Methods](#class_Metamodel::DefiniteHOW "go to top of document")[§](#Methods "direct link")
  
  ## [method new\_type](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_new_type "direct link")
  
  ```raku
  method new_type(:$base_type!, :$definite!)
  ```
  
  Creates a new definite type given a base type and definiteness. `$definite` should either be `1` for `:D` types or `0` for `:U` types.
  
  ## [method name](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_name "direct link")
  
  ```raku
  method name($definite_type)
  ```
  
  Returns the name of a definite type.
  
  ## [method shortname](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_shortname "direct link")
  
  ```raku
  method shortname($definite_type)
  ```
  
  Returns the shortname of a definite type.
  
  ## [method base\_type](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_base_type "direct link")
  
  ```raku
  method base_type($definite_type)
  ```
  
  Returns the base type for a definite type:
  
  ```raku
  say Any:D.^base_type.^name; # OUTPUT: «Any␤»
  
  ```
  
  ## [method definite](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_definite "direct link")
  
  ```raku
  method definite($definite_type)
  ```
  
  Returns `1` if the definite type given is a `:D` type or `0` if it is a `:U` type.
  
  ## [method nominalize](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_nominalize "direct link")
  
  ```raku
  method nominalize($obj)
  ```
  
  Produces a nominal type object for a definite type. This is its base type, which may also get nominalized if it has the `nominalizable` archetype.
  
  ## [method find\_method](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_find_method "direct link")
  
  ```raku
  method find_method($definite_type, $name)
  ```
  
  Looks up a method on the base type of a definite type.
  
  ## [method type\_check](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_type_check "direct link")
  
  ```raku
  method type_check($definite_type, $checkee)
  ```
  
  Performs a type-check of a definite type against `$checkee`. This will check if `$checkee` is of its base type, returning `True` if they match or `False` otherwise. This metamethod can get called when a definite type is on the left-hand side of a smartmatch, for instance.
  
  ## [method accepts\_type](#class_Metamodel::DefiniteHOW "go to top of document")[§](#method_accepts_type "direct link")
  
  ```raku
  method accepts_type($definite_type, $checkee)
  ```
  
  Performs a type-check of `$checkee` against a definite type. This will check if `$checkee` is of its base type and matches its definiteness, returning `True` if they match or `False` otherwise. This metamethod can get called when the definite type is on the right-hand side of a smartmatch, for instance.
  