Question: Haskell Question This tokenize function uses a given character to break up a string into a list of strings. Fill in the missing parts, shown

Haskell Question

This tokenize function uses a given character to break up a string into a list of strings.

Fill in the missing parts, shown by a ?

tokenize ? [] = ?

tokenize n xs = tok n xs ?

where

tok n xs acc

| xs == [] = ?

| n == ? xs = ? ++ tokenize n (? xs)

| ? = tok n (? xs) (acc ++ ?)

Example output:

> tokenize ',' "fish,broccoli,cereal"

["fish","broccoli","cereal"]

Thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!