Version You an API for Great Good!

Version You an API for Great Good!

Submitted October 21, 2017 at 12:22PM by jxv_
via reddit


Generalization of ((,) ) >>= ()

Generalization of ((,) <$>) >>= (<*>)

Let's consider the following functions:

((,) <$>) >>= (<*>) ((,,) <$>) >>= (<*>) >>= (<*>) ((,,,) <$>) >>= (<*>) >>= (<*>) >>= (<*>) 

and so on. If applied to a list, the first of them returns every possible 2-tuple of elements from that list, the second returns every possible 3-tuple, the third every possible 4-tuple and so on.

What would be the least tricky ways to write (in a recognizable fashion) a function that accepts n and a list and returns every possible n-tuple of elements from that list? To be honest, I don't even know what its signature would be if the resulting tuples can be of different lengths. Should I just use lists instead? Like

((. return) . (:) <$>) >>= (<*>) ((. ((. return) . (:))) . (.) . (:) <$>) >>= (<*>) >>= (<*>) 

and so on? Actually, I don't know how to generalize that either.

Any help would be appreciated.

Submitted October 21, 2017 at 02:49AM by zabolekar
via reddit

Anyone in need of a binding to MSBuild?

Anyone in need of a binding to MSBuild?

Hi everyone, I'm prototyping a Haskell binding to MSBuild. My own use case is pretty simple: I need to make a few C++ calls to Windows SDK, but mingw only plays well with old-school C-style Win32 API. The same cpp file compiles smoothly with cl.exe but not with g++.exe.

I wonder if there's any Haskeller out there who has similar demand: querying & invoking MSBuild, for calling into Windows SDK or .NET or whatever from Haskell. Please feel free to describe your use case if you're interested! Thanks.

Submitted October 21, 2017 at 02:55AM by terrorjack
via reddit

[question] Can’t find an example for this yaml format

Can’t find an example for this yaml format

I'm trying to parse this format of yaml:

yaml - action: - description: some description - project: inbox - contexts: [ online, computer ] - action: - description: some other description description - project: inbox - contexts: [ online, computer ]

I've looked through the examples and tests, and also looked at some of the aeson examples, but couldn't figure out how to parse this.

I created this code:

It compiles, but the result is Nothing. If I remove the outer action (and the whole second set of values), then I can use the Action type to parse the yaml, and can get this:

Just (Action {description = "some description", project = "inbox", contexts = ["online","computer"]})

So while it feels I'm close to the solution, I've been unable to get it working. What am I doing wrong?


Submitted October 21, 2017 at 12:13AM by mlopes
via reddit

Development setup for Reflex

Development setup for Reflex

Hello! I am getting into Reflex, but I'm having a hard time getting a good setup going. I'm currently using Stack with Intero in Emacs, but reflex 0.5 and reflex-dom 0.4 isn't available on Stackage/Hackage, which is a major pain. Intero doesn't work with the the Reflex-platform either, so I'm stuck between using decent development tools or the newer version of reflex at the moment. How are you developing with Reflex? Do you have any advice for me and others looking into this? Cheers!

Submitted October 20, 2017 at 09:16PM by GreenEyedFriend
via reddit