anchor.diff:  validRestartType(transient)   -> true;
   validRestartType(RestartType) -> throw({invalid_restart_type, RestartType}).
   
  -validShutdown(Shutdown, _) 
  +validShutdown(Shutdown)
     when is_integer(Shutdown), Shutdown > 0 -> true;
  -validShutdown(infinity, _)             -> true;
  -validShutdown(brutal_kill, _)          -> true;
  -validShutdown(Shutdown, _)             -> throw({invalid_shutdown, Shutdown}).
  +validShutdown(infinity)             -> true;
  +validShutdown(brutal_kill)          -> true;
  +validShutdown(Shutdown)             -> throw({invalid_shutdown, Shutdown}).
   
   validMods(dynamic) -> true;
   validMods(Mods) when is_list(Mods) ->
  
positive.code: 
  -type strategy() :: 'one_for_all' | 'one_for_one'
                    | 'rest_for_one' | 'simple_one_for_one'.
  
  %%--------------------------------------------------------------------------
  
  
negative.code: check_startspec([], Res) ->
      {ok, lists:reverse(Res)}.
  
  check_childspec(ChildSpec) when is_map(ChildSpec) ->
      catch do_check_childspec(maps:merge(?default_child_spec,ChildSpec));
  check_childspec({Name, Func, RestartType, Shutdown, ChildType, Mods}) ->
      check_childspec(#{id => Name,
  		      start => Func,
  		      restart => RestartType,
  		      shutdown => Shutdown,
  		      type => ChildType,
  		      modules => Mods});
  check_childspec(X) -> {invalid_child_spec, X}.
  
  do_check_childspec(#{restart := RestartType,
  		     type := ChildType} = ChildSpec)->
      Name = case ChildSpec of
  	       #{id := N} -> N;
  	       _ -> throw(missing_id)
  	   end,
      Func = case ChildSpec of
  	       #{start := F} -> F;
  	       _ -> throw(missing_start)
  	   end,
      validName(Name),
      validFunc(Func),
      validRestartType(RestartType),
      validChildType(ChildType),
      Shutdown = case ChildSpec of
  		   #{shutdown := S} -> S;
  		   #{type := worker} -> 5000;
  		   #{type := supervisor} -> infinity
  	       end,
      validShutdown(Shutdown),
      Mods = case ChildSpec of
  	       #{modules := Ms} -> Ms;
  	       _ -> {M,_,_} = Func, [M]
  	   end,
      validMods(Mods),
      {ok, #child{name = Name, mfargs = Func, restart_type = RestartType,
  		shutdown = Shutdown, child_type = ChildType, modules = Mods}}.
  