From 5b9576b50078ce8f67e911f60978d601ecc414cd Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 2 Mar 2017 07:11:35 -0700 Subject: missing type signatures & alignment --- Main.hs | 1 + Presets.hs | 7 +++++++ Types/Preset.hs | 4 ++-- UI.hs | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Main.hs b/Main.hs index b951231..9b33887 100644 --- a/Main.hs +++ b/Main.hs @@ -190,6 +190,7 @@ processCommand st = case st^.stScanSess of presentUI :: St -> IO () presentUI st = runTheApp st >>= processCommand +main :: IO () main = makeInitialState >>= presentUI -- | Create a process, wait for it to finish, don't close any diff --git a/Presets.hs b/Presets.hs index 46c039f..4666c87 100644 --- a/Presets.hs +++ b/Presets.hs @@ -44,6 +44,7 @@ presets = [ Preset 'H' "handwritten notes" handwrittenNotes lookupPreset :: Char -> Maybe Preset lookupPreset c = find (\(Preset k _ _) -> c == k) presets +handwrittenNotes :: St -> St handwrittenNotes = \st -> st { _stOCR = False , _stColour = Greyscale @@ -52,6 +53,7 @@ handwrittenNotes = \st -> st , _stOutFormat = PDF } +typewrittenDocs :: St -> St typewrittenDocs = \st -> st { _stOCR = True , _stColour = Greyscale @@ -60,6 +62,7 @@ typewrittenDocs = \st -> st , _stOutFormat = PDF } +colourPDF :: St -> St colourPDF = \st -> st { _stOCR = False , _stColour = Colour @@ -68,6 +71,7 @@ colourPDF = \st -> st , _stOutFormat = PDF } +colourPNG :: St -> St colourPNG = \st -> st { _stOCR = False , _stColour = Colour @@ -76,6 +80,7 @@ colourPNG = \st -> st , _stOutFormat = PNG } +colourCroppedPNG :: St -> St colourCroppedPNG = \st -> st { _stOCR = False , _stColour = Colour @@ -84,6 +89,7 @@ colourCroppedPNG = \st -> st , _stOutFormat = PNG } +bnwPDF :: St -> St bnwPDF = \st -> st { _stOCR = False , _stColour = Lineart @@ -92,6 +98,7 @@ bnwPDF = \st -> st , _stOutFormat = PDF } +photo :: St -> St photo = \st -> st { _stOCR = False , _stColour = Colour diff --git a/Types/Preset.hs b/Types/Preset.hs index f74e936..5832464 100644 --- a/Types/Preset.hs +++ b/Types/Preset.hs @@ -26,7 +26,7 @@ module Types.Preset where import Types.State type PresetToggleKey = Char -type PresetDesc = String -type PresetPreset = St -> St +type PresetDesc = String +type PresetPreset = St -> St data Preset = Preset PresetToggleKey PresetDesc PresetPreset diff --git a/UI.hs b/UI.hs index 084458f..1c42949 100644 --- a/UI.hs +++ b/UI.hs @@ -136,4 +136,5 @@ theApp = , appAttrMap = const $ attrMap V.defAttr [] } +runTheApp :: St -> IO St runTheApp = defaultMain theApp -- cgit v1.2.3