Skip to content

type instance doesn't work when the type is (->)

This doesn't work in 7.0.0.20100924. It works fine in 6.12.3.

{-# LANGUAGE TypeFamilies #-}
type family T t :: * -> * -> *
type instance T Bool = (->)
f :: T Bool Bool Bool
f = not

This is the error:

    Couldn't match type `T Bool' with `(->)'
    Expected type: T Bool Bool Bool
      Actual type: Bool -> Bool
    In the expression: not
    In an equation for `f': f = not
Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information