mirror of
https://github.com/quantum9Innovation/suntheme.git
synced 2024-11-25 01:43:50 -08:00
76973ba364
group helper funcs for creating directory names and fetching network resources into a single module
17 lines
513 B
Haskell
17 lines
513 B
Haskell
module Getters where
|
|
|
|
import Const (prog)
|
|
|
|
import System.FilePath ((</>))
|
|
import System.Directory (XdgDirectory(XdgCache, XdgConfig), getXdgDirectory)
|
|
import Control.Exception (SomeException, try)
|
|
import Network.HTTP.Request (Response, get)
|
|
|
|
pathToCache :: String -> IO String
|
|
pathToCache str = (</> str) <$> getXdgDirectory XdgCache prog
|
|
|
|
pathToConfig :: String -> IO String
|
|
pathToConfig str = (</> str) <$> getXdgDirectory XdgConfig prog
|
|
|
|
fetch :: String -> IO (Either SomeException Response)
|
|
fetch = try . get
|