Skip to content

Type alias strings don't seem to work when used as typeclass constraints #2972

Description

@justinwoo

I want to make a type alias string, but it doesn't seem to work when I want to use it as a typeclass constraint. see:

module Main where

import Prelude

type E = "what"

class TestThing f where
  method :: f -> f

instance ttInt :: Fail E => TestThing Int where --  No type class instance was found for Prim.Fail E
-- instance ttInt :: Fail "inline works" => TestThing Int where -- this works
  method a =  a

foo :: Int
foo = method 0 -- fails with the above error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions