-- No, no, no, no!
checkValid :: Int -> ()
checkValid x = if x >= 5
then error "Invalid number!"
else ()
-- This works fine.
checkValid :: Int -> Either String ()
checkValid x = if x >= 5
then fail "Invalid number!"
else return ()
This may sound a bit harsh, but I think you deserved to lose that 10% if you had such a fundamental misunderstanding of "lazy evaluation".This project has been the most learning-filled project of my college career. I wouldn't trade that for any easy A. :)
The opinion that people should get less of a grade if they don't know what they're doing is unreasonable? I'm not a compiler writer, but using exceptions for regular control flow in a type checker sounds very iffy to me, Haskell or not. Why would exceptions even show up in a type checker, for that matter?
Unfortunately, grades now also serve as some poor measure of intelligence or competency in many people's minds.
If the project was the entire grade, then yes that's a bit much. But if we're talking about 1 of 10 assignments, then 10% really isn't that much.
I've had plenty of assignments were the granularity was just something like excellent, good, pass, fail.