[Haskell-cafe] Manual type-checking in graphs: Avoidable?

Benjamin Edwards edwards.benj at gmail.com
Sat Feb 20 19:59:05 UTC 2016


if you are willing to have a closed universe, you can pattern match on a
gadt to do do the unpacking

On Sat, 20 Feb 2016 at 19:19 Jeffrey Brown <jeffbrown.the at gmail.com> wrote:

> Yes, that is my point. Existentials cannot be unwrapped.
>
> On Sat, Feb 20, 2016 at 4:18 AM, Kosyrev Serge <
> _deepfire at feelingofgreen.ru> wrote:
>
>> Jeffrey Brown <jeffbrown.the at gmail.com> writes:
>> > After further study I believe existentials are not (at least alone)
>> > enough to solve the problem.
>> ..
>> > getInt :: ShowBox -> Int
>> > getInt (SB i) = i
>> >
>> > will not compile, because it cannot infer that i is an Int:
>>
>> You take a value of an existentially quantified type (which means it
>> can be anything at all, absent some extra context) and *proclaim* it
>> is an integer.
>>
>> On what grounds should the compiler accept your optimistic restriction?
>>
>> --
>> с уважениeм / respectfully,
>> Косырев Сергей
>>
>
>
>
> --
> Jeffrey Benjamin Brown
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160220/7e870dc8/attachment.html>


More information about the Haskell-Cafe mailing list