[Haskell-cafe] Partially applied type synonyms

Ttt Mmm amindfv at mailbox.org
Fri Oct 8 02:15:07 UTC 2021


I was surprised to find the below code doesn't typecheck even with -XLiberalTypeSynonyms. Am I missing something or is this really not possible?

Thanks,
Tom

---

{-# LANGUAGE FlexibleInstances, KindSignatures, LiberalTypeSynonyms, StandaloneDeriving #-}
-- This works:
data Foo s x = Foo (s x) x
deriving (Eq)
-- This replacement doesn't:
{-
data Foo' sx x = Foo' sx x
deriving (Eq)
type Foo (s :: * -> *) (x :: *) = Foo' (s x) x
-}
data Bar (m :: * -> *) = Bar (m Int)

-- Neither of these typecheck:
x :: Bar (Foo Maybe)
x = undefined
deriving instance Eq (Bar (Foo Maybe))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20211008/2eb652b2/attachment.html>


More information about the Haskell-Cafe mailing list