Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Use cabal over stack; upgrade dependencies
Browse files Browse the repository at this point in the history
Aeson implemented KeyMap to use over Hashmap

network client implemented equalCookieJar instead of Eq CookieJar
  • Loading branch information
rmanne committed Dec 20, 2021
1 parent 26b3937 commit fa73020
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
*/.DS_Store
.cabal-sandbox
cabal.sandbox.config
*.cabal
dist/
dist-newstyle/
test_config.yaml
.stack-work/
stack*.yaml.lock
result
.direnv
7 changes: 7 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
packages: *.cabal

source-repository-package
type: git
location: https://github.com/intolerable/api-builder.git
tag: f7440211195da98cfa93b6a97e51892b939919e1
--sha256: 0x890cr9wlc7w4g679imm90bd07z03s07g6nhjsy97r1mq76igzh
151 changes: 0 additions & 151 deletions package.yaml

This file was deleted.

161 changes: 161 additions & 0 deletions reddit.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
cabal-version: 2.4
name: reddit
version: 0.2.3.0
license: BSD-2-Clause
copyright: Copyright (c) Fraser Murray, 2013-2018
maintainer: fraser.m.murray@gmail.com
author: Fraser Murray
category: Network

-- TODO: Before hackage release.
-- A short (one-line) description of the package.
-- synopsis:

-- A longer description of the package.
description: >
A library for interfacing with Reddit''s API in Haskell. Handles
logins, rate-limiting and converting to and from JSON responses.
Supports most user-facing Reddit API functions, as well as some
moderator endpoints.
Check out the readme at <https://github.com/intolerable/reddit>.

Contributions are welcome.

-- A URL where users can report bugs.
-- bug-reports:

extra-source-files:
LICENSE
README.md

library
build-depends:
, base
, text
, base >=4.6
, aeson >=0.9
, api-builder >=0.10
, bytestring ==0.10.*
, data-default-class >=0.0.1
, free >=4
, http-client >=0.4.30
, http-client-tls >=0.2
, http-types >=0.8
, network >=2.6
, text ==1.*
, time >=1.5
, transformers >=0.4
, unordered-containers >=0.2.5
, vector >=0.10
, base64-bytestring

exposed-modules:
Reddit
, Reddit.Actions
, Reddit.Actions.Captcha
, Reddit.Actions.Comment
, Reddit.Actions.Flair
, Reddit.Actions.Message
, Reddit.Actions.Moderation
, Reddit.Actions.OAuth
, Reddit.Actions.Post
, Reddit.Actions.Search
, Reddit.Actions.Subreddit
, Reddit.Actions.Thing
, Reddit.Actions.User
, Reddit.Actions.Voting
, Reddit.Actions.Wiki
, Reddit.Login
, Reddit.Types
, Reddit.Types.Captcha
, Reddit.Types.Comment
, Reddit.Types.Error
, Reddit.Types.Flair
, Reddit.Types.Listing
, Reddit.Types.Message
, Reddit.Types.Moderation
, Reddit.Types.Options
, Reddit.Types.OAuth
, Reddit.Types.Post
, Reddit.Types.Reddit
, Reddit.Types.SearchOptions
, Reddit.Types.Subreddit
, Reddit.Types.SubredditSettings
, Reddit.Types.Thing
, Reddit.Types.User
, Reddit.Types.Wiki

other-modules:
Paths_reddit

ghc-options:
-Wall -Wcompat -fno-warn-dodgy-imports

default-extensions:
FlexibleInstances
GADTs
GeneralizedNewtypeDeriving
LambdaCase
OverloadedStrings

hs-source-dirs: src
default-language: Haskell2010

-- tests:
--
-- test-anon:
-- main: Spec.hs
-- source-dirs:
-- - test-anon
-- - test-utils
-- default-extensions:
-- - Rank2Types
-- dependencies:
-- - base ==4.*
-- - Cabal >=1.16.0
-- - api-builder
-- - data-default-class
-- - reddit
-- - hspec
-- - text
-- - time
-- - transformers
--
-- test-io:
-- main: Spec.hs
-- source-dirs:
-- - test-io
-- - test-utils
-- default-extensions:
-- - Rank2Types
-- - RecordWildCards
-- dependencies:
-- - base ==4.*
-- - Cabal >=1.16.0
-- - api-builder
-- - bytestring
-- - data-default-class
-- - directory
-- - http-client
-- - http-client-tls
-- - reddit
-- - hspec
-- - text
-- - time
-- - transformers
-- - yaml
--
-- test:
-- main: Spec.hs
-- source-dirs: test
-- dependencies:
-- - base ==4.*
-- - Cabal >=1.16.0
-- - aeson
-- - api-builder
-- - bytestring
-- - reddit
-- - hspec
-- - text
-- - time
-- - transformers
2 changes: 1 addition & 1 deletion src/Reddit/Types/Empty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Data.Aeson
import Data.Aeson.Types
import Data.Monoid
import Prelude
import qualified Data.HashMap.Strict as Hash
import qualified Data.Aeson.KeyMap as Hash

-- | More specific @void@ for forcing a @Empty@ @FromJSON@ instance
nothing :: Monad m => m Empty -> m ()
Expand Down
2 changes: 1 addition & 1 deletion src/Reddit/Types/Reddit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ instance FromJSON Modhash where
parseJSON _ = mempty

data LoginDetails = LoginDetails Modhash CookieJar
deriving (Show, Eq)
deriving Show

instance Receivable LoginDetails where
receive x = do
Expand Down
File renamed without changes.

0 comments on commit fa73020

Please sign in to comment.