From fd704e7d23c206b1beb1a40322619af428bc78b3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 7 Jun 2021 09:58:55 +0200 Subject: [PATCH] chore: local hoogle --- hoogle.sh | 18 ++++++++++++++++++ src/Handler/Allocation/Users.hs | 7 ++++--- src/Handler/Workflow/Workflow/List.hs | 3 ++- src/Jobs/Types.hs | 2 +- src/Utils/Csv/Mail.hs | 10 +++++----- stack.yaml | 3 +++ stack.yaml.lock | 14 ++++++++++++++ 7 files changed, 47 insertions(+), 10 deletions(-) create mode 100755 hoogle.sh diff --git a/hoogle.sh b/hoogle.sh new file mode 100755 index 000000000..e11f9a92e --- /dev/null +++ b/hoogle.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en .stack-work.lock "$0" "$@" || : + +move-back() { + mv -v .stack-work .stack-work-doc + [[ -d .stack-work-build ]] && mv -v .stack-work-build .stack-work +} + +if [[ -d .stack-work-doc ]]; then + [[ -d .stack-work ]] && mv -v .stack-work .stack-work-build + mv -v .stack-work-doc .stack-work + trap move-back EXIT +fi + +stack hoogle -- ${@:-server --local --port $((${PORT_OFFSET:-0} + 8081))} diff --git a/src/Handler/Allocation/Users.hs b/src/Handler/Allocation/Users.hs index 56f517607..f5769f82f 100644 --- a/src/Handler/Allocation/Users.hs +++ b/src/Handler/Allocation/Users.hs @@ -64,10 +64,11 @@ queryVetoedCourses = queryAllocationUser . to queryVetoedCourses' type UserTableData = DBRow ( Entity User , UserTableStudyFeatures , Entity AllocationUser - , Int -- ^ Applied - , Int -- ^ Assigned - , Int -- ^ Vetoed + , Int + , Int + , Int ) +-- ^ `Int`s are applied, assigned, vetoed in that order resultUser :: Lens' UserTableData (Entity User) resultUser = _dbrOutput . _1 diff --git a/src/Handler/Workflow/Workflow/List.hs b/src/Handler/Workflow/Workflow/List.hs index b29e0ff44..ae06a8083 100644 --- a/src/Handler/Workflow/Workflow/List.hs +++ b/src/Handler/Workflow/Workflow/List.hs @@ -136,9 +136,10 @@ type WorkflowWorkflowData = DBRow , Entity WorkflowWorkflow , Maybe (Entity WorkflowInstance) , Maybe (Entity WorkflowInstanceDescription) - , Maybe WorkflowWorkflowActionData -- ^ Last Action + , Maybe WorkflowWorkflowActionData , [Entity User] ) +-- ^ @Maybe `WorkflowWorkflowActionData`@ corresponds to last action type WorkflowWorkflowActionData = ( Maybe Text , UTCTime diff --git a/src/Jobs/Types.hs b/src/Jobs/Types.hs index 23402d381..ded70d4af 100644 --- a/src/Jobs/Types.hs +++ b/src/Jobs/Types.hs @@ -214,7 +214,7 @@ data JobCtl = JobCtlFlush | JobCtlQueue Job | JobCtlGenerateHealthReport HealthCheck | JobCtlTest - | JobCtlSleep Micro -- | For debugging + | JobCtlSleep Micro -- ^ For debugging deriving (Eq, Ord, Read, Show, Generic, Typeable) deriving anyclass (Hashable, NFData) diff --git a/src/Utils/Csv/Mail.hs b/src/Utils/Csv/Mail.hs index d79c77331..86efb5073 100644 --- a/src/Utils/Csv/Mail.hs +++ b/src/Utils/Csv/Mail.hs @@ -52,11 +52,11 @@ recodeCsv encOpts toUser act = fromMaybe act $ do inp <- C.sinkLazy inp' <- recode inp sourceLazy inp' .| act - -- | FormatXlsx <- fmt -> do - -- inp <- C.sinkLazy - -- archive <- throwLeft $ Zip.toArchiveOrFail inp - -- archive' <- traverseOf (_zEntries . traverse . _Entrty . _3) recode archive - -- sourceLazy (Zip.fromArchive inp') .| act + -- -- | FormatXlsx <- fmt -> do + -- -- inp <- C.sinkLazy + -- -- archive <- throwLeft $ Zip.toArchiveOrFail inp + -- -- archive' <- traverseOf (_zEntries . traverse . _Entrty . _3) recode archive + -- -- sourceLazy (Zip.fromArchive inp') .| act | otherwise -> act where diff --git a/stack.yaml b/stack.yaml index f75ba5f9a..1d1e9b98b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -98,6 +98,9 @@ extra-deps: - hlint-test-0.1.0.0@sha256:e427c0593433205fc629fb05b74c6b1deb1de72d1571f26142de008f0d5ee7a9,1814 - network-arbitrary-0.6.0.0@sha256:a7034d63295dfc41cf559ee705fc95cac9a9a01b4715300f590eaa237b5ffd48,2506 + - process-extras-0.7.4@sha256:4e79289131415796c181889c4a226ebab7fc3b0d27b164f65e1aad123ae9b9e3,1759 + - ListLike-4.7.4@sha256:613b2967df738010e8f6f6b7c47d615f6fe42081f68eba7f946d5de7552aa8a4,3778 + resolver: nightly-2021-01-11 compiler: ghc-8.10.4 allow-newer: true diff --git a/stack.yaml.lock b/stack.yaml.lock index c5af573fd..c8acf905a 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -534,6 +534,20 @@ packages: sha256: 97b797944cf068eb5fde620e005e253818f03068b2c20e9cfdd3aaa6cafcb678 original: hackage: network-arbitrary-0.6.0.0@sha256:a7034d63295dfc41cf559ee705fc95cac9a9a01b4715300f590eaa237b5ffd48,2506 +- completed: + hackage: process-extras-0.7.4@sha256:4e79289131415796c181889c4a226ebab7fc3b0d27b164f65e1aad123ae9b9e3,1759 + pantry-tree: + size: 1092 + sha256: ee89d385c9e822144698633b39f378904e42667aaca0d6ab577d7dea2b452c92 + original: + hackage: process-extras-0.7.4@sha256:4e79289131415796c181889c4a226ebab7fc3b0d27b164f65e1aad123ae9b9e3,1759 +- completed: + hackage: ListLike-4.7.4@sha256:613b2967df738010e8f6f6b7c47d615f6fe42081f68eba7f946d5de7552aa8a4,3778 + pantry-tree: + size: 1854 + sha256: 50e22178b0713d0c8367ee6bc9f3b5026422b4b285837bdf9f4173a14db1e8bf + original: + hackage: ListLike-4.7.4@sha256:613b2967df738010e8f6f6b7c47d615f6fe42081f68eba7f946d5de7552aa8a4,3778 snapshots: - completed: size: 562265