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
Data.Entry
Middleware
Paths_FeedMonad
-- Modules included in this library but not exported.
-- other-modules:
@ -45,8 +46,10 @@ library
, servant-server
, acid-state
, safecopy
, xdg-basedir
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
executable FeedMonad
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
, servant-server, text
, servant-server, text, xdg-basedir
}:
mkDerivation {
pname = "FeedMonad";
@ -9,8 +9,9 @@ mkDerivation {
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
acid-state base bytestring containers http-client http-client-tls
lens mtl safecopy servant servant-server text
acid-state base bytestring containers dyre http-client
http-client-tls lens mtl safecopy servant servant-server text
xdg-basedir
];
executableHaskellDepends = [ base ];
license = "unknown";

View File

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