r/purescript • • Aug 26 '17

Why do we write type signatures left-to-right, when we normally compose functions right-to-left?

1 Upvotes

Example

toNumber :: Number <- Int
...

toString :: String <- Number
...

showInt :: String <- Int
showInt = toString <<< toNumber

Wouldn't this make more sense, as it would more closely correspond with the implementation?

Thoughts? Would right-to-left type signatures be something that you may want to experiment with if it had compiler support?


r/purescript • • Apr 24 '18

Union Types in Flow & Reason

Thumbnail
blog.jez.io
2 Upvotes

r/purescript • • May 23 '18

What's on the foundations of ReasonML

Thumbnail
imaginarycloud.com
2 Upvotes

r/purescript • • May 12 '20

How would you suggest Purescript in twenty words.

9 Upvotes

Checking out Purescript for our consumer app. We have a lot of people using the app daily and all of are devs love functional, but get too few chances to use it outside of side projects. Curios what the community would say in twenty words :)

When we first start using it, it will be vital business logic mostly. But then may expand to cover more areas.


r/purescript • • Dec 05 '17

LambdaConf 2018: Call for Proposals Opens

Thumbnail
lambdaconf2018.lambdaconf.us
6 Upvotes

r/purescript • • Mar 14 '22

purescript installation

Post image
3 Upvotes

r/purescript • • Dec 01 '16

Jobs in New Tech - PureScript

Thumbnail jobsinnew.tech
3 Upvotes

r/purescript • • Jul 26 '21

PureScript Community Migrating from Slack to Discord

13 Upvotes

The PureScript teams are moving from the Functional Programming Slack to our dedicated PureScript Discord server. You can join here: https://purescript.org/chat

The Slack channel will continue to exist, but as an unofficial gathering space only. To learn more about why we're migrating to Discord, please see this announcement:https://discourse.purescript.org/t/migrating-to-discord/2493

See you in there!


r/purescript • • Jul 14 '14

StackOverflow - PureScript FFI to Mocha

Thumbnail
stackoverflow.com
0 Upvotes

r/purescript • • Jun 19 '14

Stack Builders' Haskell Hangout With Eric Jones, Part III

Thumbnail
plus.google.com
0 Upvotes

r/purescript • • Jan 28 '15

PSC resource management

0 Upvotes

Is there a way to give or take resources from psc?


r/purescript • • Jan 29 '16

Managing Application State with PureScript & Redux

Thumbnail
blog.brakmic.com
5 Upvotes

r/purescript • • Jul 05 '15

purescript-derive-lenses

Thumbnail
github.com
5 Upvotes

r/purescript • • May 04 '20

PureScript got field names right, Haskell got them wrong

Thumbnail tek.brick.do
12 Upvotes

r/purescript • • Oct 30 '21

I wish there was a dart backend. Is there any “make your own backend” tutorial?

6 Upvotes

I am still evaluating the idea but the goal is to enjoy flutter cross platform UIs with the purity and clarity of ps for my next startup beginning from January. Dart is not terrible, but I always miss the ML types and abstractions, and very specially the strict purity.

I see there are many backends out there, and dart supports many purescript data types (with some lack). Also not sure how to deal with the mutable aspects of dart in the purescript side.

If this is a feasible work to do under two months I would give it a try and ask for some help in order to build a robust open source backend with the goal of becoming a real ASAP.

Is there any information relative to making new backends including standardized tests? Is there anyone interested willing to contribute?


r/purescript • • Jan 24 '22

Trouble understanding applyFlipped

1 Upvotes

Hello,

I am currently working through a purescript book and really enjoying everything I’m learning! I’m currently working through implementing stock Prelude functions. Apply and flip were easy enough to understand:

apply :: forall a b. (a -> b) -> a -> b apply f x = f x

flip :: forall a b c. (a -> b -> c) -> b -> a -> c flip f x y = f y x

Now, for the implementation of applyFlipped, the book implements it as:

applyFlipped :: forall a b. a -> (a -> b) -> b applyFlipped = flip apply

So from my understanding, applyFlipped accepts two arguments: a parameter of type a, and a function that accepts a parameter of type a and returns a parameter of type b. Because purescript is implicitly right-associative, that would mean that the function with explicit parameters would read:

applyFlipped x f = (flip (apply x f))

My question is: why does the compiler interpret this as flip with parameters apply, x, and f, rather than interpreting it as apply with parameters x and f (which wouldn’t compile), whose result is a parameter for flip?


r/purescript • • Jun 18 '23

Change an element inside SVG

1 Upvotes

Hello guys! I have a SVG image like the following:

It is a simple SVG with a number in it. The SVG file looks something like this:

<svg ...>
  <g ...>
    <text id="my_text" ...>
      <tspan ...>
        6
      </tspan>  
    </text>  
    ...
  </g>  
</svg>  

I can load it in purescript Halogen:

import Halogen.HTML
import Halogen.Svg.Elements
import Halogen.Svg.Attributes

loadImage :: forall w i. HTML w i
loadImage = image [x 0.0, y 0.0, width 36.0, height 36.0, href "assets/my_image.svg"]

How can I programmatically change the number "6" in it? Can I modify the VDom in the HTML w i? Any other method? Thanks


r/purescript • • Nov 13 '22

How to compose predicates

1 Upvotes

Can someone help me understand this code...I feel like the infix is confusing me...along with not undertsand which Applicative instance is being used here...Is the instance just function?

The question was around how to compose predicates. I would also like to combone predicates and it seems worthwhile to me to understand this code. (Code is haskell btw)

https://stackoverflow.com/questions/64452181/elegant-way-to-combine-multiple-filtering-functions-in-haskell

import Control.Applicative (liftA2)
-- given f1 etc.
filtered = filter (f1 <&&> f2 <&&> f3) [1..90]
  where
    (<&&>) = liftA2 (&&)

r/purescript • • Nov 30 '22

Does anyone have a solid understanding of `NonEmpty Array` vs `NonEmptyArray`

1 Upvotes

Coming from Scala, the `Every` type seems to be much more coherent. In Purescript it seems like I am forever having to change between the two types to leverage basic functionality.

For example I feel like I'm doing crazy stuff like the following code. I've got a `NonEmptyArray` but the only way to add a new value seems to be to convert back to `Array` use the `cons` infix operator, then convert back to NonEmptyArray....

Pretty sure I'm doing something wrong here...But this difficulty in usage combined with the `NonEmpty Array` vs `NonEmptyArray` types got be confused. Has anyone got a solid undestanding?

someInts :: NonEmptyArray Int
anInt :: Int

fromNonEmpty (anInt :| toArray someInts) :: NonEmptyArray Int

r/purescript • • Jul 02 '18

Lift into a Functor with pure

Thumbnail
medium.com
1 Upvotes

r/purescript • • Jul 08 '14

PureScript Book In Progress

Thumbnail
github.com
1 Upvotes

r/purescript • • Aug 07 '21

This language is super fucking hard

23 Upvotes

I am dumb as a bag of rocks, no further commentary


r/purescript • • Jan 16 '20

LambdaConf 2020 Call for Proposals - Submit Purescript Proposals by Feb 15 (June 3-5, Estes Park, CO)

Thumbnail
lambdaconf.zohobackstage.com
8 Upvotes

r/purescript • • Jul 17 '25

Is it worth learning PureScript? So far the experience was less than ideal.

9 Upvotes

I am not a Java or SQL programmer, but I was able to quickly get up and going. The error messages made sense. The documentation had plenty of excellent examples.

Here you get confusing type errors. Some examples on the web appear to be broken on purpose, so they are useless. Type signatures are not examples. There is very little traffic on the discourse. Copilot gives nonsense answers and even contradicts itself.

So, I am asking, is there a light at the end of the tunnel? How did you get over the inability to write a simple variant of a simple project?

Was it worth to persist and why?


r/purescript • • Jul 10 '14

YouTube - PureScript Setup

Thumbnail
youtube.com
2 Upvotes