HackerTrans
TopNewTrendsCommentsPastAskShowJobs

ncbag

no profile record

comments

ncbag
·vor 2 Jahren·discuss
Yes, the following is so easy in OCaml, it would be a major undertaking in Python:

  type committer =
    InnerCircle of string
  | NPC of string
  | Dissenter of string
  ;;

  type coc_reaction =
    DoNothing
  | ThreeMonthsWithoutHumiliation
  | PublicDefamation
  ;;

  let adjudicate = function
    InnerCircle _ -> DoNothing
  | NPC _ -> ThreeMonthsWithoutHumiliation
  | Dissenter _ -> PublicDefamation
  ;;

  # adjudicate (InnerCircle "Wouters");;
  - : coc_reaction = DoNothing
  # adjudicate (Dissenter "Peters");;
  - : coc_reaction = PublicDefamation
Just use another language, also for social and professional reasons.