Skip to content

Instantly share code, notes, and snippets.

@lmazardo
lmazardo / grading.sml
Created February 22, 2013 20:46
grading in coursera programming languages
datatype note = ProgrammingAssignments of int list
| PeerAssignments of int list
| Exam of int list
| Note of note list
fun grading n =
case n of
ProgrammingAssignments pl => (case pl of
[] => 0.0
| x::xs => 0.9 * Real.fromInt(x) + grading (ProgrammingAssignments xs))