[Haskell-cafe] List of nitpicks
Johannes Waldmann
johannes.waldmann at htwk-leipzig.de
Sat Aug 22 10:23:51 UTC 2015
>> quickCheck $ ( (\ xs -> xs == reverse xs ) :: Eq a => [a] -> Bool)
> This can be solved, by the way:
>
https://ro-che.info/articles/2013-02-19-smallcheck#required-type-annotations
Very good indeed.
But (and here's another nit to pick - about ghc) - your
> smallCheck 5 $ \x y -> x == (y :: Integer)
would look much clearer that way:
> smallCheck 5 $ \ (x::Integer) (y :: Integer) -> x == y
but ghc complains about missing ScopedTypeVariables
and that error message is fully incomprehensible
(e.g., to beginning students) as there is no type variable anywhere.
There was a PatternSignatures option but it seems gone (deprecated).
I believe that (PatternSignatures and) ScopedTypeVariables
should be on by default. It is currently off only to help those
that are too lazy to write "forall t . " in (inner) declarations?
Leaving out quantifiers should never be encouraged.
And putting type declarations next to the name declaration
(that is, on the "x" under the lambda) should be the normal thing to do.
Everything else feels like a work-around,
and it is a distraction when teaching.
Putting language options at the top of the source file,
or in .ghci, is also a distraction.
- J.W.
More information about the Haskell-Cafe
mailing list