Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Occurrences = List[(Char, Int)]
- def expand(acc: List[Occurrences], occurrence: (Char, Int)): List[Occurrences] = occurrence match {
- case (c, int) => (for (i <- (0 to int) ; ao <- acc) yield ((c, i) :: ao)).toList
- }
- // I have to use toList yet result is empty anyway
- expand(List[Occurrences](), ('a' ,3)) //> List()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement