Commit 904ee1fe authored by Diederik van Arkel's avatar Diederik van Arkel

add strictness annots to getLine(s)

parent a58ff24c
......@@ -27,7 +27,7 @@ validateLineNr :: !LineNr Text -> LineNr
getLine :: !LineNr !u:Text -> (!String, !u:Text)
getLineC :: !LineNr !u:Text -> ((!Info,!String), !u:Text)
getLines :: LineNr LineNr Text -> (StrictList String, Text)
getLines :: !LineNr !LineNr !Text -> (!StrictList String, !Text)
//getLinesC :: LineNr LineNr Text -> (StrictList (Int,String), Text)
updateLine :: !LineNr !String !.Text -> (!Int,!Int,!.Text)
......
......@@ -101,6 +101,7 @@ where
sSize (SCons string SNil) = size string
sSize (SCons string rest) = size string + sizeNewline + sSize rest
sUpdate :: !Int !*String !(StrictList String) -> *String
sUpdate i s SNil = s
sUpdate i s (SCons string SNil)
# (_,s) = sU (size string) i 0 s string
......@@ -143,7 +144,7 @@ blocksToStrings :: ![StrictList (Info,String)] -> StrictList String
blocksToStrings [] = SNil
blocksToStrings [block:blocks]
= slAppend (blockToStrings block) (blocksToStrings blocks)
blocksToStringsC :: ![StrictList (Info,String)] -> StrictList (Info,String)
blocksToStringsC [] = SNil
blocksToStringsC [block:blocks]
......@@ -200,7 +201,7 @@ where
// denotes by the line numbers. It also returns the number of
// the first block
getBlocks :: LineNr LineNr Text -> (Int, [StrictList (Info,String)])
getBlocks :: !LineNr !LineNr !Text -> (!Int, ![StrictList (Info,String)])
getBlocks first last { blocks }
= ( nrSkip
, blocks%(nrSkip,nrTake)
......@@ -209,7 +210,7 @@ where
nrSkip = first / BlockSize
nrTake = last / BlockSize + 1
getLines :: LineNr LineNr Text -> (StrictList String, Text)
getLines :: !LineNr !LineNr !Text -> (!StrictList String, !Text)
getLines first last text
= ( slTake (last - first + 1)
(slDrop first` (blocksToStrings blocks))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment