[Haskell-cafe] Confused about type seen in the wild

Andres Löh andres at well-typed.com
Thu Apr 10 18:40:03 UTC 2014


Sorry for continuing to reply to myself. But all this seems fixed in 7.8.1:

Prelude> let whee :: (Show a, Eq a, a) => Bool; whee x = x == x && null (show x)

<interactive>:5:28:
    Expected a constraint, but 'a' has kind '*'
    In the type signature for 'whee': whee :: (Show a, Eq a, a) => Bool
Prelude> let whee :: (Show a, Eq a) => a => Bool; whee x = x == x &&
null (show x)

<interactive>:6:31:
    Expected a constraint, but 'a' has kind '*'
    In the type signature for 'whee':
      whee :: (Show a, Eq a) => a => Bool

Cheers,
  Andres

On Thu, Apr 10, 2014 at 8:37 PM, Andres Löh <andres at well-typed.com> wrote:
> And even more:
>
> Prelude> let test :: (Eq a, a, Eq b, b) => a; test = const
> Prelude> :t test
> test :: (Eq a, Eq b) => a -> b -> a
> Prelude> let test :: (Eq a, Eq b, a, b) => a; test = const
> Prelude> :t test
> test :: (Eq a, Eq b) => a -> b -> a
> Prelude> let test :: (a, b, Eq a, Eq b) => a; test = const
>
> <interactive>:19:35:
>     Predicate `a' used as a type
>     In the type signature for `test': test :: (a, b, Eq a, Eq b) => a
>
> Cheers,
>   Andres
>
> --
> Andres Löh, Haskell Consultant
> Well-Typed LLP, http://www.well-typed.com
>
> Registered in England & Wales, OC335890
> 250 Ice Wharf, 17 New Wharf Road, London N1 9RF, England



-- 
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com

Registered in England & Wales, OC335890
250 Ice Wharf, 17 New Wharf Road, London N1 9RF, England


More information about the Haskell-Cafe mailing list