Created
April 15, 2019 18:12
-
-
Save MarcelineVQ/1fd05c18ab83b39fd1edbcc66c8cb856 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data Foo = Bar | Baz | |
| -- In haskell one can ensure coverage of the domain of a function (all cases of a datatype) by having ghc | |
| -- tell you when a case is mising. | |
| -- Can I ensure coverage of the codomain? (all outputs) | |
| parse :: String -> Foo | |
| parse "aba" = Bar | |
| parse "za" = Baz -- how do I make it an error to omit this line? How can I make not covering Bar AND Baz a compiler error? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment