Skip to content

Conversation

paf31
Copy link
Contributor

@paf31 paf31 commented Aug 22, 2017

Closes #62.

I started rewriting things in small steps, as an exercise, instead of rewriting everything at once. This way, we'll at least start getting some benefit from the type system.

More to come...

@paf31
Copy link
Contributor Author

paf31 commented Aug 27, 2017

This is now ready for review. I might refactor the jQuery code a bit, but I'll probably leave that for a separate PR, since everything is working here.

@paf31 paf31 changed the title [WIP] PureScript rewrite PureScript rewrite Aug 27, 2017
@paf31
Copy link
Contributor Author

paf31 commented Aug 27, 2017

I'll merge this soon if there are no objections. I've tested it pretty thoroughly.

@soupi What do you think?

@soupi
Copy link
Contributor

soupi commented Aug 27, 2017

I'll take a good look at this this evening :)

Copy link
Contributor

@soupi soupi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can push this and refactor as we go. It looks a bit intimidating at first but I don't think it's hard to get into and make changes which is the important thing.

src/Main.purs Outdated
code <- fold <$> (JQuery.select "#code_textarea" >>= JQuery.getValueMaybe)

let displayPlainText s =
JQuery.select "#column2" >>= \jq -> do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use do notation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks.

src/Main.purs Outdated
execute :: forall eff. JS -> JS -> BackendConfig -> Eff (dom :: DOM | eff) Unit
execute js bundle bc@(BackendConfig backend) = do
let html = joinWith "\n"
[ "<!DOCTYPE html>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a bit more readable and easier to change with """ instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

src/Main.purs Outdated
cacheCurrentCode
hideMenus

getBackend :: Backend -> BackendConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go in Types.purs imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved all of this under API actually. To do what I wanted, it had to be that way to avoid a dependency cycle.

@paf31
Copy link
Contributor Author

paf31 commented Aug 27, 2017

Thanks for the review @soupi, I'll get back to this today hopefully.

@paf31 paf31 merged commit 88903cf into gh-pages Aug 28, 2017
@paf31 paf31 deleted the purs-rewrite branch August 28, 2017 02:51
@paf31
Copy link
Contributor Author

paf31 commented Aug 28, 2017

I've refactored the view code a little bit. I think it's slightly nicer now, but we could still do some more work on it.

@soupi
Copy link
Contributor

soupi commented Aug 28, 2017

Congrats 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants