[Haskell] ANNOUNCE: HaRP (Haskell Regular Patterns) version 0.1
Andreas Farre
d00farre at dtek.chalmers.se
Sun May 16 15:54:53 EDT 2004
Dylan Thurston said:
> By the way, are nested regular expression matches allowed? Something
> like:
>
> foo :: [[Int]] -> Int
> foo [/ _* [/ 5* a 6* /] _* /] = a
Yep.
> ? If so, what is the type of a in
>
> foo [/ _* [/ 5* a* /]* _* /]
>
It would be [[Int]] because of the fact that [/ 5* a* /] alone would have
type [Int] and therefore in that case a would also have type [Int].
Repeating this would cause it to have type [[Int]].
/Andreas
--
Andreas Farre
some cannot be created more equal than others
More information about the Haskell
mailing list