Skip to content

Open effects in Connection with a type parameter #20

@athanclark

Description

@athanclark

I'm not sure if this would actually solve this issue, but observe the compiler errors when you change line 13 of the example source to one of those -XNamedFieldPins inspired case statements:

Connection {onopen,onmessage,onclose,send,close,url} <- newWebSocket (URL "...")

and the references to socket.foo as well:

Error found:
in module Main
at /home/athan/dev/purescript-websocket-simple/example/src/Main.purs line 15, column 23 - line 25, column 29

  Could not match type
                        
    ( console :: CONSOLE
    , ws :: WEBSOCKET   
    , err :: EXCEPTION  
    | t1                
    )                   
                        
  with type
               
    handlerEff0

Now, I believe this is because handlerEff has been skolemized / existentially quantified for each of the fields in the Connection type, but I'm not exactly sure. In Haskell, I've always gotten around this by explicitly publicizing the type variables as parameters to my data type, rather than quantifying them verbatim. Do you think this is the cause of this issue, or is there something deeper? Thank you for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions