[Haskell-cafe] Building ? using kleene closure {not haskell specific}

C K Kashyap ckkashyap at gmail.com
Fri Aug 12 15:21:29 CEST 2011


On Fri, Aug 12, 2011 at 4:34 PM, Sebastian Fischer <fischer at nii.ac.jp>wrote:

> > I can easily understand how + can be built but am having trouble with
> > building ? (zero or one).
>
> If there is a regular expression e for the empty word, one can define ? as
>
>    a? = e | a
>
> If there is a regular expression o that never matches one can define e as
>
>    e = o*
>
> If there are character classes one can define o as
>
>    o = []
>
> Apart from that, I have no idea..
>
> Sebastian
>

Thanks Sebastian ... this is what I was asking for. I'll try and digest it.

Regards,
Kashyap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110812/aa075e68/attachment.htm>


More information about the Haskell-Cafe mailing list