Created
May 2, 2019 17:33
-
-
Save dewey92/014d4d0cd4fe1990e84ce1ca1fec19f0 to your computer and use it in GitHub Desktop.
Basic Haskell ADT
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
| -- Boolean teridiri dari dua buah value: True dan False | |
| data Bool = True | False | |
| -- List (atau Array) bisa diekspresikan dengan 2 buah data: Nil dan Cons. | |
| -- @example | |
| -- ["Jihad", "Waspada"] == Cons "Jihad" (Cons "Waspada" Nil) | |
| data List a = Nil | Cons a (List a) | |
| -- Beberapa Functor.. | |
| data Maybe = Just a | Nothing | |
| data Either a b = Left a | Right b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment