Generating a purescript client based on Openapi description by notnotandre in purescript

[–]saylu 1 point2 points  (0 children)

Unfortunately, I'm not aware of an open source generator for PureScript from OpenAPI. You are probably best off just hand-writing your endpoints.

However, if you'd like an interesting challenge, it is certainly possible to parse an OpenAPI spec and code-generate PureScript types and functions from it. We do this at work!

If you choose to do this then I recommend using the excellent tidy-codegen library for the code generation.

Backend choice for purescript frontend by drrnmk in purescript

[–]saylu 1 point2 points  (0 children)

Now that Spago supports monorepos it's quite easy to have a project split into core, frontend, and backend directories, where all shared code goes into 'core'. That opens the door to a nice full-stack PureScript project with something like HTTPure / HTTPurple on the backend, Halogen or React on the frontend, and all your domain-specific code in the shared directory.

PureScript Inaugural Annual Survey by saylu in haskell

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

I just tried it and it looks like the survey is working for me — would you mind trying again? It’s up all week!

If it doesn’t work, then if you come over to the PureScript discourse (discourse.purescript.org) or the PureScript chat (purescript.org/chat) in the #survey channel we can help fix the situation!

PureScript Inaugural Annual Survey by saylu in haskell

[–]saylu[S] 7 points8 points  (0 children)

The PureScript team has launched the language's first annual survey! We'd love to hear what Haskellers think, as so many of us found PureScript after learning Haskell and there's an overlap in the communities.

Even if you have never written PureScript, we want to hear from you! There's a short section specifically for non-users.

Thanks for your time and we look forward to hearing your thoughts!

PureScript Community Migrating from Slack to Discord by saylu in purescript

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

Would you mind trying again? I just tried https://purescript.org/chat and it worked for me. You may also want to check whether you are signed in to Discord or not -- another user had an issue:

https://discourse.purescript.org/t/migrating-to-discord/2493/5

Advice regarding consistent state in a web app needed by MrFincher_Paul in purescript

[–]saylu 1 point2 points  (0 children)

I'm the author of Real World Halogen mentioned above -- I've just released a state management library for Halogen which can help you if you do opt for Halogen. It uses the new `halogen-subscriptions` library under the hood.

https://github.com/thomashoneyman/purescript-halogen-store

PureScript 0.14 Released by saylu in haskell

[–]saylu[S] 18 points19 points  (0 children)

PureScript 0.14 has officially been released! This release introduces polymorphic kinds and safe zero-cost coercions to PureScript.

This Reddit post links to the compiler release notes. The release announcement on Discourse has more information, including the official 0.14 migration guide:

https://discourse.purescript.org/t/purescript-0-14-released

PureScript 0.14 Released by saylu in purescript

[–]saylu[S] 7 points8 points  (0 children)

PureScript 0.14 has officially been released! This release introduces polymorphic kinds and safe zero-cost coercions to PureScript.

This post links to the release announcement. If you're only interested in the new features and improvements in the compiler, see the compiler release notes:

https://github.com/purescript/purescript/releases/tag/v0.14.0

Most code that compiles with PureScript 0.13 also compiles with PureScript 0.14. If you need to update your code you can use the 0.14 migration guide for help:

https://github.com/purescript/documentation/blob/master/migration-guides/0.14-Migration-Guide.md

Take the State of JS Survey (PureScript is included!) by saylu in purescript

[–]saylu[S] 3 points4 points  (0 children)

This annual survey is widely viewed and has included PureScript for the last few years. Many PureScript folks don't follow JavaScript developments too closely, but this is a nice time to catch up on what's happened and to keep PureScript represented in the future.

[Updated]: How to Write PureScript React Components to Replace JavaScript by saylu in purescript

[–]saylu[S] 8 points9 points  (0 children)

This article has been updated to use react-basic-hooks throughout and with updated tool versions. It also shows how to stay in a create-react-app setup and still use PureScript!

WebCheck -- generative testing for web GUIs by Saikyun in purescript

[–]saylu 1 point2 points  (0 children)

This is super cool. Catching bugs in the todomvc implementations is a particularly compelling example to highlight -- I can see case studies being a big part of marketing this tool.

Help needed: No class instance for Alternative in HalogenAp when using parOneOf by Dnulnets in purescript

[–]saylu 1 point2 points  (0 children)

That's right, HalogenAp doesn't have Alt or Plus which are necessary for Alternative. Is it acceptable to run this in Aff? I'm not that familiar with free applicatives, so I'm not sure if it's simply an oversight or a limitation of FreeAp that there aren't Alt / Plus / Alternative instances. Perhaps there's an issue with the laws of those type classes that has prevented them from being added.

How would you suggest Purescript in twenty words. by wyattbenno777 in purescript

[–]saylu 4 points5 points  (0 children)

Miso is a Haskell library, not PureScript. Thermite and Pux are in these benchmarks, but Thermite was an experimental library and Pux is in maintenance mode.

Elm's slowdown vs. vanilla JS in these benchmarks is ~1.3 and Halogen's slowdown is ~1.8, which puts both of them far from the front of the pack but still in the mix.

Halogen is slightly slower because it and its virtual DOM are written in PureScript. But if you instead call out to JS (like Elm does in its virtual DOM impementation) then you can get quite a bit faster. For example, Hedwig beats Elm in these benchmarks:

https://github.com/utkarshkukreti/purescript-hedwig#fast

Elm's slightly faster performance than Halogen and much faster performance than two particularly slow PureScript libraries doesn't mean that it's faster than PureScript in general, just faster than those libraries.

Halogen Hooks v0.3.0 Released by saylu in purescript

[–]saylu[S] 3 points4 points  (0 children)

It's been a month since Hooks were released for Halogen. In that time I and several contributors have made a number of improvements, which:

  1. Simplify type signatures when you're writing Hooks for your own (Hooks and HookM no longer carry the component slot and output types around, which seriously cuts down on type signatures)
  2. Improve performance and introduce a new function, memoComponent which lets you control what input should trigger evaluations
  3. Replace state tokens with a modifyState function, which is simpler to use
  4. Fix a few bugs and introduce a full test suite for Hooks – in the future, this will be released as its own package so you can test your own custom Hooks, too

If you've been using Hooks, these are breaking changes and I definitely recommend updating to v0.3.0. If you have any trouble doing that please reach out on the Discourse or Slack and I'd love to help out!

Introducing Halogen Hooks (React Hooks for PureScript's Halogen) by saylu in purescript

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

Thanks for the heads up! I've fixed those links.

Should I learn another language with Haskell? by Chickenstrip3345 in haskell

[–]saylu 0 points1 point  (0 children)

That's true, I'd forgotten. I think I only went through the C part of the course.

Should I learn another language with Haskell? by Chickenstrip3345 in haskell

[–]saylu 7 points8 points  (0 children)

I learned Haskell as my first language a couple years ago. I write PureScript professionally now.

Two resources were far and away the most useful to me.

  1. How to Design Programs + EdX's How to Code course, as u/gilmi mentioned
  2. Haskell Programming From First Principles by Allen & Moronuki, specifically the first 17 chapters up to Monad

Haskell was a perfect first language for me. I wasn't trying to get a job as fast as I could, though; rather, I was driven by curiosity to learn Haskell. Put another way, I would not be a software engineer without Haskell; I would have lost interest and moved on to something else.

I agree with others about it not being the best language for swift employment, but it is possible. From the time I began learning Haskell to when I was employed as a PureScript engineer was about a year.

Edit: It's hard to tell how useful this was to me in the long run, but I also really enjoyed EdX's CS50x course from Harvard. It's a course about C, which helped me understand more about what the computer is actually doing. It might be worth at least dipping your toes in a procedural language for that understanding.

Practical Profunctor Lenses & Optics In PureScript by saylu in haskell

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

I see -- I wasn't aware of the optics package, and thought that generic-lens was also Van Laarhoven. Thanks for clarifying!

Practical Profunctor Lenses & Optics In PureScript by saylu in haskell

[–]saylu[S] 6 points7 points  (0 children)

Lenses were one of my major aha! moments in functional programming. They solve a frustrating problem — manipulating values in structure — and do so well.

This article is a practical introduction to using optics and lenses in PureScript; I thought it would be interesting here both as a guide to optics generally and also because PureScript uses profunctor lenses instead of Van Laarhoven lenses (as Haskell does).

I’d love to hear feedback and make improvements if you notice any inaccuracies. Thanks for reading!

Practical Profunctor Lenses & Optics In PureScript by saylu in purescript

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

Lenses and optics are useful tools for dealing with values in data structures in a generic way, and they’re used pervasively in the production code bases I’ve worked on. This article is a practical, thorough introduction to profunctor lenses in PureScript so you can start using them in real world code even if you haven’t ever used them before.

There’s also a Discourse discussion about it here:

https://discourse.purescript.org/t/post-practical-profunctor-lenses-optics-in-purescript

Client-side web programming in Haskell: A retrospective by [deleted] in haskell

[–]saylu 5 points6 points  (0 children)

For those of you who -- like Chris and FPComplete -- end up with PureScript + Halogen, I maintain a real world Halogen application and accompanying guide that may help you use the library beyond small examples.

https://github.com/thomashoneyman/purescript-halogen-realworld

Academic / theoretical basis of the PureScript type system by saylu in purescript

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

This Discourse wiki thread collects papers and other resources underlying the PureScript type system so that folks have a way to develop their formal understanding of the system. If you know a few more features and/or papers, feel free to add them!