Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,3 @@
let square x = x*x
let values = [1..10]
map square values

View file

@ -0,0 +1 @@
[square x | x <- values]

View file

@ -0,0 +1 @@
[1 .. 10] >>= pure . (^ 2)

View file

@ -0,0 +1 @@
(^ 2) <$> [1..10]

View file

@ -0,0 +1,2 @@
let printSquares = mapM_ (print.square)
printSquares values

View file

@ -0,0 +1,10 @@
import Data.Array (Array, listArray)
square :: Int -> Int
square x = x * x
values :: Array Int Int
values = listArray (1, 10) [1 .. 10]
main :: IO ()
main = print $ fmap square values