Move to subdir

This commit is contained in:
Mats Rauhala 2021-11-11 20:55:29 +02:00
parent 5b4592a496
commit caafd820b6
15 changed files with 32 additions and 16 deletions

View File

@ -27,6 +27,7 @@ library
FeedMonad FeedMonad
Data.Entry Data.Entry
Middleware Middleware
Paths_FeedMonad
-- Modules included in this library but not exported. -- Modules included in this library but not exported.
-- other-modules: -- other-modules:
@ -45,8 +46,10 @@ library
, servant-server , servant-server
, acid-state , acid-state
, safecopy , safecopy
, xdg-basedir
hs-source-dirs: src hs-source-dirs: src
default-language: Haskell2010 default-language: Haskell2010
ghc-options: -Wall
executable FeedMonad executable FeedMonad
main-is: Main.hs main-is: Main.hs

7
FeedMonad/app/Main.hs Normal file
View File

@ -0,0 +1,7 @@
module Main where
import FeedMonad (defaultMain, defaultConfig)
main :: IO ()
main =
defaultMain defaultConfig

View File

@ -1,6 +1,6 @@
{ mkDerivation, acid-state, base, bytestring, containers { mkDerivation, acid-state, base, bytestring, containers, dyre
, http-client, http-client-tls, lens, lib, mtl, safecopy, servant , http-client, http-client-tls, lens, lib, mtl, safecopy, servant
, servant-server, text , servant-server, text, xdg-basedir
}: }:
mkDerivation { mkDerivation {
pname = "FeedMonad"; pname = "FeedMonad";
@ -9,8 +9,9 @@ mkDerivation {
isLibrary = true; isLibrary = true;
isExecutable = true; isExecutable = true;
libraryHaskellDepends = [ libraryHaskellDepends = [
acid-state base bytestring containers http-client http-client-tls acid-state base bytestring containers dyre http-client
lens mtl safecopy servant servant-server text http-client-tls lens mtl safecopy servant servant-server text
xdg-basedir
]; ];
executableHaskellDepends = [ base ]; executableHaskellDepends = [ base ];
license = "unknown"; license = "unknown";

View File

@ -1,12 +1,12 @@
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE OverloadedStrings #-}
module FeedMonad where module FeedMonad where
import Data.Tree (Tree(..), Forest) import Data.Tree (Forest)
import Data.Text (Text) import Data.Text (Text)
import Data.ByteString (ByteString)
import Data.Entry (URL) import Data.Entry (URL)
import Middleware (Middleware) import Middleware (Middleware)
import Numeric.Natural (Natural) import Numeric.Natural (Natural)
import Data.Foldable (for_)
newtype Minutes = Minutes Natural newtype Minutes = Minutes Natural
@ -23,5 +23,14 @@ data FeedMonad = FeedMonad
-- authentication token -- authentication token
} }
defaultConfig :: FeedMonad
defaultConfig = FeedMonad
{ feeds = []
, filters = id
, refreshTime = Minutes 30
, secretToken = "i am a secret"
}
defaultMain :: FeedMonad -> IO () defaultMain :: FeedMonad -> IO ()
defaultMain _ = pure () defaultMain f =
print $ feeds f

4
FeedMonad/test.nix Normal file
View File

@ -0,0 +1,4 @@
with (import <nixpkgs> {});
with haskell.lib;
disableLibraryProfiling (disableExecutableProfiling (dontCheck (haskellPackages.callPackage ./. {})))

View File

@ -1,8 +0,0 @@
module Main where
import qualified MyLib (someFunc)
main :: IO ()
main = do
putStrLn "Hello, Haskell!"
MyLib.someFunc