I thought you might also be wondering how to effectively create an actual infinite list, fibs style:
import Data.List (stripPrefix) data Letter = A | B deriving (Show, Eq) type Alphabet = [Letter] algae :: Alphabet -> Alphabet algae = concatMap f where f A = [A, B] f B = [A] infFromPrefix :: Eq a => ([a] -> [a]) -> [a] -> [a] infFromPrefix rule prefix = inf where inf = prefix ++ case stripPrefix prefix (rule inf) of Just suffix -> suffix Nothing -> error "Substitution does not preserve prefix" infAlgae :: Alphabet infAlgae = infFromPrefix algae [A] main :: IO () main = print . take 100 $ infAlgae
And in GHCi:
*Main> :main [A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,A,B,A,B,A,A,B,A,B,A,A,B,A]