Skip to content

Commit

Permalink
cabal changes for nix
Browse files Browse the repository at this point in the history
  • Loading branch information
kaychaks committed May 26, 2018
1 parent 3eaade0 commit fe446a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
10 changes: 5 additions & 5 deletions blog-hakyll.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ cabal-version: >= 1.10
executable site
main-is: site.hs
other-modules: Importer
build-depends: base == 4.*
, hakyll == 4.9.*
, containers >= 0.3 && < 0.6
, time >= 1.4 && < 1.8
, time-locale-compat >= 0.1 && < 0.2
build-depends: base >= 4
, hakyll >= 4.9
, containers >= 0.3
, time >= 1.4
, time-locale-compat >= 0.1
, aeson
, lens
, lens-aeson
Expand Down
19 changes: 10 additions & 9 deletions importer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@ checklinkedpost s = let pat = "\\[(.*)\\]\\((.*)\\)" :: String


instance FromJSON Post where
parseJSON = withObject "data" (\o -> do
pid <- o .: "id"
t <- o .: "title"
c <- o .: "markdown"
d <- o .: "published_at"
s <- o .: "slug"
let u = "http://kaushikc.org/" <> s
let (tt, ml) = checklinkedpost t
return $ Post pid tt c d Nothing u s ml)
parseJSON = withObject "data" (
\o -> do
pid <- o .: "id"
t <- o .: "title"
c <- o .: "markdown"
d <- o .: "published_at"
s <- o .: "slug"
let u = "http://kaushikc.org/" <> s
let (tt, ml) = checklinkedpost t
return $ Post pid tt c d Nothing u s ml)

tpair :: (AsValue t) => T.Text -> T.Text -> Fold t (Int, Value)
tpair l r = folding $ \v ->
Expand Down

0 comments on commit fe446a5

Please sign in to comment.