txt: ## collation.md
  class Collation
  
  Encapsulates instructions about how strings should be sorted
  
  ```raku
  class Collation { }
  
  ```
  
  `Collation` is the class that allows proper sorting, taking into account all Unicode characteristics. It's the class the object [`$*COLLATION`](/language/variables#index-entry-%24*COLLATION) is instantiated to, and thus includes *collation levels*, that is, what kind of features should be looked up when comparing two strings and in which order.
  
  # [Methods](#class_Collation "go to top of document")[§](#Methods "direct link")
  
  ## [method set](#class_Collation "go to top of document")[§](#method_set "direct link")
  
  ```raku
  method set (
      Int :$primary    = 1,
      Int :$secondary  = 1,
      Int :$tertiary   = 1,
      Int :$quaternary = 1)
  
  ```
  
  Sets if the different levels should be used in ascending or descending order, or if they are going to be ignored (when set to 0).
  
  ```raku
  my $*COLLATION = Collation.new;
  say 'a' coll 'z'; # OUTPUT: «Less␤»
  $*COLLATION.set(:primary(-1));
  say 'a' coll 'z'; # OUTPUT: «More␤»
  
  ```
  
  ## [method primary](#class_Collation "go to top of document")[§](#method_primary "direct link")
  
  ```raku
  method primary
  ```
  
  Returns the state of the primary collation level.
  
  ## [method secondary](#class_Collation "go to top of document")[§](#method_secondary "direct link")
  
  ```raku
  method secondary
  ```
  
  Returns the state of the secondary collation level.
  
  ## [method tertiary](#class_Collation "go to top of document")[§](#method_tertiary "direct link")
  
  ```raku
  method tertiary
  ```
  
  Returns the state of the tertiary collation level.
  
  ## [method quaternary](#class_Collation "go to top of document")[§](#method_quaternary "direct link")
  
  ```raku
  method quaternary
  ```
  
  Returns the state of the quaternary collation level.
  
  # [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")
  
  Type relations for `Collation`
  
  
  
  raku-type-graph
  
  
  
  Collation
  Collation
  
  
  Any
  Any
  
  
  Collation->Any
  
  
  
  Mu
  Mu
  
  
  Any->Mu
  
  [Expand chart above](/assets/typegraphs/Collation.svg)
  