<commit_before>module Wikirick.Application where

import Control.Lens
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Snaplet.Auth
import Snap.Snaplet.Session

import Wikirick.JSONConnection

data App = App
  { _heist :: Snaplet (Heist App)
  , _sess :: Snaplet SessionManager
  , _auth :: Snaplet (AuthManager App)
  , _json :: Snaplet JSONConnection
  }
makeLenses ''App

instance HasHeist App where
  heistLens = subSnaplet heist

type AppHandler = Handler App App<commit_msg>Add wikirick's sub snaplets to the app<commit_after>module Wikirick.Application where

import Control.Lens
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Snaplet.Auth
import Snap.Snaplet.Session

import Wikirick.Article
import Wikirick.JSONConnection
import qualified Wikirick.URLMapper as U

data App = App
  { _heist :: Snaplet (Heist App)
  , _sess :: Snaplet SessionManager
  , _auth :: Snaplet (AuthManager App)
  , _json :: Snaplet JSONConnection
  , _articles :: Snaplet (ArticleRepository App)
  , _urlMapper :: Snaplet U.URLMapper
  }
makeLenses ''App

instance HasHeist App where
  heistLens = subSnaplet heist

instance U.HasURLMapper App where
  refURLMapper = urlMapper

type AppHandler = Handler App App
{'fraction_non_alphanumeric': 0.06902218570254724, 'fraction_numerical': 0.0, 'mean_word_length': 4.7725118483412325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5257811', 'n_tokens_mistral': 416, 'n_tokens_neox': 391, 'n_words': 117}