Created
July 11, 2011 07:41
-
-
Save folone/1075437 to your computer and use it in GitHub Desktop.
emulating ADT with case classes in scala
This file contains 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
// haskell: | |
// data Bool = False | True | |
// scala | |
sealed abstract class Bool | |
case object True extends Bool | |
case object False extends Bool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment