[Haskell-cafe] bottomless Top?
jonathanccast at fastmail.fm
Thu May 15 20:13:26 EDT 2008
On 15 May 2008, at 4:29 AM, Conor McBride wrote:
> Replying slap-foreheadedly to own post...
> On 15 May 2008, at 11:56, Conor McBride wrote:
>> I'm also wondering whether it makes sense to have a
>> "bottomless Top" type, with constructor _ and lazy pattern _
>> (with (undefined :: Top) equal to _). Then the constant-time
>> shape operator makes the same sort of sense as the
>> inflate :: Functor f => f Zero -> f a
> We've got it already.
> data One
> would do, with smart constructor
> only :: One
> only = undefined
As I've mentioned before, my favorite data type
newtype One = One One
does the same, and stays in Haskell 98. (And has the same weakness
to seq: (`seq` ()) is perfectly strict (it's const undefined)).
More information about the Haskell-Cafe