aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2017-03-02 07:11:35 -0700
committerSean Whitton <spwhitton@spwhitton.name>2017-03-02 07:11:35 -0700
commit5b9576b50078ce8f67e911f60978d601ecc414cd (patch)
tree997399d3622ac365fe0d296346948d9791d312b9
parent5443d758bbc4d894e547d56a60b2be221fc7779a (diff)
downloadsscan-5b9576b50078ce8f67e911f60978d601ecc414cd.tar.gz
missing type signatures & alignment
-rw-r--r--Main.hs1
-rw-r--r--Presets.hs7
-rw-r--r--Types/Preset.hs4
-rw-r--r--UI.hs1
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