There are lots of things I like about F#. Probably one that is unique though is its computation expressions. Here is a list example.
// a list normally is defined like this: [ 1; 2; 3 ]letvalidatecourse=[// but the compiler knows this is a CE// because we put logic in itifisBlankishcourse.Namethenyield"Course Name blank"matchcourse.Examwith|None->()// do nothing|Someexam->yield!Exam.validateexam// the ! is for other lists, flattens]...// errors : string listleterrors=validatecourse
This provides a list of errors. And it is composable with other validations. It could be called in the same way that this function calls Exam.validate.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There are lots of things I like about F#. Probably one that is unique though is its computation expressions. Here is a list example.
This provides a list of errors. And it is composable with other validations. It could be called in the same way that this function calls
Exam.validate
.