module Sound.Sc3.Server.Graphdef.Io where
import Data.List 
import Sound.Sc3.Server.Graphdef 
import qualified Sound.Sc3.Server.Graphdef.Binary as Binary 
import qualified Sound.Sc3.Server.Graphdef.Text as Text 
read_graphdef_file :: FilePath -> IO Graphdef
read_graphdef_file :: FilePath -> IO Graphdef
read_graphdef_file FilePath
fn =
  if FilePath
".scsyndef.text" FilePath -> FilePath -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isSuffixOf` FilePath
fn
    then FilePath -> IO Graphdef
Text.read_graphdef_file FilePath
fn
    else FilePath -> IO Graphdef
Binary.read_graphdef_file FilePath
fn