We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d5a2d8 commit 8287430Copy full SHA for 8287430
haskell/basics.hs
@@ -0,0 +1,9 @@
1
+head [1, 2, 3, 4, 5] -- get the first: 1
2
+tail [1, 2, 3, 4, 5] -- get the last: 5
3
+take 3 [1, 2, 3, 4, 5] -- get the first n elements: [1, 2, 3]
4
+drop 3 [1, 2, 3, 4, 5] -- remove the first n element: [4, 5]
5
+length [1, 2, 3, 4, 5] -- 5
6
+sum [1, 2, 3, 4, 5] -- sum all elements in the list: 15
7
+product [1, 2, 3, 4, 5] -- product all elements in the list: 120
8
+[1, 2, 3] ++ [4, 5] -- append two lists: [1, 2, 3, 4, 5]
9
+reverse [1, 2, 3, 4, 5] -- reverse all elements in the list: [5, 4, 3, 2, 1]
0 commit comments