[Tutorial] Build a moving box with Purescript

tutorial
#1

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
#2

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
#3

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
#4

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

#5

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!

#6

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

1 Like
#7

Thanks! I’ll take a look at that.