0 | module Data.Swirl.Console
 1 |
 2 | import public Data.Swirl
 3 |
 4 | import public Language.Implicits.IfUnsolved
 5 |
 6 | import System.File
 7 |
 8 | %default covering
 9 |
10 | export
11 | stdinAsChars : HasIO io =>
12 |                Monoid r =>
13 |                (0 _ : IfUnsolved io IO) =>
14 |                (0 _ : IfUnsolved e Void) =>
15 |                (0 _ : IfUnsolved r ()) =>
16 |                Swirl io e r Char
17 | stdinAsChars = tickUntil (fEOF @{ByResult} stdin) >> getChar
18 |
19 | export
20 | stdinAsLines : HasIO io =>
21 |                Monoid r =>
22 |                (0 _ : IfUnsolved io IO) =>
23 |                (0 _ : IfUnsolved e Void) =>
24 |                (0 _ : IfUnsolved r ()) =>
25 |                Swirl io e r String
26 | stdinAsLines = tickUntil (fEOF @{ByResult} stdin) >> getLine
27 |