Re: What is the story behind the type of undefined?

2015-02-01 Thread David Feuer
Yes it does. Thanks. For the sake of consistency, I'd rather even have separate functions with funny-looking types than hidden magic. That is, we could hypothetically have undefined# :: forall (a :: #) . a error# :: forall (a :: #) . String - a There's no mechanism in Haskell to create things

What is the story behind the type of undefined?

2015-02-01 Thread David Feuer
If I define {-# LANGUAGE MagicHash #-} g :: Int# - Int g 3# = 3 myUndefined = undefined then this gives a sensible type error about a kind mismatch: usual :: Int usual = g myUndefined but this, oddly enough, compiles: peculiar :: Int peculiar = g undefined GHCi and the definition in

Re: What is the story behind the type of undefined?

2015-02-01 Thread Richard Eisenberg
On Feb 1, 2015, at 2:07 PM, Adam Gundry a...@well-typed.com wrote: (There is a plan to get rid of this subkinding in favour of normal polymorphism, but it hasn't been implemented yet. See https://ghc.haskell.org/trac/ghc/wiki/NoSubKinds for more details.) The NoSubKinds plan *is*