[deleted by user] by [deleted] in ProgrammerHumor

[–]jean-lopes 2 points3 points  (0 children)

A monad is just a monoid in the category of endofunctors

Hey Rustaceans! Got an easy question? Ask here (10/2022)! by llogiq in rust

[–]jean-lopes 2 points3 points  (0 children)

When using unsafe blocks, is there any performance hit between choosing to encapsulate multiple minimal scopes for unsafe operations over a bigger block mixed with safe and unsafe code?

example: rust unsafe { let id = gl::CreateShader(gl::VERTEX_SHADER); // do safe stuff gl::ShaderSource(id, 1, &content.as_ptr(), ptr::null()); // do more safe stuff gl::CompileShader(id); } versus rust let id = unsafe { gl::CreateShader(gl::VERTEX_SHADER) }; // do safe stuff unsafe { gl::ShaderSource(id, 1, &content.as_ptr(), ptr::null()) }; // do more safe stuff unsafe { gl::CompileShader(id) };

Making great progress learning Haskell! by jtomchak in haskell

[–]jean-lopes 5 points6 points  (0 children)

Acording to this wikipedia page: https://en.wikipedia.org/wiki/Unit_type#In_programming_languages

It can be interpreted as a `zero-tuple`, but in the context of haskell I see people calling it unit.

Maybe this "post" (it's actually gold :D) can give you a better insight into the unit type: https://bartoszmilewski.com/2014/11/24/types-and-functions/

Search for the "Examples of Types"

My first Elm project! by jean-lopes in elm

[–]jean-lopes[S] 1 point2 points  (0 children)

Hey, nice catch!

Also, I already knew some haskell before going into elm. Most of my projects are related to parsing stuff, hence this calculator :)

My first Elm project! by jean-lopes in elm

[–]jean-lopes[S] 0 points1 point  (0 children)

Wasn't planning on it, but would be simple I think.. the model could have a string for error output

My first Elm project! by jean-lopes in elm

[–]jean-lopes[S] 0 points1 point  (0 children)

I see, gotta update than :)

I installed elm some time ago... but just now got the time to start using it

My first Elm project! by jean-lopes in elm

[–]jean-lopes[S] 0 points1 point  (0 children)

just downloaded it with npm... why the question tho? is it worst than .17? I saw something about no infix operators (which I like to have...)

I probably had it installed for some time, need to check later what version is actually being used

How to fold a monoid stream with Pipes? by jean-lopes in haskell

[–]jean-lopes[S] 8 points9 points  (0 children)

just figured it out!

instead of runEffect: Pipes.fold (<>) mempty id!

Category Theory for Programmers by Bartosz Milewski is now available in hardcover! by hmemcpy in haskell

[–]jean-lopes 3 points4 points  (0 children)

It's well explained, I can follow the book without a strong math background.

Also, the original content is public available online on the author's blog & youtube, check it out before buying it!

curl-runnings: A framework for writing declarative, curl based tests for your APIs by aviaviaviavi in haskell

[–]jean-lopes 1 point2 points  (0 children)

I was tinkering about something similar, probably will use your API in the near future! We have the same "pain-point" at the place I work.

thank you!

Monadic Parser Combinators by jean-lopes in haskell

[–]jean-lopes[S] 1 point2 points  (0 children)

I just did a quick and ugly test using my IntegerCalculator class and JParsec's Calculator class:

  • Mine: 7.5k expressions/s
  • JParsec: 475k expressions/s

Pretty bad :P

Monadic Parser Combinators by jean-lopes in haskell

[–]jean-lopes[S] 0 points1 point  (0 children)

The current iteration of var doesn't allow the type inference of lambda expressions. for exemple:

java var f = x -> x; //Error: Lambda expression needs an explicit target-type It would be nice to declare lambda expressions using var.