mirror of
https://github.com/quantum9Innovation/suntheme.git
synced 2024-11-28 11:03:50 -08:00
18 lines
513 B
Haskell
18 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
|