#line 20 "/home/travis/build/felix-lang/felix/src/packages/core_type_constructors.fdoc"
  
  open class Typing
  {
    typedef fun dom(t:TYPE):TYPE =>
      typematch t with
      | a -> _ => a
      endmatch
    ;
  
    typedef fun cod(t:TYPE):TYPE =>
      typematch t with
      | _ -> b => b
      endmatch
    ;
  
    typedef fun prj1(t:TYPE):TYPE =>
      typematch t with
      | a * _ => a
      endmatch
    ;
  
    typedef fun prj2(t:TYPE):TYPE =>
      typematch t with
      | _ * b => b
      endmatch
    ;
  
    typedef fun type_land(x:TYPE, y:TYPE):TYPE =>
      typematch (x,  y) with
      | 0, _ => 0
      | _,0 => 0
      | _,_ => 1
      endmatch
    ;
  
    typedef fun type_lor(x:TYPE, y:TYPE):TYPE=>
      typematch (x,  y) with
      | 0, 0 => 0
      | _,_ => 1
      endmatch
    ;
  
    typedef fun eq(x:TYPE, y:TYPE):TYPE=>
      typematch x with
      | y => typematch y with | x => 1 | _ => 0 endmatch
      | _ => 0
      endmatch
    ;
  
    typedef fun == (x:TYPE, y:TYPE):TYPE=>
      typematch x with
      | y => typematch y with | x => 1 | _ => 0 endmatch
      | _ => 0
      endmatch
    ;
  
    const memcount[t] : size = "#memcount";
    const arrayindexcount[t] : size = "#arrayindexcount";
  }