/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

tour.dlang.org/
wiki.dlang.org/Books
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes
wiki.haskell.org/Hask#Is_Hask_even_a_category.3F
dlang.org/blog/2017/06/05/compile-time-sort-in-d/
twitter.com/NSFWRedditGif

Remember to use foldMapM wherever possible!

reminder to always fold your maps so they fit in your car

>and if you question the usage of python you're treated like an ANSI C purist weirdo
But C and Python are the only good languages.

>not using mzipfoldMapAWith

That's too vague.

>But C is the only good language.
ftfy

What could possibly be vague about it?

Threadly reminder that dlang-chan has RAII; she's quite fast in execution and compilation; and she's super duper cute! Say something nice about her, /dpt/!
Also, Andrei's a cool guy.

>Tour
tour.dlang.org/
>Books
wiki.dlang.org/Books
>GC
dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/
wiki.dlang.org/Libraries_and_Frameworks#Alternative_standard_libraries_.2F_runtimes

Did they finally remove GC cancer?

Let f be the foldMap map in Hom(Hom(V),Hom(W)) of maps on the sets of types V and W, does there exist a foldMapMap g such that g maps f to g(f) such that g(f) is the foldMap map in Hom(Hom(f(V)),Hom(f(W))) between the sets of types f(V) and f(W)?

What is your major malfunction?

Not programming but I'm trying to make an ISO of Gentoo which has linux-libre and no non-free software.

There is nothing wrong with GC

Certainly not in Hask!

No, but from a language that is supposed to be a better C++ it is cancer.

What's a good book about low level computer/programming stuff? Getting caught out by my lack of understanding with Floating Point numbers and shit like that.

Working on a fitbit android app with Sup Forums integration

Read the links I provided, please.

I'm gay.

It already is a better C++ by design

What is a ``Hask"?

...

>he doesn't know what Hask is

I know what """Hask""" is, but that doesn't seem appropriate to mention when discussing category theory.

evidently you don't

Why would someone mention a non-category when discussing category theory?

Ran is worst touhou

Plenty of category theory concepts aren't categories.

Hask is a category.

Aren't you embarassed

Stop that, I won't allow anyone badmouthing my smart and beautiful wife.

foldMap is blowing my mind. I have a new understanding and respect for monoids.

>Hask is a category.
Not with seq being part of the language.
Link me to a formal proof of it """being""" a category. I'm pretty sure it would be impossible without the language actually having an operational semantics.

Ok, here's what I came up with quickly, native Python, no modules. Obviously not impressive, but now I can import my own interleave function when needed:
def interleave(lst1, lst2):
lst =[i for pair in zip(lst1, lst2) for i in pair]
if len(lst1) > len(lst2):
lst.extend(lst1[len(lst2):])
elif len(lst2) > len(lst1):
lst.extend(lst2[len(lst1):])
return lst

>>> interleave([1, 2, 3], list(range(10)))
[1, 0, 2, 1, 3, 2, 3, 4, 5, 6, 7, 8, 9]

seq doesn't exist

>You have no argument.
A) Not an argument
B) Yes I do
> imported an entire library to do a trivial task that should be handled in the standard library

Much like """Hask""".

If Hask doesn't exist then Ed Kmett doesn't exist

>that should be handled in the standard library
Shut the fuck up brainlet.
>relying on libraries
See Problem solved, end of discussion.

I know that feeling, user. Such a simple concept yet it turns up in so many places

Formally prove that it 1) exists 2) is a category.

>Problem solved
>Longest solution so far to a simple task
You continue to prove why Python is objectively the worst language

Here's an informal formal proof:

1) Hask. Therefore Hask exists

2) id and (.)

>i for pair in zip(lst1, lst2) for i in pair
>i for ... in ... for i in ...
what

>Longest solution so far to a simple task
No, the import solution was the shortest, and this code is forever reusable and callable, making it this short: interleave()
That's one single function - very short.

>the import solution was the shortest
That's not even accurate, as the ruby solution is a single line and the import solution was two.
It's still not part of the standard lib to do a simple and common task, meaning the use that you're going to have to import the library that function now lives in (or outright declare it), so it's moot.

Python lives below only JavaScript for most unnecessary imports.

List comprehension. zip returns pairs as tuples, then for each tuple build a list from its elements.

seq undefined 3 => undefined
seq (undefined . id) 3 => 3

Therefore """Hask""" is not a category.

why does /dpt/ hate importing again?
you cant even print a string in C without importing stdio

I preferred the old Dlang-chan.

>print
>io
Get the fuck out of here.

>he believes C has strings
NSA shill pls

wiki.haskell.org/Hask#Is_Hask_even_a_category.3F

There's nothing wrong with importing.
There's a some stuff wrong with importing a single function.
There's a LOT wrong with importing a dozen different libraries each for a single function.

>category of types
>not even a closed monoidal category
You can't make this shit up bros.

Not interested in reading a government website. I have just proved it's not a category. Let me know when the language gets fixed though.

>not even
Why should it be?

Is it possible to use 4chanX filter, to filter out all posts that have sentences that don't have punctuation and capitalized words?

That would be neat, I could also filter those who use punctuation like retards.

>meaning the use that you're going to have to import the library that function now lives in
I've never had to interleave a list, so I don't care. Also, there's nothing wrong with importing your own library. I fail to see your point.

if you have to ask you arent a real programer

So you would filter yourself?

If your language is based on the mantra "everything are just functions!!! xddd" then the category of types based on your language better be closed and monoidal, or that's a direct contradiction.
>not closed => not everything are functions
>not monoidal => not everything behaves like functions
What the fuck were Shitkellers doing? This is a catastrophe.

I'm not that good at regex. Give me a hint.
Yeah, plebbit spacing posts would be nice to ignore too.

all languages have strings
even if your hard drive had no software on it and only stored one big text file it would have strings

>What the fuck were Shitkellers doing?
Pretending to understand at least the very basics of category theory. Their kind is known for this.

let me know when you solve the halting problem so we can rewrite the whole language

Not everything is a function you dumbass, that would be far too slow

>Every other language made after 1983 has the ability to do this baked in
>Python, touted as the king of "you just write it and it happens!", has to import an entire library or makes you write the function from scratch

Yes you can but you have to import unistd

Is Trashkell truly the worst and most broken language currently available besides OOP trash?

you can import a single function from a library easy enough
i hate python but "import" is not a reason to dislike it
you negative shitposters are really anoying you know that
you dont even know why you hate the word import its just a cargo cult

Yeah don't worry, I'll be investigating non-Abelian qubits soon and hopefully we can make a quantumsupercomputer that solves the classical halting problem.
That's literally what functional programming is you stupid dick.

>That's literally what functional programming is you stupid dick.
If you think functional programming means that everything has to be a function, then you're a retard

Haskell is the worst language, apart from all the other languages

What are your plans for solving the quantum halting problem?

haskell is the only non-oop language worth using

Why would you be using a language with a broken and crippled type system if you have an above average IQ?

Rolling

L I B R A R I E S

you have a weird definition of broken and crippled

Dunno lol I just like making you CScucks lose your jobs.

haskell is fun to program in because haskell is the best language

Anything less expressive than the CoC (which is itself the bare minimum) is crippled trash.
This is wrong.

>losing jobs
>based on the imaginings of an anime-posting furry using something even more useless than haskell
I think we're safe, lads.

But everything really is a function at the most basic level in any language.

In assembly everything is a function. Just pick an address and call it.

Of course, not everything is a function that WORKS, but that's a different story

masturbating to loli and watching movies / erping with faggots

functions don't exist in assembly

Keep fighting the good fight, we're few in numbers it feels like.

This is what I have so far. Let's test it.

^[a-z]

Yeah they do. That's what the call and ret instructions are all about. And also the stack.

...

I thought avatars were against the rules

dlang.org/blog/2017/06/05/compile-time-sort-in-d/

Fuck it doesn't work. Come on guys, someone help me out.

...

I import maths functions I've defined all the time. Should I be complaining, like you, that these functions aren't standard? I can bet that no language has a farey_neighbours() function in the standard library. By your logic, this makes a language unusable. You're still going on with completely asinine arguments, while I can simply import interleave() and be done. There is no argument here.
>or makes you write the function from scratch
Is this supposed to be a problem? And see above: your logic fails when a given function isn't standard in any language, which is most functions.

filter this regex

is this supposed to impress people?

/dpt/ hates everything.

dlang-chan is unstoppable!

Interesting, my RegeEx did not filter this comment but did filter this. Anyone know why?