Unnecessary signature.
[advlib.git] / src / Advent / Input.hs
blob92811173082e5de026ce736b1de6e563b357c882
1 module Advent.Input where
3 import Text.Regex.TDFA
4 import Text.Regex.TDFA.String ()
6 -- TODO: Fully automatic input format detection and parsing.
8 findAll :: String -> String -> [String]
9 findAll r x = getAllTextMatches $ x =~ r
11 findAllRead :: Read b => String -> String -> [b]
12 findAllRead = (map read .) . findAll
14 findAllNums :: String -> [Int]
15 findAllNums = findAllRead "[0-9]+"