Skip to content

weird error message from type qualification mistake

{-# LANGUAGE GADTs, RankNTypes  #-}

data Parity a where
  Odd :: Int -> forall a. Parity (Int,Int,a)

(the "forall a" is in the wrong place) gives the error message

    Malformed constructor result type:
      forall a :: k_a3Gz. Parity (Int, Int, a)

That k_a3Gz. is a little bit cryptic.

--solrize

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information