[Tutorial] Build a moving box with Purescript

Hello!

Earlier this year I built a toy app to learn more about Purescript. I tried to only use the languages standard library and see how this would go. I’ve just written a tutorial for people who are starting to learn the language just as I am.

The post is here. Any comments will be really helpful.

Cheers!

5 Likes

I think an update to use spago instead of pulp and bower would be a great change to help newcomers get off to a good start.

1 Like

This was a great write-up! One suggestion I have is that getNewDirectionAndDist doesn’t need to return an Effect, so could simplify the code a bit. On the usage site you’d then call it as

let Tuple vDirection newVDist = getNewDirectionAndDist vDir distValPxVert height

instead of

Tuple vDirection newVDist <- getNewDirectionAndDist vDir distValPxVert height

1 Like

I’ve never used it. Is pulp getting obsolete?

Thanks for the comments!
You are right. I’m not sure on why this function returns an Effect. I think it had to but after a refactor it didn’t need anymore. Good catch!

I think this post explains how I would do things lately: Recommended tooling for PureScript applications in 2019

1 Like

Thanks! I’ll take a look at that.