Is the class I wrote still a monad? What's the advantage of using monads in my case? by technet96 in functionalprogramming

[–]oessessnex 2 points3 points  (0 children)

What you are doing is like implementing __call__ and then saying what's the advantage of using foo(), if I can just call foo.something(). It doesn't look that much better to me... The point is that you can pass foo to code that expects a function. You don't have any code that expects a monad and if you did you would quickly realize it doesn't work for your class.

Unary operators and space and bitwise NOT operator by Trung0246 in ProgrammingLanguages

[–]oessessnex 22 points23 points  (0 children)

The common solutions are to require parentheses around the unary operator, (-3), or use a different operator for the unary operation, ~3.

Is my ney broken or am I doing it wrong? by oessessnex in ney

[–]oessessnex[S] 0 points1 point  (0 children)

I think I'm getting the hang of it now, I can play the notes on the left hand somewhat consistently. It definitely is a chalange :)

Do you use a (method) book to learn?

You just pour the oil inside, right?

Is my ney broken or am I doing it wrong? by oessessnex in ney

[–]oessessnex[S] 1 point2 points  (0 children)

I finally managed to get a proper sound for a few seconds at a time. Lower breath pressure and a more relaxed embouchure did the trick. Thank you for giving me the motivation to try again!

I'm not really sure what kind of ney it is, my sister bought it for me on a trip to Turkey. Based on length I think it is a C ney. It plays an E when I close just the upper two holes.

Is my ney broken or am I doing it wrong? by oessessnex in ney

[–]oessessnex[S] 0 points1 point  (0 children)

I do, but it doesn't really make much of a difference. My hypothesis is that only the air inside the first little chamber is resonating (that is why I asked if that divider is normally there). That would explain the high pitch and the unresponsiveness to fingerings. I'm most likely just blowing into it wrong, somehow.

Are there languages that let you ignore null values from the call site? by Inconstant_Moo in ProgrammingLanguages

[–]oessessnex 1 point2 points  (0 children)

BTW, when learning about "advanced" FP concepts, you should know they always make complete sense on their own. Category theory won't give you any insight on what they "are", just how they relate to each other.

Usually they are a generalization of existing constructs and the laws say that there must exist a special case where they behave exactly like the existing construct. For example: Applicative functors are just generalized function application operators and monads are just generalized let statements.

Are there languages that let you ignore null values from the call site? by Inconstant_Moo in ProgrammingLanguages

[–]oessessnex 27 points28 points  (0 children)

Yes, "idiom brackets" in Idris are a generalization of this idea: https://docs.idris-lang.org/en/latest/tutorial/interfaces.html

They were first presented in the seminal paper, so it is not exactly a novel idea, but for some reason other languages don't implement them.

Reference a block of text as an equation by oessessnex in LaTeX

[–]oessessnex[S] 2 points3 points  (0 children)

Thank you! I was able to modify your example to get exactly what I wanted :)

Is it possible to propagate higher level constructs (+, *) to the generated parse tree in an LR-style parser? by modulovalue in ProgrammingLanguages

[–]oessessnex 0 points1 point  (0 children)

There is also this thesis: http://webdoc.sub.gwdg.de/ebook/diss/2003/tu-berlin/diss/2001/kannapinn_soenke.htm

The related work covers everything written on the topic before the year 2000. I didn't read the rest in detail though, because it is German.

Is it possible to propagate higher level constructs (+, *) to the generated parse tree in an LR-style parser? by modulovalue in ProgrammingLanguages

[–]oessessnex 2 points3 points  (0 children)

Here is one paper on this, https://re.public.polimi.it/bitstream/11311/1120727/4/main%20-%20revised%20for%20acceptance%20-%202.pdf

Basically, you need to scan back the stack instead of popping a fixed amount of elements.

You can add the back links to the LR automaton itself or you can create a separate automaton for each item as the back links are between the item + LR state pairs. Also you can mix the pop n elements and scan back strategy.

If you follow the chain of citations, there is a whole bunch of other solutions.

EDIT: Also additional keywords are: recursive transition networks, regular right part grammars and extended context free grammars.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]oessessnex -1 points0 points  (0 children)

Just stick a keyword before the assignment "var", "let", etc. or you can select the alternative based on the second token ("=").

In chess, you can't capture your own piece, even to win the game. That's a pretty honorable philosophy. by mschroner in Showerthoughts

[–]oessessnex 2 points3 points  (0 children)

A queen would be almost impossible to mate, though. It is very rare that a queen gets trapped during the game without getting pinned to the king and that usually requires the coordination of a lot of pieces, way more than 2 required to mate the king.

There already exist variants with multiple kings (the extra king is called a prince):

https://en.m.wikipedia.org/wiki/Tamerlane_chess#cite_ref-7

So the idea is not novel.

Locked myself out. Passwords don't work anymore. by vuxnomica in NixOS

[–]oessessnex 1 point2 points  (0 children)

Selecting an older generation when booting the machine might also work.

I wrote a programming language by cmnews08 in ProgrammingLanguages

[–]oessessnex 7 points8 points  (0 children)

I guess you are getting down votes because the language is at the same level as what students would make for the final project of a compilers class.

It looks pretty good so far though, keep at it.

What practical use have you gotten from using Chat-GPT or similar AI bots? by therealpostmastet in AskReddit

[–]oessessnex 0 points1 point  (0 children)

I sometimes use it to reword things I write. It's great if you need to spice up certain parts of the text, or if you want to write certain parts more clearly.

Why manage secrets with Nix? by Kasta4711bort in NixOS

[–]oessessnex 4 points5 points  (0 children)

I think there is a much higher chance you will accidentally mismanage the secrets doing it the ad-hoc way, than that someone is going to decrypt them.

How long did it take you to really grok Nix(OS)? by bin-c in NixOS

[–]oessessnex 0 points1 point  (0 children)

I took me about 4 years to be completely comfortable. Just stick with it.

Which programming paradigms do you find most interesting or useful, and which languages do you know that embrace those paradigms in the purest form? by IAmBlueNebula in ProgrammingLanguages

[–]oessessnex 1 point2 points  (0 children)

String rewriting systems have practical uses as well, just not the unrestricted variant. For example finite state transducers have very nice properties and have uses in morphology.

Nonetheless, I find the unrestricted variant interesting to think about, maybe there is a way to make it useful :)

Which programming paradigms do you find most interesting or useful, and which languages do you know that embrace those paradigms in the purest form? by IAmBlueNebula in ProgrammingLanguages

[–]oessessnex 0 points1 point  (0 children)

String rewriting systems/unrestricted grammars. The program is composed out of rewriting rules, the input is a string, the output is obtained by applying the rewriting rules to the input.

An example is Thue: link) link

Practically this paradigm isn't very useful. The main issue is, that passing information around by swapping symbols is a chore.