Last active
April 24, 2021 03:55
-
-
Save pseudometric/485f3c9a5d96a197c314a86ebf102320 to your computer and use it in GitHub Desktop.
Lisa’s Haskell snippet
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
#!/usr/bin/env stack | |
-- stack --resolver lts-17.9 script | |
module Main where | |
import Data.List | |
numbers = [2..9] | |
fruits = ["apple", "banana", "eggplant", "cherry", "kiwi", "tomato"] | |
vegetables = ["carrot", "tomato", "celery", "eggplant", "spinach"] | |
squares = map (^2) numbers | |
stupidfruits = intersect fruits vegetables | |
realvegetables = vegetables \\ fruits | |
main = do | |
putStrLn $ " squares: " <> show numbers | |
putStrLn $ " stupidfruits: " <> show stupidfruits | |
putStrLn $ "realvegetables: " <> show realvegetables |
Author
pseudometric
commented
Apr 24, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment