|
definition: |
splitByLine :: String -> (String,String)
splitByLine s = splitByLineIter "" s
where
splitByLineIter acc "" = (reverse acc,"")
splitByLineIter acc (c:cs) | c == '\n' = (reverse ('\n':acc),cs)
| otherwise = splitByLineIter (c:acc) cs
|
|
demand: |
argument 1 |
|
deterministic: |
deterministic operation |
|
documentation: |
The function splitByLine splits a string at the first newline
@param s - The string
@result A pair of strings, one containg the string before the newline
with the newline, the other containing the string after the newline
|
|
failfree: |
_ |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_) |-> {(,)}}
|
|
name: |
splitByLine |
|
precedence: |
no precedence defined |
|
result-values: |
{(,)}
|
|
signature: |
String -> (String, String) |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
yes |
|
totally-defined: |
possibly non-reducible on same data term |