[Haskell-cafe] Manual type-checking in graphs: Avoidable?
Kosyrev Serge
skosyrev at ptsecurity.com
Fri Feb 19 14:06:57 UTC 2016
Adding Richard to CC.
Tom Ellis <tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> writes:
> On Fri, Feb 19, 2016 at 03:07:59PM +0300, Kosyrev Serge wrote:
>> Tom Ellis <tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> writes:
>> > I agree. FGL seems inappropriate to model people owning hamsters because
>> > you genuinely want to reflect the difference between people and hamsters by
>> > having two different node types.
>>
>> What would you propose instead?
>
> If I were utterly insane I would propose that FGL be extended with
> higher-typed indexes, so instead of
>
> Gr :: * -> * -> *
>
> we would have
>
> Gr :: (k -> *) -> (k -> k -> *) -> *
>
> Then Hamster and Person would be the only inhabitants of some kind k, and
> you can could choose two different types to represent them, and four
> different types to represent the (directed) edges between them.
Richard, is something like this possible with what is in GHC 8?
Or would DataKinds already be sufficient for this?
--
с уважениeм / respectfully,
Косырев Сергей
More information about the Haskell-Cafe
mailing list