Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Conversation

@paulyoung
Copy link
Contributor

@paulyoung paulyoung commented Jun 27, 2018

There are a few things to discuss here, which I'll point out.

I think the biggest change is using sharkdp/purescript-decimals instead of purescript-contrib/purescript-precise. The former seems better maintained but has a JavaScript dependency.

derive instance eqTextBox ∷ (Functor f, Eq (f String), Eq (f HN.HugeNum), Eq (f DT.Time), Eq (f DT.Date), Eq (f DT.DateTime)) Eq (TextBox f)
derive instance ordTextBox ∷ (Functor f, Ord (f String), Ord (f HN.HugeNum), Ord (f DT.Time), Ord (f DT.Date), Ord (f DT.DateTime)) Ord (TextBox f)
derive instance eqTextBox ∷ (Functor f, Eq (f String), Eq (f D.Decimal), Eq (f DT.Time), Eq (f DT.Date), Eq (f DT.DateTime), Eq1 f) Eq (TextBox f)
derive instance ordTextBox ∷ (Functor f, Ord (f String), Ord (f D.Decimal), Ord (f DT.Time), Ord (f DT.Date), Ord (f DT.DateTime), Ord1 f) Ord (TextBox f)
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 don't understand this but I had to add Eq1 and Ord1 here to get this to type check.

I'm seeing this test failure locally:

Original:
   (Right (SlamDown ((Paragraph ((FormField "name" false (TextBox (PlainText (Compose (Just (Literal "Phil Freeman")))))) : Nil)) : Nil)))
Printed:
   (Right "name  = ______ (Phil Freeman)\n")
Parsed:
   (Right (SlamDown ((Paragraph ((FormField "name" false (TextBox (PlainText (Compose (Just (Literal "Phil Freeman")))))) : Nil)) : Nil)))
/Users/py/projects/slamdata/purescript-markdown/output/Data.Eq/index.js:13
var Eq1 = function (eq1) {
                   ^

RangeError: Maximum call stack size exceeded
    at new Eq1 (/Users/py/projects/slamdata/purescript-markdown/output/Data.Eq/index.js:13:20)
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:90:16
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:66
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:77
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:77
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:77
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
* ERROR: Subcommand terminated with exit code 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, not a test failure 😄

@paulyoung
Copy link
Contributor Author

FWIW I opened purescript-contrib/purescript-precise#13 so we could keep using that if necessary.

@paulyoung
Copy link
Contributor Author

This now depends on my PR for purescript-precise.

Still getting a stack overflow:

Original:
   (Right (SlamDown ((Paragraph ((FormField "name" false (TextBox (PlainText (Compose (Just (Literal "Phil Freeman")))))) : Nil)) : Nil)))
Printed:
   (Right "name  = ______ (Phil Freeman)\n")
Parsed:
   (Right (SlamDown ((Paragraph ((FormField "name" false (TextBox (PlainText (Compose (Just (Literal "Phil Freeman")))))) : Nil)) : Nil)))
/Users/py/projects/slamdata/purescript-markdown/output/Data.Eq/index.js:13
var Eq1 = function (eq1) {
                   ^

RangeError: Maximum call stack size exceeded
    at new Eq1 (/Users/py/projects/slamdata/purescript-markdown/output/Data.Eq/index.js:13:20)
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:90:16
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:66
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:77
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:77
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:84:77
    at /Users/py/projects/slamdata/purescript-markdown/output/Data.Functor.Compose/index.js:91:59
* ERROR: Subcommand terminated with exit code 1


derive instance eqTextBox ∷ (Functor f, Eq (f String), Eq (f HN.HugeNum), Eq (f DT.Time), Eq (f DT.Date), Eq (f DT.DateTime)) Eq (TextBox f)
derive instance ordTextBox ∷ (Functor f, Ord (f String), Ord (f HN.HugeNum), Ord (f DT.Time), Ord (f DT.Date), Ord (f DT.DateTime)) Ord (TextBox f)
derive instance eqTextBox ∷ (Functor f, Eq (f String), Eq (f HN.HugeNum), Eq (f DT.Time), Eq (f DT.Date), Eq (f DT.DateTime), Eq1 f) Eq (TextBox f)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should be

derive instance eqTextBox :: (Functor f, Eq1 f) => Eq (TextBox f) 
derive instance ordTextBox :: (Functor f, Ord1 f) => Ord (TextBox f) 

@cryogenian
Copy link
Member

The fact travis is unhappy is very interesting, I'm not absolutely sure, but this might be somehow connected with Eq1 deriving. Perhaps @garyb could say something about it :)

derive instance eqTextBox ∷ (Functor f, Eq (f String), Eq (f HN.HugeNum), Eq (f DT.Time), Eq (f DT.Date), Eq (f DT.DateTime)) Eq (TextBox f)
derive instance ordTextBox ∷ (Functor f, Ord (f String), Ord (f HN.HugeNum), Ord (f DT.Time), Ord (f DT.Date), Ord (f DT.DateTime)) Ord (TextBox f)
derive instance eqTextBox ∷ (Functor f, Eq1 f) Eq (TextBox f)
derive instance ordTextBox ∷ (Functor f, Ord1 f) Ord (TextBox f)
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 believe this is the code relating to the stack overflow.

@garyb
Copy link
Member

garyb commented Jun 28, 2018

I'll take a look!

@garyb
Copy link
Member

garyb commented Jun 28, 2018

Ok, after much head scratching, it's a problem with Eq for Compose: purescript/purescript-functors#16

I'll push some other changes into this branch though, as a lot of the Eq / Ord constraints in here are avoidable.

@paulyoung
Copy link
Contributor Author

I think this should be good now. Thanks @garyb!

@garyb garyb merged commit 4c7ed28 into slamdata:master Jun 30, 2018
@paulyoung paulyoung deleted the paulyoung/0.12 branch June 30, 2018 22:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants