3 ms·
> (2) not actually explicitly stated in the article! the difference between validation and parsing lies almost entirely in how information is preserved. Co
by mrkeen 4y ago
> (2) not actually explicitly stated in the article!
the difference between validation and parsing lies almost entirely in how information is preserved. Consider the following pair of functions:
validateNonEmpty :: [a] -> IO ()
parseNonEmpty :: [a] -> IO (NonEmpty a)
Both of these functions check the same thing, but parseNonEmpty gives the caller access to the information it learned, while validateNonEmpty just throws it away.
- jmull 4y agoI know we can infer the point from the information buried in the middle of the article. But your quote is significantly edited for clarity, and, after all, is a code example, not a statement of definitions.
- cratermoon 4y agoWhat is code, though, but a syntactically precise and logical way of expressing ideas?