Last active
December 15, 2015 19:29
-
-
Save b0oh/5311394 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
| module Fantom where | |
| data NoPower | |
| data Power | |
| data Product = Donut | Bread deriving Show | |
| data Oven product power = Oven product | |
| oven :: Product -> Oven Product NoPower | |
| oven product = Oven product | |
| addPower :: Oven Product NoPower -> Oven Product Power | |
| addPower (Oven pr) = Oven pr | |
| makeProduct :: Oven Product Power -> Product | |
| makeProduct (Oven pr) = pr | |
| main = print . show $ makeProduct $ addPower $ oven Donut | |
| -- => "Donut" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment