module Sound.Analysis.Spear.PTPF.GZ where
import qualified Codec.Compression.GZip as Z
import qualified Data.ByteString.Lazy.Char8 as C
import Sound.Analysis.Spear.PTPF
parse_ptpf_gz :: C.ByteString -> Either String PTPF
parse_ptpf_gz = parse_ptpf . Z.decompress
load_ptpf_gz :: FilePath -> IO (Either String PTPF)
load_ptpf_gz = fmap parse_ptpf_gz . C.readFile
at_right :: (a -> b) -> Either t a -> Either t b
at_right f = either (Left . id) (Right . f)
load_ptpf_gz_time_asc :: FilePath -> IO (Either String [(Double, [Node])])
load_ptpf_gz_time_asc = fmap (at_right ptpf_time_asc) . load_ptpf_gz