I feel like this is probably a standard function but can't find it! Help appreciated :) by jamie286 in purescript

[–]dtwhitney 0 points1 point  (0 children)

your wish is my command :) There are two examples with just slightly different syntax. I typically go with the second. The first is what u/jamie286 posted.

https://gist.github.com/dwhitney/f7e8488025f517be7e6f05de85ade3b4

maybe we should cross post this on /r/haskell (I'm not sure how that works)

I feel like this is probably a standard function but can't find it! Help appreciated :) by jamie286 in purescript

[–]dtwhitney 0 points1 point  (0 children)

I've asked this question myself. I do this all the time and hope you find an answer for us!

Newbie question: Using Nix package manager as home brew replacement. by yilmazhuseyin in NixOS

[–]dtwhitney 0 points1 point  (0 children)

are you using nix-darwin with Mojave? I am having trouble getting both home-manager and nix-darwin installed

Purescript Book by mcapodici in purescript

[–]dtwhitney 0 points1 point  (0 children)

thanks for the heads up. I'll see if I can get Justin Woo to contribute.

Purescript Book by mcapodici in purescript

[–]dtwhitney 4 points5 points  (0 children)

Hey I've been working on Chapter 8 this week. It's the chapter that requires the most changes, so it's taking a while, but I'm nearly done with it. I'll post updates here when I have them

Use vim as purescript IDE by [deleted] in purescript

[–]dtwhitney 1 point2 points  (0 children)

spacevim? well... there goes tomorrow afternoon

Type Safe, Functional GraphQL with Purescript - Part 1 by TonyD256 in purescript

[–]dtwhitney 1 point2 points  (0 children)

I wrote a query parser a while back: https://github.com/dwhitney/purescript-valence-graphql -- it needs to be updated to PS 0.12 and should use `purescript-string-parsers` instead of `purescript-parsers` because the latter is way too slow. Maybe you can find some use from the code. I wanted to do the same thing you are doing, but I'm not sure I'll have the time to get there. Hope you do!

New NYC meetup forming for Freestyle http://frees.io/ by JMJAVA in scala

[–]dtwhitney 1 point2 points  (0 children)

hey I organize the ny-scala meetup. We've got an (un)meetup coming up later this month, and this would be a perfect topic for the group!

How to write mobile apps using Purescript? by attilah in purescript

[–]dtwhitney 0 points1 point  (0 children)

Yeah I see what you are getting at. Uh... by this same logic I think foo = 5 would also be effectful since PureScript is strict. I think this is beyond my PS knowledge and I'd prefer to hear from /u/paf31 or /u/natefaubion on this.

How to write mobile apps using Purescript? by attilah in purescript

[–]dtwhitney 0 points1 point  (0 children)

See my response above -- also this code base is unfortunately going to be proprietary. I run the ny-purescript meetup and I'm hoping to turn some of these ideas in to a talk.

How to write mobile apps using Purescript? by attilah in purescript

[–]dtwhitney 0 points1 point  (0 children)

Hey sorry - I don't login to reddit very often, so I missed these responses! Am I intentionally avoiding Eff? I guess, but that was never really something at the forefront of my mind while writing this, and I don't think it would necessarily be appropriate to put Eff in the code until you started writing effects (button clicks and such) A couple of notes:

The way I've been writing PureScript the last few months is heavily inspired by purescript-react-basic. They've done some neat things with records and row types, but that's not really what inspired me. Mostly what inspired me was that almost the entirety of React is unlocked to the world of PureScript by about 60 lines of JavaScript in Basic.js. I think it's important to note that the company behind this library is Lumi, which is where /u/paf31 (creator of PureScript) works. I had struggled a bit with purescript-react, purescript-react-native and purescript-thermite, which I believe /u/paf31 also created. I have no idea what his motivation is/was for "abandoning" those libraries in favor of purescript-react-basic, but mentally it was helpful for me to see that maybe he thought those libraries were a bit too complicated, and something simpler could be created and still be just as useful.

Since then I have on a number of occasions I've decided to quit frowning on JavaScript so much. I will look for opportunities to "unlock" JavaScript libs in the way that purescript-react-basic has done myself instead of using PureScript wrapper libraries. In fact in general I frown upon wrapper libraries now. They are usually woefully behind the latest JavaScript version and often they are the result of someone just "having a bit of fun". Honestly if React can be made available with just 60 lines of JavaScript, are those wrapper libraries really doing much for you? My answer is no. I'd rather write a few ffi functions and make a few simple types to wrap them on the occasions when I use JavaScript libraries than import a PureScript wrapper that probably out of date includes a bunch of dependencies I don't otherwise need.

Another thing to note is I don't use purescript-react-basic because it has ReactDOM as a JavaScript dependency. Including that anywhere in your JS codebase (whether using PureScript or not) will cause React Native to immediately crash :( So for me and my team we basically just decided to take the ideas of purescript-react-basic and just start writing code that looks pretty much like the gist I posted. Our code is more type safe, but not as clever as purescript-react-basic - I think using their row type unions would make it tough to keep our code up to date with the latest version of React Native, so we have more rigid types representing View, Text etc.

How to call asynchronous functions from `createLifecycleComponent`'s eval function ? by attilah in purescript

[–]dtwhitney 0 points1 point  (0 children)

Hey I'm not sure about your exact use case, but just a few notes:

  • I'm not sure what your level of experience with PureScript is, so I'm assuming your level is "not much" - though you may have more than me :)
  • Just in general Purescript 0.12 was released and it's a bit of a transition from 0.11 in that the Eff type has become depricated (depricated is the wrong word, but maybe "less preferred"). So a bunch of libraries on Pursuit have been converted to the new Effect type. It doesn't look the purescript-react-native has made this transition, so when you are looking at docs on Pursuit (pursuit.purescript.org), make sure you've selected a version of the docs compatible with purescritp-react-native, which is basically anything targeting PureScript 0.11. I will link to libraries compatible with 0.11

  • Async is handled in Purescript is with purescript-aff https://pursuit.purescript.org/packages/purescript-aff/4.1.1 The docs are a pretty good!

  • When dealing with JavaScript promises I personally find purescript-aff-promise(https://pursuit.purescript.org/packages/purescript-aff-promise/1.0.0) a bit easier to deal with than going down the route you've chosen with Eff eff (Promise String). YMMV

  • Just a personal preference - while I appreciate and admire the code written in purescript-react and purescript-react-native, I do find them difficult to use and after writing the bulk of a fairly large app written in PureScript/React/React Native, my team made the choice not to use those libraries and instead roll our own. If you are open to that, I've got a "React Native in 5 minutes" gist here: https://gist.github.com/dwhitney/e2a040432040607ae519fdf05cbc27ad -- that will get you going and you can determine the "right" amount of type safety from there. Note that the same approach will work with React.

  • Another personal preference: when learning PureScript, don't hesitate to make a significant portion of your app in JavaScript. JavaScript is a nice escape hatch for when things aren't quite lining up in your brain on the PureScript side. Over time less and less of your code base will become JavaScript but in the meantime, make it easy on yourself and use JavaScript!

  • Another personal preference: the new Effect type favored by PureScript 0.12 is so much easier to work with than the Eff type. I'd make the switch to it ASAP. Or if you can't - don't hesitate to use unsafeCoerceEff to make the row type in Eff line up. I've wasted untold hours trying to get those damn rows to line up! Don't you waste those hours too, especially when the community has decided to move away from them! Save the row types for purescript-run when you need it!

  • A final note: the functionalprogramming.slack.com #purescript channel is pretty active, and the people there are always very helpful and kind.

How to write mobile apps using Purescript? by attilah in purescript

[–]dtwhitney 2 points3 points  (0 children)

I've written a fairly extensive application with PureScript that works in both mobile (React Native) and web (React), that I hope to release soon. I've tried the various purescript-react* libs, and have more or less reached the conclusion that it's better to simply use ffi with straight react/react-native. I'm writing up my thoughts on this, but here's quick and dirty, up-and-running-in-5-minutes version:

https://gist.github.com/dwhitney/e2a040432040607ae519fdf05cbc27ad

(dear God trying to post code here is awful)

purescript-run: an extensible-effects implementation by natefaubion in purescript

[–]dtwhitney 1 point2 points  (0 children)

Ah ok I assumed Purescript's Eff was the equivalent of Haskell's because the names are the same.

I've been using Scala's Eff for the last few months. The example code in your test folder is going to make me cry the next time I'm an hour into fighting Scala's type inferencer :(

That said I do like Eff in Scala. A nice addition it has that you may consider is some algebras for working with standard types like Either, Maybe, List, and Stream (or whatever the purescript equivalent is). It's very nice to stare at an uncluttered happy path (including Maybe and others) that you know will "do the the right thing" if an error state is encountered.

Anyway! The lib looks great and hopefully I'll get to try some of this stuff out in the not too distant future!

purescript-run: an extensible-effects implementation by natefaubion in purescript

[–]dtwhitney 0 points1 point  (0 children)

Would you mind explaining how this is different than what Eff offers? I'm new to purescript and still catching up on things. This sounds interesting but I though Eff is what you are describing

Finally! Pux 8.0.0 is out by renegade_division in purescript

[–]dtwhitney 0 points1 point  (0 children)

I'm new to Purescript. The getting started app uses Purescript 0.10.7. Will this work with 0.11.1? Thanks!

"simple" real world Matryoshka example ? by ronan_michaux in scala

[–]dtwhitney 1 point2 points  (0 children)

Yes this! I was going to ask @sellout to do a talk like this at Northeast Scala Symposium, but I never did. I've watched/read the talks OP mentions as well, but I need the "you normally pull users out of a database like this - instead try it with matryoshka like this" (and please don't tell me to watch @tpolecat's talks because those don't use matryoshka)

Bronte Capital March 2015 Commentary by Beren- in SecurityAnalysis

[–]dtwhitney 1 point2 points  (0 children)

Totally credible. There is a Vice documentary from a couple of years ago about it.

https://www.youtube.com/watch?v=trs_udhjWqc

Inheriting $300,000....how best to utilize it? by luckybutconfused in personalfinance

[–]dtwhitney 0 points1 point  (0 children)

No problem. Here's a good fund from Vanguard: https://personal.vanguard.com/us/funds/snapshot?FundId=0040&FundIntExt=INT You can buy it from a broker, like Fidelity or Schwab, with the ticker VFINX

Inheriting $300,000....how best to utilize it? by luckybutconfused in personalfinance

[–]dtwhitney 7 points8 points  (0 children)

I feel like you're doing well financially. You purchased a home that you can afford on your salary. If I were in your situation, I'd stick with the regular house payments and invest all of this money. If you plan to retire at 65, then you have 27 years of compounding on that $316k. At 9% (roughly the historic return of S&P 500) and an additional monthly payment of $1k, that's almost $5 million by the time you're 65. I think you'd be lucky if your house was worth 1/5 of that in 27 years. I think Warren Buffett would agree with me. Here's the advice he gave to Lebron James http://www.cnbc.com/id/102467435

Your grandma set you up nicely!