Part 1 -- baby steps
This commit is contained in:
parent
f3a5289c72
commit
eaeca81b65
1 changed files with 10 additions and 0 deletions
10
baby.hs
Normal file
10
baby.hs
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- baby.hs
|
||||
-- Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
-- Simple functions
|
||||
doubleMe x = x + x
|
||||
doubleUs x y = doubleMe x + doubleMe y
|
||||
boomBangs xs = [if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
|
||||
|
||||
-- List comprehensions
|
||||
triangles = [(a,b,c) | c <- [1..10], b <- [1..10], a <- [1..10]]
|
Loading…
Add table
Add a link
Reference in a new issue