Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
head.hackage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
head.hackage
Commits
7a782d0b
Commit
7a782d0b
authored
1 year ago
by
Teo Camarasu
Browse files
Options
Downloads
Patches
Plain Diff
Remove out-of-date haskeline patch
parent
54421d60
No related branches found
No related tags found
1 merge request
!325
Add some patches to deal with foldl' being exported from Prelude
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patches/haskeline-0.7.5.0.patch
+0
-106
0 additions, 106 deletions
patches/haskeline-0.7.5.0.patch
with
0 additions
and
106 deletions
patches/haskeline-0.7.5.0.patch
deleted
100644 → 0
+
0
−
106
View file @
54421d60
diff --git a/System/Console/Haskeline/Backend/DumbTerm.hs b/System/Console/Haskeline/Backend/DumbTerm.hs
index 4186c27..c7733b2 100644
--- a/System/Console/Haskeline/Backend/DumbTerm.hs
+++ b/System/Console/Haskeline/Backend/DumbTerm.hs
@@ -10,7 +10,7 @@
import System.IO
import Control.Applicative(Applicative)
import Control.Monad(liftM)
--- TODO:
+-- TODO:
---- Put "<" and ">" at end of term if scrolls off.
---- Have a margin at the ends
@@ -34,17 +34,17 @@
evalDumb = EvalTerm (evalStateT' initWindow . unDumbTerm) (DumbTerm . lift)
runDumbTerm :: Handles -> MaybeT IO RunTerm
runDumbTerm h = liftIO $ posixRunTerm h (posixLayouts h) [] id evalDumb
-
+
instance (MonadException m, MonadReader Layout m) => Term (DumbTerm m) where
reposition _ s = refitLine s
- drawLineDiff = drawLineDiff'
-
+ drawLineDiff x y = drawLineDiff' x y
+
printLines = mapM_ (printText . (++ crlf))
moveToNextLine _ = printText crlf
clearLayout = clearLayoutD
ringBell True = printText "\a"
ringBell False = return ()
-
+
printText :: MonadIO m => String -> DumbTerm m ()
printText str = do
h <- liftM ehOut ask
@@ -109,7 +109,7 @@
refitLine (xs,ys) = do
(_,[],l) -> (zs,l)
(_,zs',_) -> dropFrames w zs'
-
+
clearDeadText :: Int -> String
clearDeadText n | n > 0 = spaces n ++ backs n
| otherwise = ""
diff --git a/System/Console/Haskeline/Backend/Terminfo.hs b/System/Console/Haskeline/Backend/Terminfo.hs
index fb28553..e5307f5 100644
--- a/System/Console/Haskeline/Backend/Terminfo.hs
+++ b/System/Console/Haskeline/Backend/Terminfo.hs
@@ -28,8 +28,8 @@
import qualified Control.Monad.Trans.Writer as Writer
-- Low-level terminal output
-- | Keep track of all of the output capabilities we can use.
---
--- We'll be frequently using the (automatic) 'Monoid' instance for
+--
+-- We'll be frequently using the (automatic) 'Monoid' instance for
-- @Actions -> TermOutput@.
data Actions = Actions {leftA, rightA, upA :: Int -> TermOutput,
clearToLineEnd :: TermOutput,
@@ -120,8 +120,8 @@
evalDraw term actions = EvalTerm eval liftE
. evalStateT' initTermRows
. runReaderT' term
. runReaderT' actions
- . unDraw
-
+ . unDraw
+
runTerminfoDraw :: Handles -> MaybeT IO RunTerm
runTerminfoDraw h = do
@@ -169,7 +169,7 @@
terminfoKeys term = mapMaybe getSequence keyCapabilities
,(keyEnter, simpleKey $ KeyChar '\n')
]
-
+
----------------------------------------------------------------
-- Terminal output actions
@@ -200,7 +200,7 @@
output t = Writer.tell t -- NB: explicit argument enables build with ghc-6.12.3
-- see GHC ticket #1749).
outputText :: String -> ActionM ()
-outputText = output . const . termText
+outputText s = output (const (termText s))
left,right,up :: Int -> TermAction
left = flip leftA
@@ -236,7 +236,7 @@
moveToPos p = do
moveRelative :: Int -> ActionM ()
moveRelative n = liftM3 (advancePos n) ask get get
- >>= moveToPos
+ >>= \p -> moveToPos p
-- Note that these move by a certain number of cells, not graphemes.
changeRight, changeLeft :: Int -> ActionM ()
@@ -352,7 +352,7 @@
repositionT _ s = do
instance (MonadException m, MonadReader Layout m) => Term (Draw m) where
drawLineDiff xs ys = runActionT $ drawLineDiffT xs ys
reposition layout lc = runActionT $ repositionT layout lc
-
+
printLines = mapM_ $ \line -> runActionT $ do
outputText line
output nl
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment