我有大量的 IConnection conn => conn -> IO () 函数,我需要执行这些函数来正确设置数据库。现在,它不是很漂亮,但我在 Haskell 中太初学者了,无法让它变得更好。
setup :: IConnection conn => conn -> IO ()
setup conn = do
setupUtterances conn
commit conn
setupSegments conn
commit conn
setupLevels conn
commit conn
setupLevelLevel conn
commit conn
setupTCLevelLevel conn
commit conn
setupPaths conn
commit conn
setupLabelTypes conn
commit conn
setupLegalLabels conn
commit conn
setupTracks conn
commit conn
setupVariables conn
commit conn
setupFeatures conn
commit conn
setupAssociations conn
commit conn
return ()
无论如何要缩短它?我在玩
sequence $ map ($ conn) [func1, func2,...]
但我无法让它工作。建议?