/dpt/ - Daily programming thread

\n -> newThread n

Old thread

Attached: Kujou_Karen_Learns_Haskell.png (1280x719, 818K)

Other urls found in this thread:

github.com/jech/dht/blob/master/dht.c
github.com/Tux/VCS-SCCS
javascript.info/
devdocs.io/
en.wikipedia.org/wiki/Java_performance
tetris.merkoba.com
software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm
milek7.pl/openttd-wasm/
twitter.com/SFWRedditImages

Developing desktop applications on Android

Attached: Screenshot_20190406-002728_XServer_XSDL.png (1920x1080, 178K)

why does this give me an error?
map (\a b -> a * b) [1,2,3][4,5,6]

map applies a function over one list, and there's more than one way to apply it over two lists
If you want [4,10,18], you have to use zipWith instead of map
If you want [4,5,6,8,10,12,12,15,18], the function is liftA2
Anyway, (\a b -> a * b) is simply (*)

map doesn't zip multiple lists, it just maps one list
you end up creating a closure [Int -> Int] where every int (1, 2, 3) is mapped to a multiplication function (1 *, 2 *, 3 *), and then (mistakenly) applying a list to this, which doesn't work because a list of functions isn't a function

JavaScript rocks!

Attached: js-rocks.png (1000x494, 368K)

Test

Attached: IMG_20190330_155256.jpg (768x1024, 19K)

Attached: reencoded_image.png (96x128, 18K)

>what are you doing in JS that's so performance heavy
I narrowed it down to one function that runs on input of a text field and checks that it's not a duplicate of other values, it takes an array (tested with 10 items and there's a slowdown), uses filter to remove on element, map to get a single member, then include to check if it has the text in the field. This all is wrapped in a function that returns a function in a function because that what the framework needs.

123

Attached: IMG_20190330_155256.jpg (960x1280, 196K)