paulyoung / purescript-corefn

A library for working with the PureScript functional core.
Apache License 2.0
23 stars 7 forks source link

Uncomment broken Functor instances #43

Closed paulyoung closed 6 years ago

paulyoung commented 6 years ago

This is just to demonstrate the issue with some Functor instances in #42.

paulyoung commented 6 years ago

@kritzcreek said:

Did you try to inline the type synonym? I think the problem might be in type Bind' a = Tuple (Tuple a Ident) (Expr a) the one a there appears on the left tuple side, the generated code might be trying to map over it instead

@garyb said:

yup, that's the one deriving can't deal with the need to lmap or anything - it will only attempt to map on the inner values

paulyoung commented 6 years ago

@kritzcreek said:

It works out because GHC has special knowledge about tuples I guess If you use a record instead of a tuple type in the PS code it might work?

LiamGoodacre commented 6 years ago

Yes, you'll need to either write a manual instance, switch to a record, or use something like Product (Tuple Ident) Expr a to turn everything into a Functor looking shape.