static Either <TypeCastFailedStatus, Type> GetTypeValidity(string typeName) { lock (sync) { var type = Option <Type> .None; (sessionDataTypeValid, type) = sessionDataTypeValid.FindOrAdd(typeName, () => GetTypeFromName(typeName)); return(type.IsSome ? Right <TypeCastFailedStatus, Type>((Type)type) : Left <TypeCastFailedStatus, Type>(TypeCastFailedStatus.TypeInvalid)); } }