[Haskell-beginners] Structural restrictions in type constructor

Petr Vápenka petr.vapenka at gmail.com
Mon Jun 22 19:18:02 UTC 2015


Maybe not exactly what you need but this was for me a kind of eye-opener
with regard to type system:

https://github.com/leonidas/codeblog/blob/master/2013/2013-02-19-typesafe-tictactoe.md

On Mon, Jun 22, 2015 at 9:09 PM, Rein Henrichs <rein.henrichs at gmail.com>
wrote:

> You can't do this at the type level in Haskell.
>
> On Mon, Jun 22, 2015 at 7:00 AM Matt Williams <
> matt.williams45.mw at gmail.com> wrote:
>
>> OK, I think this is clearly well beyond my level!
>>
>> Will insert some manual checking.
>>
>> Thanks,
>> Matt
>>
>> On 22 June 2015 at 14:51, emacstheviking <objitsu at gmail.com> wrote:
>>
>>> It *could* be done and might already have been done... I seem to recall
>>> a few months back somebody asked for a similar feature using one of the
>>> vector libraries, to limit one of the input vectors to a fixed length?
>>>
>>> You'd have to dig through the list archives though...
>>>
>>> On 22 June 2015 at 12:36, Imants Cekusins <imantc at gmail.com> wrote:
>>>
>>>> > But this is checking the values in the implementation, not a type
>>>> level
>>>> build time guarantee, isn't it?
>>>>
>>>> yep, correct. Could be caught by unit tests though :-P
>>>> _______________________________________________
>>>> Beginners mailing list
>>>> Beginners at haskell.org
>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>>
>>>
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> Beginners at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150622/a2d23226/attachment-0001.html>


More information about the Beginners mailing list