Created
May 26, 2018 17:14
-
-
Save maciejsmolinski/07231d984ce0222f16f2ed831f2070e1 to your computer and use it in GitHub Desktop.
Mocking in Haskell
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
data Article = Article | |
{ title :: String | |
, body :: String | |
} deriving (Show) | |
articles :: IO [Article] | |
articles = | |
return | |
[ Article | |
{ title = "First article" | |
, body = "This is an article about writing articles" | |
} | |
] | |
main :: IO () | |
main = articles >>= print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment