[new docs from haddock 2.0 Paolo Veronelli **20080205170008] { hunk ./docs/Test.html 1 - - -Test
 Source codeContentsIndex
Test
Synopsis
data Console = Console {
cinput :: [Maybe String]
coutput :: [String]
}
type WESC = WriterT [Err] (State Console)
testSIO :: SIO WESC
commandTest :: String -> [String] -> [String] -> [String] -> Either [Err] Bool
Documentation
data Console
Constructors
Console
cinput :: [Maybe String]
coutput :: [String]
type WESC = WriterT [Err] (State Console)
testSIO :: SIO WESC
commandTest
:: StringThe command to test -
-> [String]What will be eventually read as input -
-> [String]The file as a list of line -
-> [String]The modified file -
-> Either [Err] BoolLeft on errors, Right with the test -
Testing a console function leaving out file IO -
Produced by Haddock version 0.8
rmfile ./docs/Test.html addfile ./docs/Undo.html hunk ./docs/Undo.html 1 + + +Undo
 Source codeContentsIndex
Undo
Description
This code has been taken from + A Monad transformer UndoT on a state supporting undo , redo and hput to push the last state on history. + Redo stack is blanked on hput +
Synopsis
data History s = History {
current :: s
undos :: [s]
redos :: [s]
}
type HStateT s m = StateT (History s) m
class (Monad m, MonadState (History s) (HStateT s m)) => HCtx m s
newtype Monad m => UndoT s m a = UndoT HStateT s m a
undo :: HCtx m s => UndoT s m Bool
redo :: HCtx m s => UndoT s m Bool
hput :: HCtx m s => s -> UndoT s m ()
blank :: s -> History s
evalUndoT :: Monad m => UndoT s m a -> s -> m a
execUndoT :: Monad m => UndoT s m a -> s -> m s
Documentation
data History s
State stacks wrapping states in time +
Constructors
History
current :: slast state putted +
undos :: [s]the history of putted states (reversed) without the redos +
redos :: [s]history of the undo +
show/hide Instances
Show s => Show (History s)
type HStateT s m = StateT (History s) m
a state monad transformer with the state history +
class (Monad m, MonadState (History s) (HStateT s m)) => HCtx m s
facility to write signatures context +
newtype Monad m => UndoT s m a
a wrapper around HStateT to derive his classes and add an instance +
Constructors
UndoT HStateT s m a
show/hide Instances
Monad m => MonadState s (UndoT s m)
MonadTrans (UndoT s)
Monad m => Monad (UndoT s m)
Monad m => Functor (UndoT s m)
MonadIO m => MonadIO (UndoT s m)
undo
:: HCtx m s
=> UndoT s m BoolFalse if the undo stack was empty +

the MonadState instance for the wrapper +

tries to get back one step the state +

redo
:: HCtx m s
=> UndoT s m BoolFalse if the redo stack was empty +
tries to get back the undo operation +
hput
:: HCtx m s
=> sthe new state to put +
-> UndoT s m ()monading +
push the old state in the undo stack and set the new state (alternative to put) +
blank :: s -> History s
an History of one state +
evalUndoT
:: Monad m
=> UndoT s m aa UndoT action +
-> sthe initial state +
-> m athe result +
run the UndoT monad transformer spitting out the computation result in the inner monad +
execUndoT
:: Monad m
=> UndoT s m aa UndoT action +
-> sthe initial state +
-> m sthe final state +
run the UndoT monad transformer spitting out the final state in the inner monad +
Produced by Haddock version 2.0.0.0
hunk ./docs/doc-index-A.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (A)
Absolute
Ahi
Append
1 (Data Constructor)
2 (Data Constructor)
acceptOffsetOnly
add
rmfile ./docs/doc-index-A.html hunk ./docs/doc-index-B.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (B)
BackendErr
Begin
BigG
backend
bwdcycle
rmfile ./docs/doc-index-B.html hunk ./docs/doc-index-C.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (C)
CC
Change
1 (Data Constructor)
2 (Type/Class)
Command
CompleteCommand
Console
1 (Type/Class)
2 (Data Constructor)
Ctx
Current
checkPendings
cinput
commandLoop
commandMode
commandTest
coutput
cursor
rmfile ./docs/doc-index-C.html hunk ./docs/doc-index-D.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (D)
Delete
defaultOR
del
deln
doOffset
doRange
rmfile ./docs/doc-index-D.html hunk ./docs/doc-index-E.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (E)
Edit
EditExternal
Editor
End
Engine
Err
EvalErr
ExternalCommandErr
editOffset
editRange
elems
empty
end
errorSIO
errorlog
eval
evalSensible
externalCommand
externalSio
rmfile ./docs/doc-index-E.html hunk ./docs/doc-index-F.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (F)
FileNameMissing
FileReadErr
FileWriteErr
file
filename
first
fromstart
fwdcycle
rmfile ./docs/doc-index-F.html hunk ./docs/doc-index-H.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (H)
history
historySio
rmfile ./docs/doc-index-H.html hunk ./docs/doc-index-I.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (I)
Insert
Inside
InsideAppend
input
inputMode
inputSio
ins
rmfile ./docs/doc-index-I.html hunk ./docs/doc-index-J.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (J)
jump
jumpE
rmfile ./docs/doc-index-J.html hunk ./docs/doc-index-L.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (L)
LastLine
LastReNext
LastRePrev
Line
last
lastre
lastsaved
left
liftSio
line
linen
listIn
listOut
lns
rmfile ./docs/doc-index-L.html hunk ./docs/doc-index-M.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (M)
MarkedAs
modified
rmfile ./docs/doc-index-M.html hunk ./docs/doc-index-N.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (N)
Next
NoCommand
next
nextn
nth
numero
rmfile ./docs/doc-index-N.html hunk ./docs/doc-index-O.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (O)
ORN
ORO
ORR
Offset
OffsetOrRange
output
outputSio
rmfile ./docs/doc-index-O.html hunk ./docs/doc-index-P.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (P)
ParseE
ParserErr
PendingState
Pos
Prev
Print
parse
parseCommand
parseOffset
parseOffsetOrRange
parseRange
parser
pending
pinput
pos
prev
prevn
programSio
prop_E1
rmfile ./docs/doc-index-P.html hunk ./docs/doc-index-R.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (R)
Range
1 (Type/Class)
2 (Data Constructor)
ReNext
RePrev
RegexUnmatched
rangeResolve
rconst
readfileSio
resetpending
right
rjump
run
rmfile ./docs/doc-index-R.html hunk ./docs/doc-index-S.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (S)
SIO
1 (Type/Class)
2 (Data Constructor)
SetFilename
SmallG
Stato
1 (Type/Class)
2 (Data Constructor)
StatoE
StopErr
start
rmfile ./docs/doc-index-S.html hunk ./docs/doc-index-T.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (T)
testSIO
through
tillend
rmfile ./docs/doc-index-T.html hunk ./docs/doc-index-W.html 1 - - - (Index)
 ContentsIndex
ABCDEFGHIJLMNOPRSTW
Index (W)
W
1 (Type/Class)
2 (Data Constructor)
WESC
Write
WriteNew
write
writefail
writefileSio
rmfile ./docs/doc-index-W.html hunk ./docs/doc-index.html 82 ->BufferEditorEditorBuffer= max_results && !full) + { + table.className = ""; + status.innerHTML = "More than " + max_results + ", press Search to display"; + } + else + { + // decide what you need to clear/show + if (shown_range) + setclass(shown_range[0], shown_range[1], "indexrow"); + setclass(first, last, "indexshow"); + shown_range = [first, last]; + table.className = "indexsearch"; + status.innerHTML = ""; + } + + + function setclass(first, last, status) + { + for (var i = first; i <= last; i++) + { + children[i].className = status; + } + } + + + // do a binary search, treating 0 as ... + // return either -1 (no 0's found) or location of most far match + function bisect(dir) + { + var first = 0, finish = children.length - 1; + var mid, success = false; + + while (finish - first > 3) + { + mid = Math.floor((finish + first) / 2); + + var i = checkitem(mid); + if (i == 0) i = dir; + if (i == -1) + finish = mid; + else + first = mid; + } + var a = (dir == 1 ? first : finish); + var b = (dir == 1 ? finish : first); + for (var i = b; i != a - dir; i -= dir) + { + if (checkitem(i) == 0) return i; + } + return -1; + } + + + // from an index, decide what the result is + // 0 = match, -1 is lower, 1 is higher + function checkitem(i) + { + var s = getitem(i).toLowerCase().substr(0, text.length); + if (s == text) return 0; + else return (s > text ? -1 : 1); + } + + + // from an index, get its string + // this abstracts over alternates + function getitem(i) + { + for ( ; i >= 0; i--) + { + var s = children[i].firstChild.firstChild.data; + if (s.indexOf(' ') == -1) + return s; + } + return ""; // should never be reached + } +} hunk ./docs/haddock.js 1 -// Haddock JavaScript utilities -function toggle(button,id) -{ - var n = document.getElementById(id).style; - if (n.display == "none") - { - button.src = "minus.gif"; - n.display = "block"; - } - else - { - button.src = "plus.gif"; - n.display = "none"; - } -} rmfile ./docs/haddock.js hunk ./makefile 4 -DOCCED = Buffer.hs Editor.hs Eval.hs Operation.hs Undo.hs Engine.hs Main.hs \ - Offset.hs Parser.hs hunk ./makefile 6 - haddock -B /usr/local/lib/ghc-6.8.2/ --source-module=http://code.haskell.org/Hedi/%M.hs -o docs -h $(DOCCED) + haddock -B /usr/local/lib/ghc-6.8.2/ \ + --source-module=http://code.haskell.org/Hedi/%M.hs \ + -o docs -h Main.hs }