Dane Sabo ae0ab17291 Auto sync: 2025-08-18 16:54:48 (667 files changed)
R  "Zettelkasten/Hub Notes/NNFM Ontology.canvas" -> "NNFM Ontology.canvas"

R  "Zettelkasten/Hub Notes/Permanent Notes/Programming/Assembly/Assembly Canvas.canvas" -> "Programming/Assembly/Assembly Canvas.canvas"

R  "Zettelkasten/Hub Notes/Permanent Notes/Programming/Assembly/Untitled.md" -> Programming/Assembly/Untitled.md

R  "Zettelkasten/Hub Notes/Permanent Notes/Programming/Formal Methods/LEAN/Learning Plan.md" -> "Programming/Formal Methods/LEAN/Learning Plan.md"

R  "Zettelkasten/Hub Notes/Permanent Notes/Programming/Formal Methods/LEAN/Tutorial World.md" -> "Programming/Formal Methods/LEAN/Tutorial World.md"

R  "Zettelkasten/Hub Notes/Permanent Notes/Programming/Formal Methods/TLA/TLA Canvas.canvas" -> "Programming/Formal Methods/TLA/TLA Canvas.canvas"

R  "Zettelkasten/Hub Notes/Permanent Notes/Programming/Formal Methods/TLA/TLA+ Learning Plan.md" -> "Programming/Formal Methods/TLA/TLA+ Learning Plan.md"

R  "Zettelkasten/Hub Notes/Permanent Notes/Programming/Formal Methods/TLA/What is TLA?.md" -> "Programming/Formal Methods/TLA/What is TLA?.md"
2025-08-18 16:54:48 -04:00

33 lines
1.1 KiB
Haskell

doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y
doubleSmallNumber x = if x > 100
then x
else x*2
doubleSmallNumber' x = (if x > 100 then x else x*2) + 1
-- boom bangs, ya heard???
boomBangs xs = [ if x< 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
-- remember, [function | set, predicate] 'fucking stupid predicate'
schtankyList x = [ x*y | x <- [2,5,10], y <- [8,10,11]]
-- Now Writing our own custom list function
length' xs = sum [1 | _ <- xs]
-- use dummy variable _, draw an element from a list and replace it with 1. Sum all of those.
--- Strings are lists! We can use list comprehensions on them.
removeNonUppercase st = [ c | c <- st, c `elem` ['A'..'Z']]
--------------Pythogoraus Problem----------------------
--triangles with integer sides
triangles x = [(a,b,c) | c <- [1..10], b <- [1..10], a <- [1..10]]
--right triangles
rightTriangles x = [(a,b,c) | c <- [1..10], b <- [1..10], a <- [1..10], a^2 + b^2 == c^2]
-- Now only triangles with perimiter equal to 24
rightTriangles' x = [(a,b,c) | c <- [1..10], b <- [1..10], a <- [1..10], a^2 + b^2 == c^2, a+b+c == 24]