
20 Apr
2009
20 Apr
'09
5:24 a.m.
Michael Mossey wrote:
toVerticals :: [[NamedTimedChord]] -> [[NamedTimedChord]] toVerticals [] = [] toVerticals staves = firstVertical : toVerticals remainder where time3 (_,time,_) = time firstVertT = minimum $ map (time3 . head) staves usingStaves = [ s | s <- staves, time3 (head s) == firstVertT ] notUsingStaves = [ s | s <- staves, time3 (head s) /= firstVertT ]
realized I could use Data.List.partition for this
firstVertical = map head usingStaves remainder = leftOfUsing ++ notUsingStaves leftOfUsing = filter (not . null) (map tail usingStaves) _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners