Migrated CI discovery logic to Haskell code