Skip to content

Symbol in typeclass bug? #3243

Description

@eviefp

Not sure how to express it in words, but:

class WithoutSym t where
  wrel   sym r2
       . IsSymbol sym
        RowCons sym t () r2
        RowLacks sym ()
        SProxy sym
        t
        { | r2 }

-- | This works fine
instance wsIntWithoutSym Int where
  wrel sym p = insert sym p {}


class IsSymbol sym <= Rel t sym where
  rel   r2
       . RowCons sym t () r2
        RowLacks sym ()
        SProxy sym
        t
        { | r2 }

instance relIntRel Int "test" where
  rel sym p = insert sym p {}
-- |          ^
-- | Could not match type
-- |   ( test :: Int
-- |   )
-- | with type
-- |   r24
-- | Prim.RowCons "test"
-- |              Int
-- |              ()
-- |              r24

Is this a compiler bug or is it expected? You can try it out: http://try.purescript.org/?backend=core&gist=855016e5488c0cafeedd98ff82955518

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions